Nodes/ComfyUI Smart Helper Nodes/Smart Painter Long Video
ComfyUI Node

Smart Painter Long Video

Chain long WAN clips without the drift

By slvslvslv·Created 2 years ago·Updated 7 days ago· 3
Smart Painter Long Video
  • positive
  • negative
  • vae
  • previous_video
  • initial_reference_image
  • clip_vision_output
  • clip_vision_reference_image
  • start_image
  • end_image
  • positive
  • negative
  • latent
width832
height480
length81
batch_size1
motion_frames5
motion_amplitude1.15
cv_reference_strength1.00

Naively chaining WAN I2V clips - render a segment, feed its last frame into the next - usually ends in drift: the character freezes, teleports to a new pose, or the camera lurches between segments. Smart Painter Long Video is the conditioning node that fixes that continuity problem, and it's the long-form sibling of SmartPainterFLF2V, built for clips up to 1000 frames instead of the usual 81.

It's the same execute logic as PainterVideo's PainterLongVideo (WanVideoWrapper pack) with one addition, and the mechanism is worth understanding because that's where the continuity magic lives. You feed it the tail of the previous segment via previous_video, optionally a start_image/end_image pair, and it builds the concat conditioning for the next segment: a gray canvas, the keyframes pasted in, VAE-encoded, and injected into your positive and negative conditioning as concat_latent_image plus concat_mask. The part that keeps long-form coherent is the motion reference - the last ~73 frames of the previous clip get encoded and passed along as reference_motion, and the previous clip's final frame becomes a reference_latent so the next segment starts where the last one ended. motion_frames (default 5) controls how many tail frames feed that motion reference, and motion_amplitude (default 1.15) nudges the model to keep moving instead of settling.

That's the trick most naive chains miss: the model sees where the motion was going, not just where the last frame froze. It's the difference between a character who keeps walking and one who resets to a fresh pose every segment.

The new bit versus the original PainterLongVideo is clip_vision_reference_image plus cv_reference_strength. It's an off-screen reference - a subject's identity, a jacket color, an object that never appears in the keyframes - merged with the existing clip_vision_output tokens along the token axis and fed through the model's img_emb cross-attention. That's the only non-keyframe image-guidance channel stock WAN 2.2 checkpoints expose without VACE or a ref_conv layer, so it's the one that works on plain WAN 2.2 I2V models. Just remember it's semantic, not pixel-faithful: great for "keep the jacket this color", weak for "reproduce this exact logo". Leave it unconnected and the node behaves exactly like the original.

Two gotchas worth knowing before you wire it up. First, initial_reference_image looks like the same feature but isn't: it's a VAE-encoded reference_latents entry that only has effect on checkpoints shipping a ref_conv layer (Fun Control, Animate, SCAIL, HuMo, VACE-merged). On stock WAN 2.2 it's silently ignored, so use the CLIP Vision slot instead for anything that should work everywhere. Second, the node raises an error if you connect none of previous_video, start_image, or end_image - it needs at least one keyframe source to build the canvas.

Outputs are positive, negative, and latent, which go straight into your WAN sampler. Feed the finished clip back into previous_video for the next segment and you've got an iteration loop that stays on-rails.

Install via ComfyUI Manager (search "Smart Helper Nodes"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/slvslvslv/ComfyUI-SmartHelperNodes

Then restart ComfyUI. No extra Python dependencies - the pack's requirements.txt is empty - and no model downloads beyond the WAN checkpoints you already have.

CategorySmartHelperNodes/Wan

Inputs (16)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
vaeVAE
widthINT83216–8192
heightINT48016–8192
lengthINT811–1000
batch_sizeINT11–4096
motion_framesINT51–20
motion_amplitudeFLOAT1.151–2
previous_videooptIMAGE
initial_reference_imageoptIMAGEOptional VAE-encoded reference appended to the conditioning's reference_latents list (zero latent on the negative side). NOTE: Only effective on WAN checkpoints that ship with a ref_conv layer (Fun Control, Animate, SCAIL, HuMo, VACE-merged). Silently ignored by stock WAN 2.2 FLF2V / I2V / T2V and most custom merges. For a reference-image channel that works on any base WAN 2.2 checkpoint, use clip_vision_reference_image below instead. Leave unconnected to keep the original pipeline unchanged.
clip_vision_outputoptCLIP_VISION_OUTPUT
clip_vision_reference_imageoptCLIP_VISION_OUTPUTOptional extra CLIP Vision slot for an off-screen reference image (subject identity, clothing, object that isn't in start/end frames). Merged with clip_vision_output by concatenating their token sequences along the token axis. Feeds the model's img_emb cross-attention pathway — the only non-keyframe image-guidance channel available on stock WAN 2.2 base checkpoints (no VACE / no ref_conv required). Provides semantic / style / identity guidance. NOT pixel-faithful — good for 'keep the jacket this color', weak for 'reproduce this exact logo'. Leave unconnected to keep the original pipeline unchanged.
cv_reference_strengthoptFLOAT1.000–3Only active when clip_vision_reference_image is connected. Scales the reference image's CLIP token magnitudes before they are merged with clip_vision_output. Higher values make the reference dominate the cross-attention, lower values let the existing CLIP guidance win. 0.0 = reference disabled (same as leaving clip_vision_reference_image unconnected). 1.0 = equal weight with clip_vision_output tokens. 2.0-3.0 = reference boosted (useful if the reference subject is being ignored by the model). Defaults to 1.0.
start_imageoptIMAGE
end_imageoptIMAGE

Outputs (3)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
latentLATENT