Nodes/WanVideoLooper/WanVideo Looper
ComfyUI Node

WanVideo Looper

Long Wan 2.2 video without the hand-stitching

By SquirrelRat·Created 10 months ago·Updated 8 months ago· 10
WanVideo Looper
  • model_high
  • model_low
  • clip
  • vae
  • start_image
  • positive_prompts
  • clip_vision
  • model_clip_sequence
  • color_match_ref
  • images
  • last_frame
negative_prompt
seed0
steps6
cfg_motion_noise1.0
cfg_noise1.0
sampler_name
scheduler
model_switch_point0.900
sigma_shift8.00
denoise1.00
width832
height480
frame_merge1
duration_sec5
color_match_methodDisabled
color_match_reference_frameFirst Frame
color_match_strength1.00
enable_dry_runfalse

Wan 2.2 has a 5-second wall. Its native context is 81 frames at 16fps, and one generation falls apart much past that. The community's workaround has always been the same: generate a clip, take its last frame, feed it back in as the start image for the next clip, and repeat - by hand, 40 minutes per 81-frame render on a 4090. WanVideo Looper is that loop, collapsed into one node. You give it a list of prompts, one per segment, and it chains them together with overlap and optional color correction so the result reads as one continuous take instead of a cut-up sequence.

It's built around Wan 2.2's two-expert MoE architecture, so it expects the split this family is famous for: a high-noise model for motion and structure, a low-noise model for detail. You feed both, plus the CLIP and VAE, and the node handles the two-pass sampling internally. The model_switch_point timestep (0.9 for I2V, 0.875 for T2V) decides where the high-noise pass hands off, and sigma_shift (8.0 default) applies to both models.

The inputs that actually matter

The five required model/image inputs are straightforward: model_high, model_low, clip, vae, and start_image (the seed image the first loop animates from). positive_prompts and negative_prompt come from the WanVideo Looper Prompts helper - the looper expects positive_prompts to be a list, one prompt per segment, which is exactly what that node outputs.

After that, the knobs a beginner should touch:

  • duration_sec - length of each segment in seconds (5 is recommended; each segment is duration × 16 + 1 frames, so 5s is exactly 81 frames, Wan's native window).
  • frame_merge - how many overlapping frames stitch each segment into the next. The last frame_merge frames of a segment seed the next one's start image. Start at 1-2.
  • steps, cfg_noise, sampler_name, scheduler - normal sampling settings, applied per segment. cfg_motion_noise is the Wan-specific one: a separate CFG for the first step only, which nudges initial motion; set it to 1.0 to disable.
  • seed - a single seed used for every segment, so the whole sequence is reproducible.

Color matching is where this node earns its keep. color_match_method offers Disabled, Reinhard (GPU), or MKL (GPU), and color_match_reference_frame picks the anchor: Sequential matches each segment to the previous segment's last frame (the drift fixer), while First/Last/Reference matches the whole video to a single frame. color_match_strength blends it in. One caveat: the color math runs on the GPU, but the node still refuses to run it without the color-matcher library installed - it just logs a warning and silently disables the feature.

Outputs are images (the full concatenated batch of frames, ready for a video save node) and last_frame (a single frame, handy for keeping the chain going). There's also an optional clip_vision input to guide the start image, and model_clip_sequence for the Lora Sequencer sibling.

Install

ComfyUI Manager is the easy path: search "WanVideoLooper" and install. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/SquirrelRat/WanVideoLooper
cd WanVideoLooper
pip install color-matcher

Restart ComfyUI, then Add Node > WanVideoLooper. The pack itself ships no model files - the heavy lifting is the Wan 2.2 checkpoint you already need, running on ComfyUI's native Wan support (or Kijai's WanVideoWrapper).

