a-r-r-o-w HF staff commited on
Commit
c98d8f8
·
verified ·
1 Parent(s): b103d29

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -0
README.md CHANGED
@@ -159,6 +159,32 @@ pip install "xfuser>=0.4.1"
159
  torchrun --nproc_per_node=8 generate.py --task t2v-14B --size 1280*720 --ckpt_dir ./Wan2.1-T2V-14B --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
160
  ```
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
  ##### (2) Using Prompt Extention
164
 
 
159
  torchrun --nproc_per_node=8 generate.py --task t2v-14B --size 1280*720 --ckpt_dir ./Wan2.1-T2V-14B --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
160
  ```
161
 
162
+ Wan can also be run directly using 🤗 Diffusers!
163
+
164
+ ```python
165
+ import torch
166
+ from diffusers import AutoencoderKLWan, WanPipeline
167
+ from diffusers.utils import export_to_video
168
+
169
+ # Available models: Wan-AI/Wan2.1-T2V-14B, Wan-AI/Wan2.1-T2V-1.3B
170
+ model_id = "Wan-AI/Wan2.1-T2V-14B"
171
+ vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
172
+ pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
173
+ pipe.to("cuda")
174
+
175
+ prompt = "A cat walks on the grass, realistic"
176
+ negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
177
+
178
+ output = pipe(
179
+ prompt=prompt,
180
+ negative_prompt=negative_prompt,
181
+ height=480,
182
+ width=832,
183
+ num_frames=81,
184
+ guidance_scale=5.0
185
+ ).frames[0]
186
+ export_to_video(output, "output.mp4", fps=15)
187
+ ```
188
 
189
  ##### (2) Using Prompt Extention
190