Nodes/ComfyUI_VideoChunkTools/Wan Chunked I2V Sampler ♾️
ComfyUI Node

Wan Chunked I2V Sampler ♾️

Wan Chunked I2V Sampler ♾️ — long Wan videos from one node, no hand-chaining

By gregtee2·Created 6 months ago·Updated 6 months ago· 4
Wan Chunked I2V Sampler ♾️
  • model
  • vae
  • start_image
  • model_b
  • text_embeds
  • text_embed_sequence
  • clip_embeds
  • feta_args
  • context_options
  • end_image
  • video
  • total_frames
  • chunks_generated
total_frames161
chunk_frames81
width832
height480
keep_proportioncrop
crop_positioncenter
steps8
cfg2.00
shift11.00
seed0
force_offloadtrue
schedulereuler
enable_vae_tilingfalse
split_step4
cfg_b1.00
noise_aug_strength0.00
start_latent_strength1.00
end_latent_strength1.00
riflex_freq_index0
tile_x272
tile_y272
tile_stride_x144
tile_stride_y128
end_blend_chunks0

Wan's native context is 81 frames - about five seconds at 16fps - and anything longer used to mean hand-chaining samplers: generate a chunk, decode it, grab the last frame, feed it back in as the reference, repeat, stitch. Tedious, error-prone, and the frame-count arithmetic (the 4n+1 thing) would bite you at the end. This node collapses that whole loop into a single box. You set total_frames and chunk_frames, connect your model, VAE, and start image, and it internally runs encode → sample → decode → extract reference → repeat until the timeline is done, then concatenates everything into one continuous video.

It's the flagship of the VideoChunkTools pack, and it fits a real 2026 pattern: the "chunking moved into a single node" trend (SCAIL-2 Infinity, Bernini Infinity, scail-auto-extend all did the same thing for their models). The honest caveat that applies to all of them applies here too - the loop is hidden, the 81-frame window isn't, and identity drift across chunk boundaries is still the failure mode. What you get is ergonomics, not magic. But it's a big ergonomics win.

How it works

Under the hood it calls Kijai's WanVideoWrapper nodes (WanVideoEncode, WanVideoSampler, WanVideoDecoder) from ComfyUI's global node registry - lazily, so the pack still loads even if you haven't installed the wrapper. The join strategy is the "concat approach": because each chunk is conditioned on the previous chunk's last frame as its reference, the new chunk's first frame matches it almost exactly, so the sampler just drops that first frame and concatenates. No blending, zero artifacts from a dissolve you don't need.

The inputs that matter

  • total_frames / chunk_frames - your target length and the window size. Chunk frames auto-normalize to Wan's 4n+1 rule (81 → 81, 82 → 81), so you can't trip the trap. Output may overshoot to fill the last chunk, then gets trimmed.
  • start_image - the reference for chunk 1.
  • steps (default 8), cfg (default 2), shift (default 11), scheduler (default euler) - the standard Wan sampling knobs, in line with the distilled/LoRA-friendly settings the community runs.
  • seed - one seed for every chunk. Variation comes from the changing reference images, not from reseeding. Set it once and keep it if you're iterating.
  • force_offload (default on) - offloads the model to CPU between sampling passes. Keep it on unless you're swimming in VRAM; Wan is a 14B model and offloading is how mid-range cards survive multi-chunk runs.

The interesting optional inputs: model_b + split_step + cfg_b give two-pass sampling (first model handles steps 0→split, second finishes - the classic way to put a speed LoRA on the low-noise pass only). end_image enables FLF (first-last-frame): one image pulls the final frame toward a target, or a batch of images distributes as keyframes across the last chunks. end_blend_chunks (try 9–17) crossfades the FLF boundary instead of hard-cutting. And text_embed_sequence from ChainTextEmbeds swaps in per-chunk prompts, which overrides the uniform text_embeds.

Outputs

video (the joined IMAGE), total_frames (INT), and chunks_generated (INT) - the last is handy for knowing whether your prompt chain actually covered every chunk.

Installing

This node needs ComfyUI-WanVideoWrapper:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper.git
cd ComfyUI/custom_nodes
git clone https://github.com/gregtee2/ComfyUI_VideoChunkTools.git

Restart ComfyUI. The pack itself has no pip requirements; the wrapper is the heavy one (and brings the model files - Wan 2.2 14B needs serious VRAM, 12GB+ with GGUF or offloading, or use the 5B on 8GB). If you haven't installed the wrapper, the sampler will fail with a clear "requires ComfyUI-WanVideoWrapper" error while the rest of the pack keeps working.

