SCAIL-Pose2 Replacement Denoise Mask
The node that actually locks your background during a swap
- condition
- pose_video_mask
- mask
- summary
Here's the thing people miss about SCAIL-2 character replacement: the SCAIL-2 conditioning guides who the subject becomes, but it does not freeze the background. Left to itself, the model happily regenerates the whole frame, including the parts you wanted to keep identical. The background lock is a separate mechanism - a denoise mask at the sampler - and SCAILPose2ReplacementDenoiseMask is the node that builds it.
It produces a standard ComfyUI MASK for WanVideoEncode.mask: subject pixels get 1.0 (full denoise, replace) and background pixels get 0.0 (preserve, copy from the original samples). Wire that into the encode step, get the samples into the sampler, and suddenly your swap only regenerates the person. That's the whole game.
What it does
The node takes your validated condition and the colored pose_video_mask, then builds the subject region from the mask, applying the grow/blur logic you set. Two modes, decided by the condition itself:
- Replacement mode - subject
1.0, background0.0, with a bounded lower-contact refinement applied internally so feet and shoes get covered without the "floating socket" look. It's a small thing, but it's the kind of detail that separates a believable swap from a headless rendering. - Non-replacement modes - it emits an all-
1.0passthrough mask with SCAIL-Pose2 metadata that tells compatible downstream integrations to disable their background-lock samples path. In other words, the node is mode-aware, not just a mask factory.
Inputs
condition- the validatedSCAIL2_CONDITIONfromSCAILPose2SCAIL2Condition. This is what tells the node which mode you're in.pose_video_mask- the same raw colored mask you fed the Condition node. Consistency here is non-negotiable; mixing masks is how you get weird half-locked frames.mask_preset-custom,tight,default,loose, orsoft(non-custom presets override the next two).grow_pixels/blur_pixels- subject-region expansion and edge softness.
Outputs are mask (a real ComfyUI MASK) and a summary string carrying coverage, lower-contact, and margin diagnostics.
Where people get burned
The most common failure is source leakage: the original subject still shows up in the output even though everything looks wired. The README's checklist is worth quoting from memory - the original driving_video has to be encoded with this mask, and those samples have to actually reach the sampler. Subject regions should initialize from random noise; background/preserve regions use samples. If the body leaks, that contract is broken somewhere.
Second, don't panic at the preview. Early sampler previews show a noisy, incomplete background even when everything is correct, because the preserved background latent is still heavily noised during early denoise steps. Judge background preservation from later previews or the final frame, not the first one.
And third: mask coverage. If the mask doesn't cover the full driving subject - partial SAM3 tracking, hair, limbs - the uncovered bits stay on the preserve side and inherit the original person. Fix SAM3 selection and coverage first, before you touch prompts or SCAIL-2 strength. The mask is the contract, and this node is where it gets enforced.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| condition | SCAIL2_CONDITION | — | |
| pose_video_mask | IMAGE | — | |
| mask_preset | COMBO | custom | 5 options: custom, tight, default, loose, soft |
| grow_pixels | INT | 80–512 | — |
| blur_pixels | INT | 00–512 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| summary | STRING | — |