Wan SCAIL Context Windows
SCAIL-2 context windows that know the 28-channel mask fields exist
- model
- model
The generic context-window node (WanContextWindowsManual_Custom in this same pack) handles plain conditioning, but SCAIL-2's conditioning is a mess of differently-shaped fields: reference latents that must stay global, a pose-video latent, and two multi-channel masks (ref_mask_28ch, driving_mask_28ch) whose time axes live on different dimensions. Slice those naively and you'll break the model. WanSCAILContextWindows is the SCAIL-specific wrapper that knows exactly which field lives where and slices each one correctly per window.
It's the equivalent of what the community's single-node chunkers (SCAIL-2 Infinity, scail-auto-extend) do - hiding the 81-frame windowing math behind one node - but tuned to this pack's conditioning format. You wrap your SCAIL-2 model, feed the wrapped model to the KSampler alongside the conditioning from WanSCAILToVideoMultiRef, and windows just happen.
The inputs that matter
- model - the SCAIL-2 model to wrap (required).
- context_length (default 81) - window length in pixel frames; the tooltip recommends matching your SCAIL
lengthparameter exactly (81). It's converted to latent frames internally. - context_overlap (default 30) - overlap between windows, pixel frames.
- context_schedule -
static_standardis the recommended option here (fixed windows); the uniform and looped schedules exist for other uses. - context_stride / closed_loop - only affect the uniform/looped schedules.
- fuse_method - pyramid (default) is the recommended blend;
relative,flat,overlap-linearalso available. - freenoise - FreeNoise noise shuffling for smoother inter-window blending.
The single output is the wrapped model.
How it's different from the manual node
Three deliberate differences, straight from the README: it automatically handles SCAIL-2's special conditioning fields - ref_mask_28ch keeps its reference part (the first N frames) and slices only the video portion, driving_mask_28ch slices entirely, and pose_video_latent slices on its time dimension. Second, there's no prefix-reference mechanism: SCAIL-2's reference latents and the first N frames of ref_mask_28ch are global by design, so the node keeps them intact across all windows instead of re-prepending them. Third, there's no causal_window_fix - SCAIL-2 does inter-chunk anchoring through the previous_frames mechanism instead, so serial-window continuity is the two-phase sampler's job, not this node's.
Pitfalls
Keep context_length in sync with the length you give the conditioning node - the whole design assumes windows match chunks. If you're feeding previous_frames for anchoring, that happens on the sampler/conditioning side; this node won't add it. And remember the cost reality of SCAIL-2: even with windows, 20 seconds of output is tens of minutes of compute on consumer hardware.
Install
Part of ComfyUI-CustomNodeKit. ComfyUI Manager → search "ComfyUI-CustomNodeKit", or:
cd ComfyUI/custom_nodes
git clone https://github.com/user2318/ComfyUI-CustomNodeKit.git
cd ComfyUI-CustomNodeKit
pip install -r requirements.txt
Restart ComfyUI. Works with your existing SCAIL-2 weights; nothing extra to download.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | 应用上下文窗口的模型(SCAIL 模型)。The model to apply context windows to (SCAIL model). | |
| context_length | INT | 811–16384 | 上下文窗口长度(像素帧)。建议设为 SCAIL 的 length 参数值(如81)。Context window length (pixel frames). Recommended to match SCAIL's length parameter (e.g. 81). |
| context_overlap | INT | 300–16384 | 窗口间重叠帧数(像素帧)。Overlap between windows (pixel frames). |
| context_schedule | COMBO | 窗口生成策略。static_standard=固定窗口(推荐)。Window generation schedule. static_standard=fixed windows (recommended). | |
| context_stride | INT | 11–10 | 窗口步进(仅对 uniform 策略有效)。Window stride (only effective for uniform schedules). |
| closed_loop | BOOLEAN | false | 是否闭环窗口(仅 looped 策略有效)。Whether to close the window loop (only effective for looped schedules). |
| fuse_method | COMBO | pyramid | 窗口融合方法。Window fusion method. |
| freenoise | BOOLEAN | false | FreeNoise 噪声混洗,改善窗口间融合。FreeNoise noise shuffling, improves inter-window blending. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |