Views
No views yet
| Component | Original | This repo |
|---|---|---|
transformer/ (high-noise expert) | float32 (~57 GB) | bfloat16 (~29 GB) |
transformer_2/ (low-noise expert) | float32 (~57 GB) | bfloat16 (~29 GB) |
text_encoder/ | bfloat16 | bfloat16 (unchanged) |
vae/ | float32 | float32 (unchanged) |
1import torch
2from diffusers import WanPipeline, AutoencoderKLWan
3from diffusers.utils import export_to_video
4
5vae = AutoencoderKLWan.from_pretrained(
6 "Calamdor/Wan2.2-T2V-A14B-BF16", subfolder="vae", torch_dtype=torch.float32
7)
8pipe = WanPipeline.from_pretrained(
9 "Calamdor/Wan2.2-T2V-A14B-BF16", vae=vae, torch_dtype=torch.bfloat16
10)
11pipe.to("cuda")
12
13output = pipe(
14 prompt="Two anthropomorphic cats in comfy boxing gear fight intensely on a spotlighted stage.",
15 negative_prompt="色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走",
16 height=720,
17 width=1280,
18 num_frames=81,
19 guidance_scale=4.0,
20 guidance_scale_2=3.0,
21 num_inference_steps=40,
22).frames[0]
23export_to_video(output, "output.mp4", fps=16)Note: Requires diffusers installed from source until the next stable release includes Wan2.2 support:pip install git+https://github.com/huggingface/diffusers