Skip to content

Add support for Wan2.X I2V models#583

Merged
jcaraban merged 34 commits intoxdit-project:mainfrom
avjves:feature/wan-i2v
Oct 30, 2025
Merged

Add support for Wan2.X I2V models#583
jcaraban merged 34 commits intoxdit-project:mainfrom
avjves:feature/wan-i2v

Conversation

@avjves
Copy link
Collaborator

@avjves avjves commented Oct 30, 2025

What?

Adds support for Wan2.X (Wan2.1 and Wan2.2) I2V models.

How?

Ports the model implementation from diffusers and adds SP support. Both Ulysses and Ring attention work. Support is gated behind diffusers version 0.35.2. For now it only supports the I2V models / task, but future tasks will be added in the future. The settings are set to be as close as possible to the original Wan2.2/Wan2.1 repo.

Tests

Wan2.2 with 8 MI300Xs, running:

torchrun --nproc_per_node=8 examples/wan_i2v_example.py --height 720 --width 1280 --num_frames 81 --model Wan-AI/Wan2.2-I2V-A14B-Diffusers --ulysses_degree 8 --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." --num_inference_steps 40 --use_torch_compile --seed 42 --img_file_path https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/wan_i2v_input.JPG

output:
https://github.com/user-attachments/assets/d5ac29f8-a54d-43b6-95ae-67d431c42263

Wan2.1 with 8 MI300Xs, running:

torchrun --nproc_per_node=8 examples/wan_i2v_example.py --height 720 --width 1280 --num_frames 81 --model Wan-AI/Wan2.1-I2V-14B-720P-Diffusers --ulysses_degree 8 --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside." --num_inference_steps 40 --use_torch_compile --seed 42 --img_file_path https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/wan_i2v_input.JPG

output:
https://github.com/user-attachments/assets/2ed172b6-ba0a-4b5a-8802-dc5372350969

Copy link
Collaborator

@jcaraban jcaraban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks more straightforward than I expected ✅
Would be great to test other vendor hardware before merge, to be extra sure.

@jcaraban jcaraban requested a review from feifeibear October 30, 2025 14:07
@avjves
Copy link
Collaborator Author

avjves commented Oct 30, 2025

Here's a sample from Wan 2.1 with 8xH100s:

wan_2_1_h100.mp4

@jcaraban jcaraban merged commit 83978b5 into xdit-project:main Oct 30, 2025
@nuclearwu
Copy link

@avjves I ran it on the npu and it reported insufficient memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants