Nodes/ComfyUI-CustomNodeKit/WanAnimate To Video (自定义)
ComfyUI Node

WanAnimate To Video (自定义)

The one node that glues a whole WanAnimate generation together

By user2318·Created 4 months ago·Updated about a month ago· 56
WanAnimate To Video (自定义)
  • positive
  • negative
  • vae
  • clip_vision_output
  • reference_image
  • face_video
  • pose_video
  • continue_motion
  • background_video
  • character_mask
  • prev_latent
  • positive
  • negative
  • latent
  • trim_latent
  • trim_image
  • video_frame_offset
  • concat_latent
  • latent_yaw_angles
width832
height480
length77
batch_size1
continue_motion_max_frames5
video_frame_offset0
transition_width0
modevanilla
tail_frame_count0
tail_start_strength0.00
tail_end_strength0.00
ref_mode原模式
yaw_angles0.00
face_strength1.00
pose_strength1.00
mid_frame-1
mid_strength0.50
neutral_mix_min0.00
neutral_mix_max1.00

WanAnimate is Alibaba's open motion-transfer model: you hand it a reference image of a character plus a pose/face driving video, and it re-renders the character performing that motion. The fiddly part has always been the preprocessing - the reference image has to be tiled 1+4n into latent frames, the pose video has to become a pose-conditioning latent, the face video gets its own channel, the character mask, the tail frames for continuation... on a stock workflow that's a half-dozen nodes wired by hand, and one wrong shape silently wrecks the output.

WanAnimateToVideoCustom collapses all of that into one node. You feed it the raw ingredients - reference image, pose video, face video, background, mask - and it encodes, arranges, and concatenates everything into the positive/negative/latent triple that goes straight into a KSampler. It's the node that makes the pack's "WanAnimate_ref_pics_loop+context" workflow readable at all.

The inputs that matter

You don't need to touch most of these to get a first result. Start with:

  • positive / negative - your CLIP-conditioned prompts (required).
  • vae - the Wan VAE (required).
  • width / height (default 832×480, multiples of 16) and length (default 77, multiple of 4) - output geometry. 77 pixel frames is the classic WanAnimate chunk.
  • reference_image - the character reference batch. Feed it the selected_images output from the pack's Reference Image Selector. The node handles the 1+4n tiling internally (first image ×1, each extra ×4).
  • pose_video / face_video - the driving inputs. Both optional, both encoded into the right latent slots.
  • ref_mode - 原模式 (original) is the default 1+4n batch encode; 兼容模式 (compatible) encodes each reference frame independently, which is what EverAnimate-trained LoRAs expect.
  • mode - the continuation strategy for long videos: vanilla is stock behavior, legacy does a tail-frame fade mask, fix does black-frame detection with a transition zone (transition_width).
  • continue_motion or prev_latent - how the next chunk starts from the last one. Feed the previous chunk's tail frames as continue_motion, or (better) feed its full concat_latent into prev_latent, which ignores continue_motion and replaces the neutral-gray frames directly.
  • video_frame_offset - the chain counter; wire the previous chunk's video_frame_offset output into the next chunk's input.

Outputs

positive, negative, latent go to the KSampler. trim_latent and trim_image tell you how many leading frames are reference anchors you should cut when decoding. concat_latent is the fully-assembled latent (feed it to a VAE decode for output), and video_frame_offset plus latent_yaw_angles chain into the next chunk.

Reality check

This is a third-party wrapper around WanAnimate, and Wan 2.2 is the last open Wan - the interesting ecosystem now lives in derivatives like SCAIL-2, which this same pack also supports. The honest take: if your motion-transfer target is a different character or you need proportions preserved, SCAIL-2 is the better base; WanAnimate is where you land for a recognizable existing character and where the pack's reference-selector/yaw machinery really shines. It also expects a hefty supporting stack - the README's workflows pull in sdpose-ood, ComfyUI-WanAnimatePreprocess, VideoHelperSuite and friends, so installing this node alone won't run the full graph.

Install

Part of ComfyUI-CustomNodeKit. ComfyUI Manager → search "ComfyUI-CustomNodeKit", or:

cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt

Restart ComfyUI. No model files ship with the pack - you need the WanAnimate model weights plus your pose/face detection stack separately.

CategoryWanLoop/整合节点

Inputs (30)

NameTypeDefaultDescription
positiveCONDITIONING正向提示词 conditioning。Positive prompt conditioning.
negativeCONDITIONING负向提示词 conditioning。Negative prompt conditioning.
vaeVAEWan 模型的 VAE,用于编码参考图和窗口帧。VAE for the Wan model, used to encode reference images and window frames.
widthINT83216–16384生成视频的宽度(像素),必须是 16 的倍数。Width of the generated video (pixels), must be a multiple of 16.
heightINT48016–16384生成视频的高度(像素),必须是 16 的倍数。Height of the generated video (pixels), must be a multiple of 16.
lengthINT771–16384生成视频的帧数(像素帧),必须是 4 的倍数。Number of frames for the generated video (pixel frames), must be a multiple of 4.
batch_sizeINT11–4096批量大小,通常保持为 1。Batch size, usually keep at 1.
continue_motion_max_framesINT51–16384从上一块携带的最大帧数(RGB 图像),用于块间接续。Maximum frames carried from the previous chunk (RGB images), used for inter-chunk continuity.
video_frame_offsetINT00–16384当前 chunk 的帧偏移量,从上一块的 video_frame_offset 输出接入。Frame offset of the current chunk, connected from the previous chunk's video_frame_offset output.
transition_widthINT00–128fix 模式下黑帧区域的过渡区宽度,0=禁用过渡。Transition zone width for black frame areas in fix mode, 0=disable transition.
modeCOMBOvanilla掩码模式:vanilla=官方行为(fix/legacy不动),fix=黑帧检测+过渡,legacy=尾帧渐变。Mask mode: vanilla=official behavior, fix=black frame detection+transition, legacy=tail frame fade.
tail_frame_countINT00–1000legacy 模式下尾帧处理帧数,0=禁用。Number of tail frames to process in legacy mode, 0=disabled.
tail_start_strengthFLOAT0.000–1legacy 模式尾帧起始强度。Tail frame start strength in legacy mode.
tail_end_strengthFLOAT0.000–1legacy 模式尾帧结束强度。Tail frame end strength in legacy mode.
ref_modeCOMBO原模式原模式=内部1+4n排列后批量编码(接selected_images);兼容模式=逐帧独立编码(接selected_images,兼容EverAnimate LoRA)。Original mode=internal 1+4n arrangement then batch encode; Compatible mode=per-frame independent encode (compatible with EverAnimate LoRA).
clip_vision_outputoptCLIP_VISION_OUTPUTCLIP Vision 输出,用于参考图语义理解。CLIP Vision output for reference image semantic understanding.
reference_imageoptIMAGE参考图输入。接参考图选择器的 selected_images(排序后的原始图片,节点内部自动处理1+4n或逐帧编码)。Reference image input. Connect to selected_images from ReferenceImageSelector (node handles 1+4n or per-frame encoding internally).
face_videooptIMAGE面部视频帧序列,用于面部引导。Face video frame sequence for face guidance.
pose_videooptIMAGE姿态视频帧序列,用于姿态引导。Pose video frame sequence for pose guidance.
continue_motionoptIMAGE上一块的末尾 RGB 帧,用于块间运动接续。Last RGB frames of the previous chunk for inter-chunk motion continuity.
background_videooptIMAGE背景视频帧序列,用于替换/增强背景。Background video frame sequence for background replacement/enhancement.
character_maskoptMASK角色遮罩,用于精确控制角色区域的保护。Character mask for precise control of character area protection.
yaw_anglesoptFLOAT0.00-180–180偏航角序列(像素帧级别)。Yaw angle sequence (pixel frame level).
face_strengthoptFLOAT1.000–1面部引导强度,0=关闭面部引导。Face guidance strength, 0=disable face guidance.
pose_strengthoptFLOAT1.000–2姿态引导强度,0=关闭姿态引导,>1=增强姿态影响。Pose guidance strength, 0=disable pose guidance, >1=enhance pose influence.
mid_frameoptINT-1-1–1000legacy 模式中间帧锚点位置,-1=不使用。Mid-frame anchor position in legacy mode, -1=not used.
mid_strengthoptFLOAT0.500–1legacy 模式中间帧锚点强度。Mid-frame anchor strength in legacy mode.
neutral_mix_minoptFLOAT0.000–1legacy 模式掩码=0时的中性灰混合比例。Neutral gray mix ratio when mask=0 in legacy mode.
neutral_mix_maxoptFLOAT1.000–1legacy 模式掩码=1时的中性灰混合比例。Neutral gray mix ratio when mask=1 in legacy mode.
prev_latentoptLATENT前一段输出的完整 latent(concat_latent),接入后忽略 continue_motion,直接用前一段潜变量替换中性灰帧编码后的 latent。Complete latent output from previous chunk, when connected ignores continue_motion and uses previous latent to replace neutral gray frame encoded latent.

Outputs (8)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT
trim_latentINT
trim_imageINT
video_frame_offsetINT
concat_latentLATENT
latent_yaw_anglesFLOAT