diff --git a/README.md b/README.md index 7e7de4b8..75ccaa7f 100644 --- a/README.md +++ b/README.md @@ -232,15 +232,9 @@ Below is a list of validated diffusers version requirements. If the model is not | Model Name | Diffusers version | | --- | --- | | [Flux](https://huggingface.co/black-forest-labs/FLUX.1-dev) | >= 0.35.2 | +| [HunyuanVideo](https://github.com/Tencent/HunyuanVideo) | >= 0.35.2 | -#### HunyuanVideo - -- Supports `diffusers<=0.32.2` (breaking commit diffusers @ [8907a70](https://github.com/huggingface/diffusers/commit/8907a70a366c96b2322656f57b24e442ea392c7b)) - - For this constraint, supports `xfuser<=0.4.3post3` (breaking commit xDiT @ [0c20492](https://github.com/xdit-project/xDiT/commit/0c2049281d5f698622d006658fb99d1aa92a9d50)) - -- Supports bs=1 only -

📚 Develop Guide

We provide a step-by-step guide for adding new models, please refer to the following tutorial. diff --git a/examples/hunyuan_video_usp_example.py b/examples/hunyuan_video_usp_example.py index 9871c02c..e8033d87 100644 --- a/examples/hunyuan_video_usp_example.py +++ b/examples/hunyuan_video_usp_example.py @@ -3,6 +3,10 @@ from typing import Any, Dict, Union, Optional import logging import time +from xfuser.config.diffusers import has_valid_diffusers_version, get_minimum_diffusers_version +if not has_valid_diffusers_version("hunyuanvideo"): + minimum_diffusers_version = get_minimum_diffusers_version("hunyuanvideo") + raise ImportError(f"Please install diffusers>={minimum_diffusers_version} to use HunyuanVideo.") import torch @@ -76,7 +80,7 @@ def new_forward( image_rotary_emb = self.rope(hidden_states) # 2. Conditional embeddings - temb = self.time_text_embed(timestep, guidance, pooled_projections) + temb, _ = self.time_text_embed(timestep=timestep, pooled_projection=pooled_projections, guidance=guidance) hidden_states = self.x_embedder(hidden_states) encoder_hidden_states = self.context_embedder(encoder_hidden_states, timestep, diff --git a/xfuser/config/diffusers.py b/xfuser/config/diffusers.py index 5c13c53c..0a66ca11 100644 --- a/xfuser/config/diffusers.py +++ b/xfuser/config/diffusers.py @@ -4,6 +4,7 @@ DEFAULT_MINIMUM_DIFFUSERS_VERSION = "0.33.0" MINIMUM_DIFFUSERS_VERSIONS = { "flux": "0.35.2", + "hunyuanvideo": "0.35.2", } def has_valid_diffusers_version(model_name: str|None = None) -> bool: