Wan SCAIL-2 Phase Sampler
The SCAIL-2 chunk loop, without the sampler chaining
- model1
- positive
- negative
- vae
- latent
- model2
- previous_frames
- latent
SCAIL-2 is Z.ai's motion-transfer model on a Wan 2.1 base, and it's expensive in the way that matters: several minutes per 81-frame clip on a mid-range card, and past 81 frames you have to chain chunks by hand. The stock workflow's chain is sampler → decode → re-anchor → sampler again, with the arithmetic of when to step and how many frames to carry. This node is the pack's attempt to make that whole dance a single node: a complete two-phase sampler that takes pixel frames as its anchor input and internally does the VAE encoding, the anchor write-back, and the noise-mask management.
Think of it as a self-contained KSampler you can point at the same conditioning and latent your chunk node produces. When it's just a single chunk, it behaves like a normal sampler. When you connect the previous chunk's decoded tail frames, it switches into the two-phase SCAIL-2 continuation mode that the model was actually trained with - 81-frame chunks with a 76-frame step and a 5-frame anchor.
How the two phases work
The mechanism, from the source: it takes the tail previous_frame_count frames of previous_frames, upscales them to your target resolution, VAE-encodes them, and writes them into the front of the latent as an anchor. It builds a noise mask where the anchor region is set to phase1_noise and everything else is 1 (free). Phase 1 samples from your noise down to split_step. Then it force-overwrites the anchor region with the original encoded frames - this is what pins the chunk to the previous video - updates the mask to phase2_noise, and samples phase 2 from empty noise to the end. phase1_noise around 0.5 means the anchor is partially free during composition; phase2_noise around 0.1 means it's mostly frozen at the end.
The inputs that matter
- model1 - the Phase 1 model; model2 (optional) - a different model for Phase 2 (e.g. a distilled speed variant), falling back to model1 if not provided.
- positive / negative / vae / latent - your conditioning and the latent from the SCAIL conditioning node (WanSCAILToVideoMultiRef).
- steps / cfg / sampler_name / scheduler / denoise / seed / width / height - standard sampler knobs. Width and height step by 32 (SCAIL is coarser than WanAnimate's 16).
- split_step (default 2) - where the phases split. 0 = single phase. Two-phase only activates when
split_step > 0, it's less thansteps, andprevious_framesis connected. - phase1_noise / phase2_noise - the anchor freeze values described above (0 = frozen, 1 = free).
- previous_frame_count (default 5) - how many tail frames of
previous_framesbecome the anchor. SCAIL-2 was trained at 5. - previous_frames - the previous chunk's decoded frames. Without it, the node quietly degrades to single-phase.
The one output is latent - the sampled result, ready for VAE decode or to become the next chunk's previous_frames.
Reality check
This doesn't make SCAIL-2 cheap - nothing does. What it removes is the workflow cost: no manual sampler chaining, no off-by-one frame arithmetic, and the anchor behavior matches the model's training setup. Set previous_frame_count to 5, keep length at 81, and let the loop advance. And remember the community's standing advice if faces wander across chunks: drop the speed LoRAs and raise steps and CFG before you blame the sampler.
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. It drives your existing SCAIL-2 model - no extra weights from the pack.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| model1 | MODEL | Phase 1 模型。Phase 1 model. | |
| positive | CONDITIONING | 正向条件。Positive conditioning. | |
| negative | CONDITIONING | 负向条件。Negative conditioning. | |
| vae | VAE | VAE,用于锚定帧编解码。VAE, for anchor frame encode/decode. | |
| latent | LATENT | 输入的 latent(来自 conditioning 节点)。Input latent (from conditioning node). | |
| width | INT | 51232–8192 | — |
| height | INT | 89632–8192 | — |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 61–10000 | — |
| cfg | FLOAT | 1.00–100 | — |
| sampler_name | COMBO | euler | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | normal | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| denoise | FLOAT | 1.000–1 | — |
| split_step | INT | 20–10000 | 分割步数。0=单阶段;>0且<steps且接入了previous_frames时启用两阶段。Split step. 0=single-phase; >0 and <steps with previous_frames enables two-phase. |
| phase1_noise | FLOAT | 0.5000–1 | Phase 1 锚定帧 noise_mask 值。0=冻结,1=自由。Phase 1 anchor noise_mask value. 0=frozen, 1=free. |
| phase2_noise | FLOAT | 0.1000–1 | Phase 2 锚定帧 noise_mask 值。0=冻结,1=自由。Phase 2 anchor noise_mask value. 0=frozen, 1=free. |
| previous_frame_count | INT | 51–4096 | 从 previous_frames 尾部取多少像素帧作为锚定(单位:像素帧,会经 VAE 编码为 latent)。How many tail pixel frames of previous_frames to use as anchor (pixel frames; VAE-encoded to latent). |
| phase_schedule | BOOLEAN | false | 逐步插值回写:每步一个阶段(忽略 split_step),锚定区 noise_mask 从 phase1_noise 插值到 phase2_noise,每阶段结束强制回写锚定区。Per-step interpolated anchor write-back: one stage per step (ignores split_step); anchor noise_mask interpolates from phase1_noise to phase2_noise; anchor region force written back after every stage. |
| schedule_exponent | FLOAT | 1.000.1–10 | mask 插值曲线形状:s=t^exponent。<1=先陡后缓(前几步高自由度,随后强锚定);1.0=线性;>1=先缓后陡。Mask interpolation curve shape: s=t^exponent. <1=steep first then flat; 1.0=linear; >1=flat first then steep. |
| model2opt | MODEL | Phase 2 使用的模型,不提供时使用 model1。Model used for Phase 2; falls back to model1 if not provided. | |
| previous_framesopt | IMAGE | 上一段解码后的尾部像素帧。不接时退化为单阶段。Tail pixel frames of previous decoded segment. If not connected, falls back to single-phase. | |
| color_alignopt | BOOLEAN | true | 接续一致性色彩/亮度校正:采样结束后,用采样输出锚定区与接续帧 latent 的 per-channel mean/std 偏差,对整段做色彩+亮度校正。仅在有接续帧时生效。Continuity color/brightness correction: aligns whole sampled latent to the anchor-frame latent by per-channel mean/std. Only active when anchor frames exist. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |