> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# SCAIL2ColoredMask - ComfyUI Built-in Node Documentation

> Complete documentation for the SCAIL2ColoredMask node in ComfyUI. Learn its inputs, outputs, parameters and usage.

This node renders SAM3 tracking data into colored masks that are consumed by the WanSCAILToVideo node. It processes tracking data from a driving pose video and optionally a reference image, assigning consistent colors to each tracked person across both outputs.

## Inputs

| Parameter            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Data Type                 | Required | Range                                         |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- | -------- | --------------------------------------------- |
| `driving_track_data` | SAM3 track of the driving pose video. Will be rendered into the pose\_video\_mask output.                                                                                                                                                                                                                                                                                                                                                                    | SAM3\_TRACK\_DATA         | Yes      | -                                             |
| `ref_track_data`     | SAM3 track of the reference image(s) (one identity per object, colored in batch order), or a plain MASK of the reference subject (rendered as a single identity).                                                                                                                                                                                                                                                                                            | SAM3\_TRACK\_DATA or MASK | No       | -                                             |
| `object_indices`     | Comma-separated list of person indices to include (e.g. '0,2,3'). Applied to both reference and pose video masks. Empty = all. (default: "")                                                                                                                                                                                                                                                                                                                 | STRING                    | Yes      | -                                             |
| `sort_by`            | Order in which palette colors are assigned to the tracked objects (applied to both reference and pose video so each identity keeps the same color). Objects that appear in earlier frames always come first; within a frame, left\_to\_right = leftmost object (by centroid at first appearance) gets the first color, area = biggest object (by mask area at first appearance) gets the first color; none = keep SAM3's order. (default: "left\_to\_right") | COMBO                     | Yes      | `"none"`<br />`"left_to_right"`<br />`"area"` |
| `replacement_mode`   | False = Animation Mode (pose\_video\_mask has black background, reference\_image\_mask has white background). True = Replacement Mode (pose\_video\_mask has white background, reference\_image\_mask has black background). (default: False)                                                                                                                                                                                                                | BOOLEAN                   | Yes      | False<br />True                               |

## Outputs

| Output Name            | Description                                                                                                                                                                                                                     | Data Type |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `pose_video_mask`      | Colored mask rendered from the driving pose video tracking data. Background color follows replacement\_mode setting.                                                                                                            | IMAGE     |
| `reference_image_mask` | Colored mask rendered from the reference image tracking data. Background is black in Replacement Mode, white in Animation Mode. If no reference data is provided, returns a solid fill matching the reference background color. | IMAGE     |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/SCAIL2ColoredMask/en.md)

***

**Source fingerprint (SHA-256):** `ce0669ad0ed3c76cc18ef0ee7b620f5aa6eaa1e5b96c189941c0a5b744c3351f`