Troubleshooting: if your first run OOMs, drop resolution to 832×480, enable force_offload, and consider enable_vae_tiling (it costs you some decode quality). If seams appear between chunks, that's the drift problem, not the concat - per-chunk prompting and a well-chosen end_blend_chunks help more than any blend curve will.

CategoryVideoChunkTools

Inputs (34)

NameTypeDefaultDescription
modelWANVIDEOMODELWan I2V model (2.1 or 2.2). Runs all steps in single-pass. In two-pass mode, runs the first steps (0 → split_step).
vaeWANVAEWan VAE model
start_imageIMAGEReference image for the first chunk
total_framesINT1615–9999Total frames to generate. Output may be slightly more (rounded to fill the last chunk), then trimmed.
chunk_framesINT815–241Frames per chunk. Auto-normalized to Wan's 4n+1 rule (5, 9, 13, … 77, 81, 85 …).
widthINT832128–2048Output video width in pixels.
heightINT480128–2048Output video height in pixels.
keep_proportionCOMBOcropHow to resize the input images to match the target width/height.
crop_positionCOMBOcenterWhere to crop or pad the image.
stepsINT81–100Total denoising steps.
cfgFLOAT2.000–30CFG guidance scale. In two-pass mode this applies to the first pass only.
shiftFLOAT11.000–1000Scheduler shift parameter.
seedINT00–18446744073709550000Random seed. Same seed used for every chunk — variation comes from different reference images.
force_offloadBOOLEANtrueOffload model to CPU after each sampling pass. Highly recommended.
schedulerCOMBOeulerNoise scheduler algorithm.
enable_vae_tilingBOOLEANfalseEnable VAE tiling for lower-VRAM decode. May introduce tile seam artifacts.
model_boptWANVIDEOMODELOptional second model for two-pass sampling. Connect this to split denoising across two models (e.g. different LoRA weights). Leave disconnected for single-pass.
split_stepoptINT41–99Two-pass only: model runs steps 0 → split_step, model_b runs split_step → end. Ignored in single-pass.
cfg_boptFLOAT1.000–30Two-pass only: CFG for the second pass (model_b). Ignored in single-pass.
text_embedsoptWANVIDEOTEXTEMBEDSText conditioning from WanVideoTextEncode. Applied to ALL chunks uniformly.
text_embed_sequenceoptTEXT_EMBED_SEQUENCEPer-chunk text conditioning from ChainTextEmbeds. Chunk 1 gets embed_1, chunk 2 gets embed_2, etc. Last embed repeats for extra chunks. Overrides text_embeds when connected.
clip_embedsoptWANVIDIMAGE_CLIPEMBEDSOptional CLIP vision embeddings from WanVideoClipVisionEncode.
feta_argsoptFETAARGSFETA arguments. Recommended: weight=2, start=0, end=1.
context_optionsoptWANVIDCONTEXTContext windowing options. In two-pass mode only applied to the first pass (model).
noise_aug_strengthoptFLOAT0.000–1Noise augmentation for I2V encoding. 0 = no augmentation.
start_latent_strengthoptFLOAT1.000–1Strength of the start image in latent space.
end_latent_strengthoptFLOAT1.000–1FLF only: Strength of the end image conditioning in latent space. Controls how strongly the last chunk is pulled toward the end image. Only effective when end_image is connected.
riflex_freq_indexoptINT00–1000RIFLEX frequency index. 0 = disabled.
tile_xoptINT27240–4096VAE decode tile width (only when tiling enabled).
tile_yoptINT27240–4096VAE decode tile height (only when tiling enabled).
tile_stride_xoptINT14432–2040VAE decode tile stride X (only when tiling enabled).
tile_stride_yoptINT12832–2040VAE decode tile stride Y (only when tiling enabled).
end_imageoptIMAGEOptional target image for the last frame — enables FLF (First-Last-Frame) mode. If a batch of images is provided, they will be distributed as target keyframes across the chunks (e.g., 3 images for a 3-chunk video).
end_blend_chunksoptINT00–40FLF only: Number of FRAMES to crossfade at the FLF boundary. The last chunk (with end_image) overlaps with the previous chunk by this many frames, and a smooth alpha ramp blends between them. 0 = hard cut (no crossfade). Try 9–17 for smooth transitions (~0.5–1 sec at 16fps). The last chunk is automatically enlarged to the next valid 4n+1 size to accommodate the overlap.

Outputs (3)

NameTypeDescription
videoIMAGE
total_framesINT
chunks_generatedINT