Views
No views yet

git clone --recursive https://github.com/Wan-Video/Wan-Animate-2.git1conda create -n wan_animate_2 python==3.11 -y
2pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu126pip install -r requirements.txtflash_attn:pip install flash-attn --no-build-isolationpip install -e .| Model | Download Links |
|---|---|
| Wan-Animate-2 | 🤗 HuggingFace 🤖 ModelScope |
1pip install "huggingface_hub[cli]"
2huggingface-cli download Wan-AI/Wan2.2-Animate-2-14B --local-dir ./ckpts/1pip install modelscope
2modelscope download --model Wan-AI/Wan2.2-Animate-2-14B --local_dir ./ckpts/用中文客观描述图片中的内容,包括以下要点:人物外观描述,不描述动作行为。 背景描述,忽略主观评价和情绪推测。 下面给出描述范例,必须遵循这个范式,不要输出额外的符号: 人物外观描述:穿着一件浅蓝色的校服衬衫,领口和袖口有白色边饰。胸前有一个圆形徽章。 背景描述:背景为明亮、整洁的教室或办公室,氛围安静有序。Wan-Animate-2 Base:
1export PYTHONPATH="$(pwd)"
2cd infer
3python wan_animate_2_demo.py \
4 --prompt "人物外观描述:一只银灰色虎斑纹的小猫,拥有圆润的脸庞、竖立的耳朵和巨大的圆形眼睛。它身穿一套深蓝色的制服套装,包括一件带有金色纽扣的西装外套和一条百褶裙。外套里面搭配着白色衬衫,领口处系着一个红色的蝴蝶结,袖口露出白色的衬衫边缘。背景描述:背景为纯白色,光线均匀明亮,无其他杂物或装饰。" \
5 --refer-img-file ../examples/demo1/reference.png \
6 --refer-video-file ../examples/demo1/template.mp4 \
7 --config ./wan_animate_2.yamlWan-Animate-2 Distillation:
1export PYTHONPATH="$(pwd)"
2cd infer
3python wan_animate_2_demo.py \
4 --prompt "人物外观描述:一只银灰色虎斑纹的小猫,拥有圆润的脸庞、竖立的耳朵和巨大的圆形眼睛。它身穿一套深蓝色的制服套装,包括一件带有金色纽扣的西装外套和一条百褶裙。外套里面搭配着白色衬衫,领口处系着一个红色的蝴蝶结,袖口露出白色的衬衫边缘。背景描述:背景为纯白色,光线均匀明亮,无其他杂物或装饰。" \
5 --refer-img-file ../examples/demo1/reference.png \
6 --refer-video-file ../examples/demo1/template.mp4 \
7 --config ./wan_animate_2_distillation.yaml \
8 --sample_guide_scale 1.0
9 --step 101pip install git+https://github.com/huggingface/diffusers.git
2pip install flash-attn --no-build-isolationWan-Animate-2 Base:1import torch
2from diffusers import WanAnimate2Pipeline
3from diffusers.utils import export_to_video, load_image
4
5pipe = WanAnimate2Pipeline.from_pretrained(
6 "Wan-AI/Wan2.2-Animate-2-14B-Diffusers", torch_dtype=torch.bfloat16
7).to("cuda")
8
9output = pipe(
10 image=load_image("../examples/demo1/reference.png"),
11 driving_video="../examples/demo1/template.mp4",
12 prompt="人物外观描述:一只银灰色虎斑纹的小猫,拥有圆润的脸庞、竖立的耳朵和巨大的圆形眼睛。它身穿一套深蓝色的制服套装,包括一件带有金色纽扣的西装外套和一条百褶裙。外套里面搭配着白色衬衫,领口处系着一个红色的蝴蝶结,袖口露出白色的衬衫边缘。背景描述:背景为纯白色,光线均匀明亮,无其他杂物或装饰。",
13 height=800,
14 width=640,
15 num_inference_steps=40,
16)
17
18export_to_video(output.frames[0], "output.mp4", fps=24)Wan-Animate-2 Distillation (10 steps, no CFG):1pipe = WanAnimate2Pipeline.from_pretrained(
2 "Wan-AI/Wan2.2-Animate-2-14B-Distilled-Diffusers", torch_dtype=torch.bfloat16
3).to("cuda")
4
5output = pipe(
6 image=load_image("../examples/demo1/reference.png"),
7 driving_video="../examples/demo1/template.mp4",
8 prompt="人物外观描述:一只银灰色虎斑纹的小猫,拥有圆润的脸庞、竖立的耳朵和巨大的圆形眼睛。它身穿一套深蓝色的制服套装,包括一件带有金色纽扣的西装外套和一条百褶裙。外套里面搭配着白色衬衫,领口处系着一个红色的蝴蝶结,袖口露出白色的衬衫边缘。背景描述:背景为纯白色,光线均匀明亮,无其他杂物或装饰。",
9 num_inference_steps=10,
10 guidance_scale=1.0, # no classifier-free guidance
11 flow_solver="euler", # Euler scheduler for distilled model
12)
13
14export_to_video(output.frames[0], "output.mp4", fps=24)Wan-Animate-2 Base:
1cd infer
2python wan_animate_2_gradio.pyWan-Animate-2 Distillation:
1cd infer
2python wan_animate_2_gradio_distillation.py1@article{wang2026wananimate2,
2 title = {Wan-Animate-2: Real-Time End-to-End Character Animation via Diffusion Transformer},
3 author = {Wang, Guangyuan and Hu, Li and Meng, Dechao and Zhang, Zhongyi and Zhang, Peng and
4 Huang, Mingyang and Zhang, Ruoshi and Sun, Ke and Zhang, Zhe and
5 Wang, Xingjun and Cheng, Gang and Zhang, Bang},
6 journal = {arXiv preprint arXiv:TODO.06009},
7 year = {2026},
8 url = {https://arxiv.org/abs/TODO.06009}
9}