-
-
Notifications
You must be signed in to change notification settings - Fork 223
Add Wan2.2 example #3029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Wan2.2 example #3029
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Wan2.2 | ||
|
|
||
| [Wan2.2](https://github.com/Wan-Video/Wan2.2) is an open-source SOTA foundational video model. This example shows how to run the T2V-A14B model variant via `dstack` for text-to-video generation. | ||
|
|
||
| ??? info "Prerequisites" | ||
| Once `dstack` is [installed](https://dstack.ai/docs/installation), clone the repo with examples. | ||
|
|
||
| <div class="termy"> | ||
|
|
||
| ```shell | ||
| $ git clone https://github.com/dstackai/dstack | ||
| $ cd dstack | ||
| ``` | ||
|
|
||
| </div> | ||
|
|
||
| Apply the [configuration](https://github.com/dstackai/dstack/blob/master/examples/models/wan22/dev-env.dstack.yml) to provision a GPU instance and run a dev environment with all the Wan2.2 dependencies installed: | ||
|
|
||
| <div class="termy"> | ||
|
|
||
| ```shell | ||
| $ dstack apply -f examples/models/wan22/dev-env.dstack.yml | ||
| Provisioning... | ||
| ---> 100% | ||
| ``` | ||
|
|
||
| </div> | ||
|
|
||
| Then you can attach to the dev environment and generate videos: | ||
|
|
||
| <div class="termy"> | ||
|
|
||
| ```shell | ||
| $ torchrun --nproc_per_node=8 generate.py --task t2v-A14B --size 1280*720 --ckpt_dir ./Wan2.2-T2V-A14B --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume, you first need to invoke
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All required deps are installed in init
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, strange, you are right, but it didn't work out of the box. Will try one more time
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also from the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But even if I install all correctly: I still, it still requires For some reason, these libraries are not included into the project deps but required. |
||
|
|
||
| [2025-08-26 05:41:54,911] INFO: Input prompt: Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage. | ||
| [2025-08-26 05:41:54,912] INFO: Creating WanT2V pipeline. | ||
| [2025-08-26 05:42:50,296] INFO: loading ./Wan2.2-T2V-A14B/models_t5_umt5-xxl-enc-bf16.pth | ||
| ``` | ||
|
|
||
| </div> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| type: dev-environment | ||
| name: wan22 | ||
| ide: vscode | ||
| nvcc: true | ||
| repos: | ||
| - https://github.com/Wan-Video/Wan2.2.git | ||
| init: | ||
| - | | ||
| pip install torch | ||
| pip install -r requirements.txt | ||
| pip install "huggingface_hub[cli]" | ||
| huggingface-cli download Wan-AI/Wan2.2-T2V-A14B --local-dir ./Wan2.2-T2V-A14B | ||
| resources: | ||
| gpu: | ||
| name: H100 | ||
| count: 8 # Set to 1.. if 8 GPUs not available trading inferece speed | ||
| disk: 200GB |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I guess its better to pass $DSTACK_GPUS_NUM instead of hardcoding 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plus we could check the number of GPUs and run single GPU version if its 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean replacing direct torchrun call with an if statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could run it as a task, and yes, have an
if?