XB-BOX - 🎬 Wan 动画转视频
The engine under Wan Animate motion transfer — reference image + pose video in, sampled video out
- positive
- negative
- vae
- clip_vision_output
- reference_image
- face_video
- pose_video
- background_video
- character_mask
- continue_motion
- positive
- negative
- latent
- trim_latent
- trim_image
- video_frame_offset
Wan Animate is Alibaba's character animation model: give it a still of a character plus a driving video, and it transfers the driver's motion onto your character. The hard part is assembling the inputs - reference image, pose video, face video, background, a mask, and the motion-continuity frames - into the specific conditioning tensors the model reads. XB_WanAnimateToVideo is the pack's engine for exactly that, and it's the node the bus/relay pipeline calls under the hood for every segment.
Read the source and it's a faithful port of the official Wan Animate conditioning logic with two XB signatures: everything VAE-encoded goes through a tiled encoder (vae.encode_tiled) so big driving videos don't OOM, and it defensively reorders/continuity-fixes tensors (.contiguous(), dtype alignment with the VAE weights) because the author's target users are on AMD ROCm where those details are the difference between working and an MIOpen crash.
Inputs that matter
Required: positive / negative (CONDITIONING), vae, geometry (width, height, length - default 77), batch_size, continue_motion_max_frames (default 5, the overlap frames that smooth a segment boundary), video_frame_offset (where in the source video this segment starts), and vae_tile_size (default 256).
The optional inputs are the heart of Animate:
- reference_image - the character still. If you leave it empty, it uses a gray placeholder, which is as broken as it sounds for real work.
- pose_video - the driving motion (the stick-figure/pose feed).
- face_video - drives facial expression, encoded at 512x512.
- background_video - keeps the scene consistent across segments.
- character_mask - masks which pixels belong to the character vs. background.
- continue_motion - the tail of the previous segment, for seamless chaining.
- clip_vision_output - from a CLIP vision encode of the reference, used for identity.
Outputs: positive, negative, latent, plus three helper INTs - trim_latent, trim_image (how many latent/frames to trim off the front, which is how overlap frames get removed), and video_frame_offset (the advanced offset, mainly for the relay pipeline).
The honest take
You almost never place this node by hand - the pack's XB_WanAnimate_ParamBus + XB_WanAnimate_RelayNode combo drives it automatically, choosing segment lengths, offsets, and trims. Use it directly only if you're building a single-shot Animate clip without the long-form machinery. If you're new, note this node does the conditioning, not the sampling - it outputs a latent that still needs a Wan-compatible sampler and a VAE decode. And remember the model context is still ~81 frames: this node is built to chain, so lean on the relay nodes rather than trying one huge length.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
then restart, or use ComfyUI Manager ("XB_ToolBox"). You need the Wan 2.2 Animate model weights and a Wan sampler available separately.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| vae | VAE | — | |
| width | INT | 83216–16384 | — |
| height | INT | 48016–16384 | — |
| length | INT | 771–16384 | — |
| batch_size | INT | 11–4096 | — |
| continue_motion_max_frames | INT | 51–16384 | — |
| video_frame_offset | INT | 00–16384 | — |
| vae_tile_size | INT | 2560–2048 | — |
| clip_vision_outputopt | CLIP_VISION_OUTPUT | — | |
| reference_imageopt | IMAGE | — | |
| face_videoopt | IMAGE | — | |
| pose_videoopt | IMAGE | — | |
| background_videoopt | IMAGE | — | |
| character_maskopt | MASK | — | |
| continue_motionopt | IMAGE | — | |
| scale_methodopt | COMBO | lanczos | 5 options: lanczos, bilinear, bicubic, nearest-exact, area |
| crop_modeopt | COMBO | center | 2 options: disabled, center |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| latent | LATENT | — |
| trim_latent | INT | — |
| trim_image | INT | — |
| video_frame_offset | INT | — |