SCAIL-2 Smart Long Video Context
Your SCAIL-2 clip doesn't have to be 81 frames — this node does the 4n+1 chunk math for you
- model
- model
- chosen_segment_len
- chosen_segment_overlap
- latent_context_length
- latent_context_overlap
- decision
SCAIL-2's native context window is 81 frames. Everything longer than that is chunked - split into overlapping windows, sampled separately, fused back together. The stock ComfyUI workflow makes you do that arithmetic by hand: divide your clip into 81-frame segments, keep the frame count on the 4n+1 pattern the VAE demands, and hand-tune the overlap so windows stitch without a visible seam. It's tedious, easy to get wrong, and it's the exact pain this node exists to remove. You feed it a frame count, it picks your segment length and overlap, and patches your model so the sampler just works.
It's a model patch, not a replacement for the official SCAIL-2 graph. You still need WanSCAILToVideo, the masks, replacement_mode and the rest - this node sits between the diffusion model loader and the sampler and rewraps the MODEL with ComfyUI's built-in comfy.context_windows.IndexListContextHandler, the same machinery behind the core Long Video Context nodes.
How it works
The node does three things. First it clamps your total_frames to the 4n+1 pattern (n - ((n-1) % 4)), because the latent VAE works in units of four pixel frames plus one anchor. Then a strategy table picks a segment_len / segment_overlap pair. For the default auto_smooth_rtx6000 strategy, ~237 frames - that's a 15-second clip at 16fps, the default total_frames - resolves to 205 frames with 73 of overlap, sized to minimize the visible seam where windows meet. It converts those to latent lengths ((frames-1)//4 + 1), so 205 becomes a latent context length of 52, and hands it to the context handler.
The part that matters for SCAIL-2 specifically: cond_retain_index_list defaults to "0", which keeps condition index 0 - your reference frame - present in every window. Without that, each chunk re-anchors from scratch and identity drifts across boundaries, the failure mode the community hits on long clips. If your whole clip fits in a single window, bypass_when_single_pass (on by default) returns your model untouched rather than patching it for nothing.
The inputs that actually matter
total_frames- the one you'll actually feed. Use the same effective frame count you send toWanSCAILToVideo length(e.g. VHS frame_count through aa - ((a-1) % 4)expression). It steps by 4.strategy-auto_smooth_rtx6000(default),auto_safe(lighter, for OOM),auto_quality_rtx6000,force_official_81_5(replicates the official 81/5 chunking), ormanual.cond_retain_index_list- keep"0". Comma-separated if you ever need more.- Leave
causal_window_fixtrue andfreenoisefalse;context_schedule/context_stride/fuse_methodare for when you're tuning beyond defaults.
Outputs are the patched model (wire it into your sampler) plus chosen_segment_len, latent_context_length, and a decision string telling you what it actually did - useful when something looks off and you want to know if you got a single pass or real chunking.
Install
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/1GirlUniversity/ComfyUI-SCAIL2-LongVideoContext.git
Restart ComfyUI. That's it - there are no Python dependencies beyond a ComfyUI build recent enough to have comfy.context_windows (essentially any current build). The pack ships no weights; you still need the SCAIL-2 model itself, so grab Comfy-Org's scaled/MXFP8 weights rather than the 65.6GB raw repo.
Gotchas
The rtx6000 in those strategy names is a hint about tuning targets, not a hard requirement - the defaults assume a big-VRAM card, so if you OOM or crawl, switch to auto_safe. If the node appears to do nothing, check the decision output: a short clip may legitimately single-pass. And if you're on an old ComfyUI, update core first, because the import will fail without context_windows.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| total_frames | INT | 2371–99999 | — |
| strategy | COMBO | auto_smooth_rtx6000 | 5 options: auto_smooth_rtx6000, auto_safe, auto_quality_rtx6000, force_official_81_5, manual |
| manual_segment_len | INT | 2051–99999 | — |
| manual_segment_overlap | INT | 730–99999 | — |
| context_schedule | COMBO | standard_static | 4 options: standard_static, standard_uniform, looped_uniform, batched |
| context_stride | INT | 11–32 | — |
| fuse_method | COMBO | pyramid | 4 options: pyramid, relative, flat, overlap-linear |
| freenoise | BOOLEAN | false | — |
| causal_window_fix | BOOLEAN | true | — |
| bypass_when_single_pass | BOOLEAN | true | — |
| cond_retain_index_list | STRING | 0 | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| chosen_segment_len | INT | — |
| chosen_segment_overlap | INT | — |
| latent_context_length | INT | — |
| latent_context_overlap | INT | — |
| decision | STRING | — |