Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<h2 id="dev-guide">📚 Develop Guide</h2>

We provide a step-by-step guide for adding new models, please refer to the following tutorial.
Expand Down
6 changes: 5 additions & 1 deletion examples/hunyuan_video_usp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions xfuser/config/diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down