Animation by pose: UniAnimate
Lesson "wrapper-unianimate", in the group WanVideoWrapper of the lesson list. Steps: 16.
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 a picture repeats the moves of a person in a video. A Wan 2.1 model and one LoRA are enough.
What you need
- Model files the lesson checks:
- Wan 2.1 image to video (i2v) 14B:
models/diffusion_models, for examplewan2.1_i2v_480p_14B_fp8_scaled.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; - the UniAnimate LoRA:
models/loras, for exampleUniAnimate-Wan2.1-14B-Lora-12000-fp16.safetensors.
- Wan 2.1 image to video (i2v) 14B:
- Nodes: WanVideo Model Loader, WanVideo T5 Text Encoder Loader, WanVideo VAE Loader, WanVideo TextEncode, Load Image, Load CLIP Vision, WanVideo ClipVision Encode, WanVideo Lora Select, Load Video, Get Video Components, WanVideo UniAnimate DWPose Detector, WanVideo UniAnimate Pose Input, WanVideo ImageToVideo Encode, 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 UniAnimate does (reading)
UniAnimate is a LoRA for the Wan 2.1 "image to video" model. With it the model obeys a skeleton: the pose is taken out of every frame of a video of a person moving, and the character from your picture repeats those moves.
Unlike Wan Animate it does not carry the face over, only the body. In return no separate model is needed.
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.
The lesson builds the graph from an empty canvas: "File ▸ New project".
Load the model
Add the node WanVideo Model Loader and choose in the field
modela Wan 2.1i2v14B model, the 480p or the 720p one.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, any Wan 2.1 I2V 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 the nodes WanVideo T5 Text Encoder Loader and WanVideo VAE Loader. In the field
model_nameof the first choose the fileumt5-xxl-enc, of the second the filewan_2.1_vae.Describe the character and the place
Add the node WanVideo TextEncode and connect the output of WanVideo T5 Text Encoder Loader to its input
t5. In the fieldpositive_promptsay who is in the frame, what they wear and where they are.The movement needs no words: the video sets it.
Load the character
Add the node Load Image and choose in the field
imagethe picture of the character. Full height works best, in a pose close to the first pose of the video.Show the picture to the model
Add the nodes Load CLIP Vision and WanVideo ClipVision Encode. In the field
clip_nameof the first choose the fileclip_vision_h. Connect its output to the inputclip_visionof the second, and the picture to the inputimage_1.The Wan 2.1 "image to video" models cannot do without it.
Add the UniAnimate LoRA
Add the node WanVideo Lora Select and choose in the field
lorathe UniAnimate file for Wan 2.1 14B. Connect its output to the inputloraof the model loader.Without this LoRA a skeleton cannot be connected: the run stops with an error.
Load the video with the movement
Add the nodes Load Video and Get Video Components. In the field
fileof the first choose a video from theinputfolder, and connect its output to the inputvideoof the second.Take a video where the person is alone in the frame and seen whole.
Take the pose out
Add the node WanVideo UniAnimate DWPose Detector. Connect the output
imagesof Get Video Components to its inputpose_images, and the picture of the character to the inputreference_pose_image.The node draws a skeleton for every frame and, apart from them, the skeleton of the character in the picture. From the second the model learns how the build of the character differs from the person in the video.
This node downloads two small pose models itself when the graph is first run in ComfyUI. This app downloads nothing.
Hand the skeleton to the model
Add the node WanVideo UniAnimate Pose Input. Connect the output poses of WanVideo UniAnimate DWPose Detector to the input pose_images, and the output reference_pose to the input reference_pose_image.
Leave the field strength at 1: it is how firmly the skeleton leads the character.
- Prepare the start
Add the node WanVideo ImageToVideo Encode. Connect the output of WanVideo VAE Loader to its input vae, the picture to the input start_image, and the output of WanVideo ClipVision Encode to the input clip_embeds.
Leave the field num_frames at 81, which is five seconds. The fields width and height set the size of the clip.
- Add the sampler
Add the node WanVideo Sampler and connect to it:
- the model to the input
model; - the prompt to the input
text_embeds; - the output of WanVideo ImageToVideo Encode to the input
image_embeds; - the output of WanVideo UniAnimate Pose Input to the input
unianimate_poses.
- Turn the result into frames
Add the node WanVideo Decode. Connect the output of the sampler to its input samples, and the output of WanVideo VAE Loader to the input vae.
- Assemble the clip
Add the nodes Create Video and Save Video: the frames into images, the clip into video. Set the field fps to 16.
- If the character moves wrong (reading)
What to check:
- the frames of the video are of another size than the clip: put a resize node between Get Video Components and WanVideo UniAnimate DWPose Detector and set the same
widthandheightas in WanVideo ImageToVideo Encode; - the video is longer than the clip: the poses left over are dropped. If it is shorter, lower
num_frames; - the skeleton vanishes or shows where it should not: change
score_thresholdin WanVideo UniAnimate DWPose Detector; - the character changes build: check that the picture of the character is connected to the input
reference_pose_image.
- 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 takes longer than usual: the node WanVideo UniAnimate DWPose Detector downloads its models.
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 model:
- a WanVideo Model Loader node.
modelof WanVideo Model Loader holds Wan 2.1 image to video (i2v) 14B; such a file lies inmodels/diffusion_models, for examplewan2.1_i2v_480p_14B_fp8_scaled.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 character and the place:
- 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 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, Add the UniAnimate LoRA:
- a WanVideo Lora Select node.
loraof WanVideo Lora Select intoloraof WanVideo Model Loader.loraof WanVideo Lora Select holds the UniAnimate LoRA; such a file lies inmodels/loras, for exampleUniAnimate-Wan2.1-14B-Lora-12000-fp16.safetensors.
- Step 8, Load the video with the movement:
- a Load Video node.
- a Get Video Components node.
VIDEOof Load Video intovideoof Get Video Components.fileof Load Video: a value is chosen.
- Step 9, Take the pose out:
- a WanVideo UniAnimate DWPose Detector node.
imagesof Get Video Components intopose_imagesof WanVideo UniAnimate DWPose Detector (a Upscale Image or Resize Image or ImageResizeKJv2 or ImageFromBatch or GetImageRangeFromBatch in between is accepted).IMAGEof Load Image intoreference_pose_imageof WanVideo UniAnimate DWPose Detector (a Upscale Image or Resize Image or ImageResizeKJv2 or ImageFromBatch or GetImageRangeFromBatch in between is accepted).
- Step 10, Hand the skeleton to the model:
- a WanVideo UniAnimate Pose Input node.
posesof WanVideo UniAnimate DWPose Detector intopose_imagesof WanVideo UniAnimate Pose Input.reference_poseof WanVideo UniAnimate DWPose Detector intoreference_pose_imageof WanVideo UniAnimate Pose Input.strengthof WanVideo UniAnimate Pose Input is from 0.5 to 1; Do this for me sets 1. Why: this is how strongly the skeleton leads the character. At 1 the character follows the poses fully.
- Step 11, Prepare the start:
- a WanVideo ImageToVideo Encode node.
vaeof WanVideo VAE Loader intovaeof WanVideo ImageToVideo Encode.IMAGEof Load Image intostart_imageof WanVideo ImageToVideo Encode.WANVIDIMAGE_CLIPEMBEDSof WanVideo ClipVision Encode intoclip_embedsof WanVideo ImageToVideo Encode.num_framesof WanVideo ImageToVideo Encode 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 12, 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 ImageToVideo Encode intoimage_embedsof WanVideo Sampler.unianimate_posesof WanVideo UniAnimate Pose Input intounianimate_posesof WanVideo Sampler.
- Step 13, Turn the result into frames:
- a WanVideo Decode node.
samplesof WanVideo Sampler intosamplesof WanVideo Decode.vaeof WanVideo VAE Loader intovaeof WanVideo Decode.
- Step 14, Assemble 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
- Video frames of another size than the clip: add a resize node with the same width and height.
- The character picture not connected to
reference_pose_image: the character takes the build of the person in the video.