Pose and Face Detection
Where your driving video becomes a skeleton and a face crop
- model
- images
- retarget_image
- pose_data
- face_images
- key_frame_body_points
- bboxes
- face_bboxes
This is the heart of the WanAnimatePreprocess pack. You feed it a driving video - someone dancing, gesturing, whatever - and it turns that footage into the two things Wan Animate actually consumes: a per-frame skeleton description and clean face crops. Wan Animate, for the record, is Alibaba's motion-transfer model for Wan 2.2: you supply a reference character and a driving clip, and it re-performs the motion with the new character's body and face. The preprocess is where that whole trick gets set up, and this node does most of it.
It's from kijai, the same author behind ComfyUI-WanVideoWrapper, and in the wild it's the node people mean when they say "Kijai's WanAnimatePreprocess for face capture" in those group-dance remix workflows you see on r/comfyui. The example workflow bundled with the pack runs it right after a video loader, feeds its outputs into Draw ViT Pose and a SAM2 segmentation pass, and only then touches the Animate model.
How it works
Under the hood it runs the two models the loader gave it, in two passes per frame:
- YOLO finds the person, returning a bounding box.
- The box is cropped and resized to ViTPose's 256×192 input; ViTPose extracts whole-body keypoints (body, face, hands).
- Those keypoints become
pose_data- the normalized skeleton every downstream node reads.
The clever part is retargeting. If you feed a retarget_image, the node runs the same detection on it, then rescales every limb of the driving skeleton to the reference character's proportions. That's how you make a 5'2" cartoon character dance with a real dancer's motion - the skeleton gets remapped onto the reference's bone lengths before the model ever sees it.
The inputs that matter
model- thePOSEMODELfromONNX Detection Model Loader.images- your driving frames (load a video with VHS and pass the images).width/height- the generation resolution, not the video's. Default 832×480, and it should match what you'll ask the Animate model for.retarget_image- optional. A reference character image to remap the motion onto. Leave empty if you're just doing straight motion transfer.face_padding- when > 0, detected faces get padded by this many pixels and resized to 512×512. Default 0 means faces are cropped tight, which can chop foreheads and chins.
What comes out, and where it goes
pose_data(POSEDATA) - wire this intoDraw ViT Poseto render the skeleton images, or intoPose Retarget Prompt Helperif you're on the Flux Kontext path.face_images(IMAGE) - 512×512 face crops, one per frame. These go to a SAM2 segmentation node to build a face mask.key_frame_body_points(STRING) - a JSON list of body keypoints sampled across the clip, used as SAM2 point prompts for the body mask.bboxesandface_bboxes(BBOX) - raw boxes, useful if you want to draw or filter masks yourself.
The workflow shape is basically: video → this node → Draw ViT Pose for pose images, and face/body keypoints + SAM2 for masks, then everything concats into the Animate model's inputs. The pack's example_workflows folder has the canonical version, and it's worth opening before you try to invent your own.
Real-world gotchas
Face crops can come out empty on fast-moving frames where the face keypoints land off-screen. The node handles it by logging a warning and substituting a fallback crop - your mask will be wrong on those frames, so keep face_padding at 16 or so to give faces margin.
Retarget quality depends on the reference. The community's standard advice when the result looks wrong: keep the reference and driving video at the same resolution and have the character face roughly the same direction. If your reference is a back view and your dancer faces forward, the retarget will fight itself.
The skeleton looks tiny or cropped after retargeting. That's what Draw ViT Pose's retarget_padding exists for - it makes room for the retargeted body when it gets resized back to the target frame.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | POSEMODEL | — | |
| images | IMAGE | — | |
| width | INT | 83264–2048 | Width of the generation |
| height | INT | 48064–2048 | Height of the generation |
| retarget_imageopt | IMAGE | Optional reference image for pose retargeting | |
| face_paddingopt | INT | 00–512 | When > 0, the detected face images are padded and resized to 512x512 |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| pose_data | POSEDATA | — |
| face_images | IMAGE | — |
| key_frame_body_points | STRING | — |
| bboxes | BBOX | — |
| face_bboxes | BBOX, | — |