Nodes/comfyui_scail2_multi_cond/SCAIL-2 Multi Reference Colored Mask
ComfyUI Node

SCAIL-2 Multi Reference Colored Mask

All your SCAIL-2 masks in one node instead of eight copies of the same one

By TTPlanetPig·Created 2 months ago·Updated 2 months ago· 143
SCAIL-2 Multi Reference Colored Mask
  • driving_track_data
  • reference_1_track_data
  • reference_2_track_data
  • reference_3_track_data
  • reference_4_track_data
  • reference_5_track_data
  • reference_6_track_data
  • reference_7_track_data
  • reference_8_track_data
  • pose_video_mask
  • reference_1_mask
  • reference_2_mask
  • reference_3_mask
  • reference_4_mask
  • reference_5_mask
  • reference_6_mask
  • reference_7_mask
  • reference_8_mask
  • summary
reference_count2
object_indices
sort_byleft_to_right
replacement_modetrue

If you've built a multi-reference SCAIL-2 workflow by hand, you know the pain: one Create SCAIL-2 Colored Mask node per reference, each with its own object_indices and sort_by settings that have to match exactly or your identity colors disagree and people swap clothes mid-clip. The SCAIL-2 Multi Reference Colored Mask collapses that whole wall of nodes into one, and it's the piece that makes this pack's scheduled long-video workflow actually tolerable to build.

You connect one driving track as driving_track_data (SAM3 SAM3_TRACK_DATA - so this expects you've already done the SAM3 tracking upstream), set reference_count, and connect your reference_N_track_data inputs. Set reference_count to 3 and the node exposes three track-data inputs and three mask outputs; the Update reference track inputs button hides the unused ones. On run, it calls the native SCAIL-2 colored-mask logic once per connected reference and hands you everything at once: one pose_video_mask plus a reference_N_mask per reference, plus a summary string.

The two settings that matter are inherited straight from the native node, so they behave identically: object_indices is a comma-separated list like 0,2 (empty means all objects), and sort_by is the identity-color ordering - none, left_to_right, or area. These apply to both the driving and reference tracks before masks render, matching official SCAIL-2 behavior, which is the whole point: one consistent ordering instead of hoping you set eight copies the same way. There's also replacement_mode (default on). When it's on, the node expects replacement-style masks wired up for the scheduler; the practical effect is that the masks this node emits are ready to feed SCAIL-2 Scheduled Long Video in its replacement mode.

The recommended wiring, straight from the README:

driving_track_data + reference_N_track_data -> SCAIL-2 Multi Reference Colored Mask
                                            -> pose_video_mask + reference_N_mask

Connect the single shared pose_video_mask to the scheduler and each segment's reference to its matching reference_N_mask. Because the masks are built outside the scheduler, you can preview and tweak them before committing to a multi-minute generation - which is exactly why the author splits this out of the internal-SAM scheduler variant. Person selection stays visible in SAM tracking and this mask helper where you can actually look at it.

Install is the pack standard: ComfyUI Manager search comfyui_scail2_multi_cond, or git clone https://github.com/TTPlanetPig/comfyui_scail2_multi_cond into ComfyUI/custom_nodes and restart. No model downloads, no extra Python deps. The real prerequisite is upstream: your ComfyUI needs the SAM3 nodes (SAM3_VideoTrack) and the native SCAIL-2 colored-mask node, and your workflow has to do SAM3 tracking on the driving video and each reference before this node - that's where the actual tracking cost lives.

Where people get burned: forgetting that sort_by and object_indices are applied to both tracks, so a filter that's right for the driving video can silently empty a single-person reference track. If you're doing multi-person driving and one reference mask comes out blank, check object_indices - empty means "all objects," and an index that exists in the driving video may not exist in a reference image with one person. And because SCAIL-2's replacement mode hard-requires a mask for every reference the plan actually uses, an unconnected reference_N_mask is the most common missing-piece error when the scheduler refuses to run.

CategorySCAIL-2/Scheduled

Inputs (13)

NameTypeDefaultDescription
driving_track_dataSAM3_TRACK_DATA
reference_countINT21–8
object_indicesSTRINGComma-separated tracked object indices to include, matching the native SCAIL-2 colored-mask node. Empty = all.
sort_byCOMBOleft_to_rightNative SCAIL-2 identity color ordering. Applies to both driving and reference tracks.
replacement_modeBOOLEANtrue
reference_1_track_dataoptSAM3_TRACK_DATA
reference_2_track_dataoptSAM3_TRACK_DATA
reference_3_track_dataoptSAM3_TRACK_DATA
reference_4_track_dataoptSAM3_TRACK_DATA
reference_5_track_dataoptSAM3_TRACK_DATA
reference_6_track_dataoptSAM3_TRACK_DATA
reference_7_track_dataoptSAM3_TRACK_DATA
reference_8_track_dataoptSAM3_TRACK_DATA

Outputs (10)

NameTypeDescription
pose_video_maskIMAGE
reference_1_maskIMAGE
reference_2_maskIMAGE
reference_3_maskIMAGE
reference_4_maskIMAGE
reference_5_maskIMAGE
reference_6_maskIMAGE
reference_7_maskIMAGE
reference_8_maskIMAGE
summarySTRING