Nodes/ComfyUI-WanVideoWrapper/WanVideo Diffusion Forcing Sampler
ComfyUI Node Runs on cloud

WanVideo Diffusion Forcing Sampler

The sampler built for chaining clips

By kijai·Created about a year ago·Updated 2 months ago· 6,651
WanVideo Diffusion Forcing Sampler
  • model
  • text_embeds
  • image_embeds
  • samples
  • prefix_samples
  • cache_args
  • slg_args
  • experimental_args
  • unianimate_poses
  • samples
addnoise_condition10
fps24.00
steps30
cfg6.00
shift8.00
seed0
force_offloadtrue
schedulerunipc
denoise_strength1.00
rope_functioncomfy

Wan's native context tops out at 81 frames, and it hasn't moved. Every real fix for longer clips is a workaround built on top of that ceiling - chain clips together, feed the tail of one into the start of the next, hope identity holds across the seam. The KB documents the manual version of this ("last-frame-to-first-frame chaining... 40 minutes per 81-frame generation") and the newer single-node versions that automate the chaining loop. This sampler is built for exactly that pattern: it's a Wan sampler with a prefix_samples input specifically for continuing from a previous generation, rather than always starting from pure noise.

How it works

Diffusion Forcing is a sampling approach that blends autoregressive, sequence-aware generation with standard diffusion denoising - instead of treating a whole clip as one blob to fully denoise at once, it can condition on and continue from already-generated frames, which is the mechanism that makes chaining clips together coherently possible rather than just concatenating separately-generated segments and hoping the cut isn't visible. addnoise_condition is the parameter that controls how strongly the sampler re-noises the boundary between a prefix and new generation - get this wrong and you either see a hard seam or the new segment drifts too far from the prefix's content.

The inputs that matter

The required set is Wan's usual sampler surface: model (WANVIDEOMODEL), text_embeds (WANVIDEOTEXTEMBEDS), image_embeds (WANVIDIMAGE_EMBEDS), steps (default 30), cfg (default 6), seed, and scheduler (default unipc, also euler, lcm, and beta variants of each). shift (default 8) is the flow-matching schedule parameter that shows up across this pack's samplers - higher values weight the schedule toward the high-noise end. fps (default 24) and force_offload (default on, frees VRAM after sampling) round out the basics.

The two inputs that make this sampler specifically useful for long-form work: prefix_samples (LATENT, optional) - feed it the tail latents from your previous chunk, and this sampler continues from them instead of starting cold, which is the actual chaining mechanism. And addnoise_condition (default 10, 0–1000) - the boundary re-noising strength mentioned above; start near the default and adjust if you see a visible seam (try lower) or drift away from the prefix (try higher).

Two other optional inputs worth knowing about: cache_args (CACHEARGS) accepts a caching node's output - WanVideo MagCache, for instance - to speed up sampling, and denoise_strength (default 1, 0–1) lets you do a partial denoise pass if you're refining rather than generating fresh.

Output is a single samples (LATENT).

How to install it

Via ComfyUI Manager, search WanVideoWrapper and install, or manually:

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

then restart. No separate download for the sampler itself - it runs on whatever Wan checkpoint you've already loaded.

Common issues & troubleshooting

Visible seam where one chunk ends and the next begins. This is the exact failure mode the KB flags as unsolved across every chaining technique in the ecosystem - identity drift across chunk boundaries doesn't go away just because the tooling got smoother. Try adjusting addnoise_condition first; if the seam persists, it's a limitation of the approach, not necessarily a misconfiguration.

Forgot to wire prefix_samples and wondering why chaining "isn't working." Without it, this sampler behaves like a normal one-shot sampler - the continuation behavior only kicks in when you actually feed it the previous chunk's tail latents.

81 frames per chunk is still the real ceiling. This sampler makes stitching chunks together more coherent, it doesn't raise Wan's native context window. Budget your chunk count and overlap accordingly rather than expecting one call to produce an arbitrarily long clip.

CategoryWanVideoWrapper

Inputs (19)

NameTypeDefaultDescription
modelWANVIDEOMODEL
text_embedsWANVIDEOTEXTEMBEDS
image_embedsWANVIDIMAGE_EMBEDS
addnoise_conditionINT100–1000Improves consistency in long video generation
fpsFLOAT24.001–120
stepsINT30
cfgFLOAT6.000–30
shiftFLOAT8.000–1000
seedINT00–18446744073709550000
force_offloadBOOLEANtrueMoves the model to the offload device after sampling
schedulerCOMBOunipc6 options: unipc, unipc/beta, euler, euler/beta, lcm, lcm/beta
samplesoptLATENTinit Latents to use for video2video process
prefix_samplesoptLATENTprefix latents
denoise_strengthoptFLOAT1.000–1
cache_argsoptCACHEARGS
slg_argsoptSLGARGS
rope_functionoptCOMBOcomfyComfy's RoPE implementation doesn't use complex numbers and can thus be compiled, that should be a lot faster when using torch.compile
experimental_argsoptEXPERIMENTALARGS
unianimate_posesoptUNIANIMATE_POSE

Outputs (1)

NameTypeDescription
samplesLATENT