Text-to-Video
Diffusers
Safetensors
WanPipeline
YiYiXu commited on
Commit
8512148
·
verified ·
1 Parent(s): e536f1a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -3
README.md CHANGED
@@ -1,3 +1,33 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+ ```py
5
+ import torch
6
+ import numpy as np
7
+ from diffusers import WanPipeline, AutoencoderKLWan
8
+ from diffusers.utils import export_to_video, load_image
9
+
10
+ dtype = torch.bfloat16
11
+ device = "cuda:2"
12
+ vae = AutoencoderKLWan.from_pretrained("Wan-AI/Wan2.2-T2V-A14B-Diffusers", subfolder="vae", torch_dtype=torch.float32)
13
+ pipe = WanPipeline.from_pretrained("Wan-AI/Wan2.2-T2V-A14B-Diffusers", vae=vae, torch_dtype=dtype)
14
+ pipe.to(device)
15
+
16
+ height = 720
17
+ width = 1280
18
+
19
+
20
+ prompt = "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
21
+ negative_prompt = "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"
22
+ output = pipe(
23
+ prompt=prompt,
24
+ negative_prompt=negative_prompt,
25
+ height=height,
26
+ width=width,
27
+ num_frames=81,
28
+ guidance_scale=4.0,
29
+ guidance_scale_2=3.0,
30
+ num_inference_steps=40,
31
+ ).frames[0]
32
+ export_to_video(output, "t2v_out.mp4", fps=16)
33
+ ```