Animation by pose: Wan Animate
Lesson "wrapper-animate", in the group WanVideoWrapper of the lesson list. Steps: 14.
Consent first
Only someone who agrees may be brought to life this way: yourself, a made-up character, or a person who gave permission. Obtain permission for the source material and follow local law. See Content rules.
What you will be able to do
The character from your picture repeats the moves and the face of the person in a video.
What you need
- Model files the lesson checks:
- the Wan 2.2 Animate model:
models/diffusion_models, for exampleWan2_2-Animate-14B_fp8_e4m3fn_scaled_KJ.safetensors; - the umt5-xxl text encoder of Wan:
models/text_encoders, for exampleumt5_xxl_fp8_e4m3fn_scaled.safetensors; - the Wan 2.1 VAE (wan_2.1_vae):
models/vae, for examplewan_2.1_vae.safetensors; - clip_vision_h:
models/clip_vision, for exampleclip_vision_h.safetensors; - a ViTPose model:
models/detection, for examplevitpose-l-wholebody.onnx; - a YOLO model:
models/detection, for exampleyolov10m.onnx.
- the Wan 2.2 Animate model:
- Nodes: WanVideo Model Loader, WanVideo T5 Text Encoder Loader, WanVideo VAE Loader, WanVideo TextEncode, Load Image, Load CLIP Vision, WanVideo ClipVision Encode, Load Video, Get Video Components, ONNX Detection Model Loader, Pose and Face Detection, Draw ViT Pose, WanVideo Animate Embeds, WanVideo Sampler, WanVideo Decode, Create Video, Save Video.
- The app downloads and installs nothing. The step texts below say which files and folders, and which ComfyUI template names them.
The steps
The words of each step, as the lesson shows them. Node names are in bold.
What Wan Animate does (reading)
Wan 2.2 Animate takes a picture of a character and a video of a person moving. Special nodes take the pose and the face out of every frame of the video, and the model draws your character in those poses with that face.
Only someone who agrees may be brought to life this way: yourself, a made-up character, or a person who gave permission. Obtain permission for the source material and follow local law.
This is a separate model in one file, not a pair of
highandlow. The lesson builds the graph from an empty canvas: "File ▸ New project".Load the Animate model
Add a WanVideo Model Loader node and choose the Wan 2.2 Animate file in its
modelfield.If the file you need is not in the list, your ComfyUI does not have it. The app downloads nothing. The easiest way is to open, in ComfyUI itself, the Animate example graph from the
example_workflowsfolder of the WanVideoWrapper pack: it shows which files are missing and where to put them. Then choose "Sync ▸ Sync now" in this app's menu, and the files appear in the lists.The text reader and the VAE
Add WanVideo T5 Text Encoder Loader and WanVideo VAE Loader. In the
model_namefield of the first choose theumt5-xxl-encfile, in the second thewan_2.1_vaefile. These are the files of "Video on WanVideoWrapper".Describe the scene briefly
Add a WanVideo TextEncode node and connect the output of WanVideo T5 Text Encoder Loader to its
t5input. Inpositive_promptdescribe the character and the place in a couple of sentences.The video sets the motion here, so the prompt is shorter than usual.
Load the picture of the character
Add a Load Image node and choose the picture of the character in its
imagefield. A character seen whole or from the waist up, facing the camera, with no other people near, works best.Show the picture to the model
Add Load CLIP Vision and WanVideo ClipVision Encode. In the
clip_namefield of the first choose theclip_vision_hfile. Connect its output to theclip_visioninput of the second, and the picture toimage_1.This way the model sees what the character looks like, not only reads about it.
Load the video with the motion
Add Load Video and Get Video Components. In the
filefield choose a video of the person whose moves are to be repeated. Connect the output of Load Video to thevideoinput of Get Video Components.The model draws 16 frames a second. If the video was shot at another rate, the motion in the clip runs faster or slower.
Take out the pose and the face
Add three nodes of the ComfyUI-WanAnimatePreprocess pack: ONNX Detection Model Loader, Pose and Face Detection and Draw ViT Pose.
- In ONNX Detection Model Loader choose the ViTPose pose model in
vitpose_modeland the YOLO person finder inyolo_model. Both lie in thedetectionfolder. - Its
modeloutput to themodelinput of Pose and Face Detection, the frames toimages. - The
pose_dataoutput of Pose and Face Detection to thepose_datainput of Draw ViT Pose: it draws the poses as stick figures.
- In ONNX Detection Model Loader choose the ViTPose pose model in
Build the start of the clip
Add an WanVideo Animate Embeds node and connect to it:
- to
vae, the output of WanVideo VAE Loader; - to
ref_images, the picture of the character; - to
pose_images, the output of Draw ViT Pose; - to
face_images, theface_imagesoutput of Pose and Face Detection; - to
clip_embeds, the output of WanVideo ClipVision Encode.
Set
num_framesto 81, andwidthandheightas in the clip.- to
Add the sampler
Add a WanVideo Sampler node. Connect the model to model, the prompt to text_embeds, and the output of WanVideo Animate Embeds to image_embeds.
There is one sampler here: one model, no split into two passes. Take steps and cfg from the model's page. With a speed-up LoRA steps 6 and cfg 1 are usual.
- Turn the result into frames
Add a WanVideo Decode node. Connect the sampler's output to its samples input and the output of WanVideo VAE Loader to its vae input.
- Save the clip
Add Create Video and Save Video, the frames into images, the clip into video. Set fps to 16.
- When the result is not right (reading)
What to change in WanVideo Animate Embeds:
- the character repeats the pose too rigidly or breaks: lower
pose_strengthto 0.8; - the face is someone else's or frozen: change
face_strength; - the colour changes from piece to piece: set
colormatchtomkl; - a clip longer than 77 frames is made in pieces:
frame_window_sizesets their length.
Keep the proportions of the picture, the clip and the sample video alike.
- The graph is ready (reading)
Save the graph with "File ▸ Save workflow for ComfyUI…", open the file in ComfyUI and run it there. This app runs nothing in ComfyUI itself.
The first run is long: besides the model itself, the pose models are loaded.
What the lesson checks
A reading step is done when you press Got it, next. A doing step ticks itself off when the canvas holds:
- Step 2, Load the Animate model:
- a WanVideo Model Loader node.
modelof WanVideo Model Loader holds the Wan 2.2 Animate model; such a file lies inmodels/diffusion_models, for exampleWan2_2-Animate-14B_fp8_e4m3fn_scaled_KJ.safetensors.
- Step 3, The text reader and the VAE:
- a WanVideo T5 Text Encoder Loader node.
- a WanVideo VAE Loader node.
model_nameof WanVideo T5 Text Encoder Loader holds the umt5-xxl text encoder of Wan; such a file lies inmodels/text_encoders, for exampleumt5_xxl_fp8_e4m3fn_scaled.safetensors.model_nameof WanVideo VAE Loader holds the Wan 2.1 VAE (wan_2.1_vae); such a file lies inmodels/vae, for examplewan_2.1_vae.safetensors.
- Step 4, Describe the scene briefly:
- a WanVideo TextEncode node.
wan_t5_modelof WanVideo T5 Text Encoder Loader intot5of WanVideo TextEncode.positive_promptof WanVideo TextEncode holds at least 3 characters and 2 real words.
- Step 5, Load the picture of the character:
- a Load Image node.
imageof Load Image: a value is chosen.
- Step 6, Show the picture to the model:
- a Load CLIP Vision node.
- a WanVideo ClipVision Encode node.
CLIP_VISIONof Load CLIP Vision intoclip_visionof WanVideo ClipVision Encode.IMAGEof Load Image intoimage_1of WanVideo ClipVision Encode.clip_nameof Load CLIP Vision holds clip_vision_h; such a file lies inmodels/clip_vision, for exampleclip_vision_h.safetensors.
- Step 7, Load the video with the motion:
- a Load Video node.
- a Get Video Components node.
VIDEOof Load Video intovideoof Get Video Components.fileof Load Video: a value is chosen.
- Step 8, Take out the pose and the face:
- a ONNX Detection Model Loader node.
- a Pose and Face Detection node.
- a Draw ViT Pose node.
modelof ONNX Detection Model Loader intomodelof Pose and Face Detection.imagesof Get Video Components intoimagesof Pose and Face Detection.pose_dataof Pose and Face Detection intopose_dataof Draw ViT Pose.vitpose_modelof ONNX Detection Model Loader holds a ViTPose model; such a file lies inmodels/detection, for examplevitpose-l-wholebody.onnx.yolo_modelof ONNX Detection Model Loader holds a YOLO model; such a file lies inmodels/detection, for exampleyolov10m.onnx.
- Step 9, Build the start of the clip:
- a WanVideo Animate Embeds node.
vaeof WanVideo VAE Loader intovaeof WanVideo Animate Embeds.IMAGEof Load Image intoref_imagesof WanVideo Animate Embeds.pose_imagesof Draw ViT Pose intopose_imagesof WanVideo Animate Embeds.face_imagesof Pose and Face Detection intoface_imagesof WanVideo Animate Embeds.WANVIDIMAGE_CLIPEMBEDSof WanVideo ClipVision Encode intoclip_embedsof WanVideo Animate Embeds.num_framesof WanVideo Animate Embeds is from 49 to 121, a frame count of the form 4n + 1; Do this for me sets 81. Why: wan takes a number of frames of the form 4n + 1: 49, 81, 121. 81 frames at 16 per second make five seconds.
- Step 10, Add the sampler:
- a WanVideo Sampler node.
modelof WanVideo Model Loader intomodelof WanVideo Sampler.text_embedsof WanVideo TextEncode intotext_embedsof WanVideo Sampler.WANVIDIMAGE_EMBEDSof WanVideo Animate Embeds intoimage_embedsof WanVideo Sampler.
- Step 11, Turn the result into frames:
- a WanVideo Decode node.
samplesof WanVideo Sampler intosamplesof WanVideo Decode.vaeof WanVideo VAE Loader intovaeof WanVideo Decode.
- Step 12, Save the clip:
- a Create Video node.
- a Save Video node.
IMAGEof WanVideo Decode intoimagesof Create Video.VIDEOof Create Video intovideoof Save Video.fpsof Create Video is16. Why: wan draws 16 frames per second. With another number the clip runs faster or slower than it was meant to.
Mistakes people make
- Different proportions for picture, clip and driving video.
- A driving video at another frame rate: motion too fast or too slow.
- Several people in the driving video: the detector mixes them.