Skip to content

Commit dbb2d55

Browse files
committed
Add Wan2.2 example
1 parent 7058a36 commit dbb2d55

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

examples/models/wan22/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Wan2.2
2+
3+
[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.
4+
5+
??? info "Prerequisites"
6+
Once `dstack` is [installed](https://dstack.ai/docs/installation), clone the repo with examples.
7+
8+
<div class="termy">
9+
10+
```shell
11+
$ git clone https://github.com/dstackai/dstack
12+
$ cd dstack
13+
```
14+
15+
</div>
16+
17+
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:
18+
19+
<div class="termy">
20+
21+
```shell
22+
$ dstack apply -f examples/models/wan22/dev-env.dstack.yml
23+
Provisioning...
24+
---> 100%
25+
```
26+
27+
</div>
28+
29+
Then you can attach to the dev environment and generate videos:
30+
31+
<div class="termy">
32+
33+
```shell
34+
$ 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."
35+
36+
[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.
37+
[2025-08-26 05:41:54,912] INFO: Creating WanT2V pipeline.
38+
[2025-08-26 05:42:50,296] INFO: loading ./Wan2.2-T2V-A14B/models_t5_umt5-xxl-enc-bf16.pth
39+
```
40+
41+
</div>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
type: dev-environment
2+
name: wan22
3+
ide: vscode
4+
nvcc: true
5+
repos:
6+
- https://github.com/Wan-Video/Wan2.2.git
7+
init:
8+
- |
9+
pip install torch
10+
pip install -r requirements.txt
11+
pip install "huggingface_hub[cli]"
12+
huggingface-cli download Wan-AI/Wan2.2-T2V-A14B --local-dir ./Wan2.2-T2V-A14B
13+
resources:
14+
gpu:
15+
name: H100
16+
count: 8 # Set to 1.. if 8 GPUs not available trading inferece speed
17+
disk: 200GB

0 commit comments

Comments
 (0)