WanVideo Context Options
Sliding windows for longer-than-81-frame clips
- reference_latent
- context_options
Wan's native context is 81 frames - roughly 5 seconds. Ask for much more and the clip loops or falls apart. WanVideoContextOptions is one of the ways around that: it splits a long generation into overlapping context windows, samples each, and blends them into a single longer video that neither the model nor your VRAM would otherwise allow. You wire its WANVIDCONTEXT output into the sampler's context_options input.
It's worth being honest about what this does and doesn't buy you. It moves you from "5 seconds without engineering" to something considerably longer, but it's still stitching 81-frame windows under the hood - identity drift across window boundaries is the failure mode you'll fight, same as every other long-video approach on Wan. This is an ergonomics win, not a change to the underlying 81-frame ceiling.
How it works
Instead of denoising the whole clip at once, the node runs a sliding window across the timeline. Each window covers context_frames frames; consecutive windows overlap by context_overlap frames, and the overlaps get blended so the seams aren't hard cuts. freenoise keeps the noise consistent across windows to reduce flicker. The result is one continuous latent longer than a single 81-frame pass - at the cost of more compute (you're sampling overlapping regions more than once).
The inputs that matter
context_schedule-uniform_standardis the general-purpose choice.uniform_loopedis what you want if you're deliberately making a seamless loop.static_standardis a simpler fixed scheme.context_frames- the window size, default 81 (Wan's native length). Keep it at the model's comfortable context; this is the size of each chunk, not the total.context_overlap- how many frames windows share (default 16). More overlap = smoother blending but more redundant compute. Too little and you'll see boundaries.context_stride- how far the window advances each step.freenoise- leave it on (default). It's the thing keeping your noise coherent across windows so the clip doesn't shimmer.fuse_method(optional) -linearorpyramidblending of the overlaps.
Output: a WANVIDCONTEXT for the sampler.
How to install it
Comes with the pack. Via ComfyUI Manager: search WanVideo Wrapper, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt
then restart.
Common issues & troubleshooting
Visible seams or a "pulse" every few seconds. Your overlap is too small or the blend is too abrupt. Raise context_overlap, try the pyramid fuse method, and make sure freenoise is on. Some boundary artifacting is inherent to windowed generation, though - it's the tradeoff for length.
The subject's face/identity drifts over the clip. This is the fundamental limitation, not a setting you can fully dial out. Across window boundaries the model re-anchors and identity wobbles. Shorter total length, more overlap, and a strong start image all help; nothing eliminates it.
It got a lot slower. Overlapping windows re-sample shared frames, so total compute is higher than a single pass of the same nominal length. That's expected. If you only need 81 frames, don't use context options at all.
Trying to combine it with the MultiTalk long-video node. Don't. WanVideoImageToVideoMultiTalk has its own windowing method and explicitly isn't meant to be combined with context windows. Pick one long-video path per graph.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| context_schedule | COMBO | 3 options: uniform_standard, uniform_looped, static_standard | |
| context_frames | INT | 812–1000 | Number of pixel frames in the context, NOTE: the latent space has 4 frames in 1 |
| context_stride | INT | 44–100 | Context stride as pixel frames, NOTE: the latent space has 4 frames in 1 |
| context_overlap | INT | 164–100 | Context overlap as pixel frames, NOTE: the latent space has 4 frames in 1 |
| freenoise | BOOLEAN | true | Shuffle the noise |
| verbose | BOOLEAN | false | Print debug output |
| fuse_methodopt | COMBO | linear | Window weight function: linear=ramps at edges only, pyramid=triangular weights peaking in middle |
| reference_latentopt | LATENT | Image to be used as init for I2V models for windows where first frame is not the actual first frame. Mostly useful with MAGREF model |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| context_options | WANVIDCONTEXT | — |