Troubleshooting

  • Color match does nothing. Check the console for the color-matcher warning. The node's requirements.txt lists color-match, but the code imports color_matcher - those are not the same package, so let Manager install what it wants and then run pip install color-matcher anyway.
  • Test with dry run first. enable_dry_run skips sampling and decoding and just logs the setup and per-segment model choices. On a node that renders 20+ minutes per segment, that's the difference between a 5-second debug cycle and waiting an hour to find a wrong wire.
  • It's slow, and speed LoRAs are a trap. Full-quality Wan 2.2 at 1280x720 runs about 25 minutes per clip on a 5090; chain five segments and you've booked your evening. The community consensus is that lightx2v/CausVid speed LoRAs degrade motion and detail - if you must, apply them to the low-noise pass only, and keep cfg_noise at 1.0.
  • The node returns a black frame. positive_prompts isn't a list - the looper validates it and bails with a dummy tensor. Wire the output of the Prompts node, not a raw string.
  • Dimensions snap down to multiples of 16 regardless of what you type, so set them in multiples of 16 and stop worrying.

This is a niche utility that shows up in real "MoE video" ComfyUI environments (next to WanVideoWrapper and WanVideoAutoResize), and it does one thing properly: it makes long Wan video a set-and-wait operation instead of a babysitting job. If you're chaining clips by hand today, you'll feel it on the first run.

CategoryWanVideoLooper

Inputs (27)

NameTypeDefaultDescription
model_highMODELThe BASE high-noise model (can be pre-patched with global LoRAs).
model_lowMODELThe BASE low-noise model (can be pre-patched with global LoRAs).
clipCLIPThe BASE CLIP model (can be pre-patched with global LoRAs).
vaeVAEThe VAE model used for decoding the final image.
start_imageIMAGEThe seed image that the first loop will start from.
positive_prompts*Connect the 'prompt_list' output from the WanVideo Multi-Prompt node.
negative_promptSTRINGA single, global negative prompt applied to all loops.
seedINT00–18446744073709550000The random seed. This will be used for all loops.
stepsINT61–10000The total number of sampling steps for each loop.
cfg_motion_noiseFLOAT1.00–100CFG for the first step ONLY. A value > 1.0 will engage the negative prompt for initial motion guidance. Set to 1.0 to disable motion guidance.
cfg_noiseFLOAT1.00–100Classifier-Free Guidance scale for both high and low noise models. 1.0 disables guidance.
sampler_nameCOMBOThe sampling algorithm (e.g., dpmpp_2m_sde_gpu).
schedulerCOMBOThe noise scheduler (e.g., karras).
model_switch_pointFLOAT0.9000–1Timestep to switch from high-noise to low-noise model. 0.9 (I2V) or 0.875 (T2V) recommended.
sigma_shiftFLOAT8.000–100Applies sigma shift to both models. 8.0 is a good default.
denoiseFLOAT1.000–1Denoise amount. 1.0 means generate a full new image.
widthINT83264–8192The width of the output video.
heightINT48064–8192The height of the output video.
frame_mergeINT10–8Number of frames to overlap/merge between loops for smooth transitions.
duration_secINT51–10Duration of each segment in seconds. 5s is recommended, max 10.
color_match_methodCOMBODisabled'Disabled': No color matching is applied. 'Reinhard (GPU)': Applies Reinhard color transfer. 'MKL (GPU)': Applies MKL color transfer.
color_match_reference_frameCOMBOFirst Frame'First Frame': Matches all frames to the very first frame of the entire sequence. 'Last Frame': Matches all frames to the very last frame of the entire sequence. 'Sequential': Matches each segment to the last frame of the previous segment. 'Reference': Matches all frames to the optional 'color_match_ref' image.
color_match_strengthFLOAT1.000–1Strength of the internal color matching (1.0 = full match).
enable_dry_runBOOLEANfalseIf enabled, skips sampling and decoding to quickly check setup and logs.
clip_visionoptCLIP_VISION(Optional) A CLIP Vision model for guiding the start image.
model_clip_sequenceoptANY(Optional) Connect a WanVideo Lora Sequencer to use different pre-patched models/clips per segment.
color_match_refoptIMAGE(Optional) Static reference image for internal color matching. If omitted, uses last frame of previous segment.

Outputs (2)

NameTypeDescription
imagesIMAGE
last_frameIMAGE