Views
No views yet
python gen.py --model-path FastDM/Wan2.2-T2V-A14B-Merge-Lightning-V1.1-Diffusers --architecture wan --guidance-scale 1.0 --height 720 --width 1280 --steps 4 --use-fp8 --output-path ./wan-a14b-lightningv1.1-fp8-guid1.mp4 --num-frames 81 --fps 16 --prompts "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."1import torch
2import numpy as np
3from diffusers import WanPipeline, AutoencoderKLWan
4from diffusers.utils import export_to_video, load_image
5
6dtype = torch.bfloat16
7device = "cuda:2"
8vae = AutoencoderKLWan.from_pretrained("FastDM/Wan2.2-T2V-A14B-Merge-Lightning-V1.1-Diffusers", subfolder="vae", torch_dtype=torch.float32)
9pipe = WanPipeline.from_pretrained("FastDM/Wan2.2-T2V-A14B-Merge-Lightning-V1.1-Diffusers", vae=vae, torch_dtype=dtype)
10pipe.to(device)
11
12height = 720
13width = 1280
14
15prompt = "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
16negative_prompt = "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"
17output = pipe(
18 prompt=prompt,
19 negative_prompt=negative_prompt,
20 height=height,
21 width=width,
22 num_frames=81,
23 guidance_scale=1.0,
24 num_inference_steps=4,
25).frames[0]
26export_to_video(output, "t2v_out.mp4", fps=16)
27