IAMCCS SCAIL Identity Tracker
Lock a person down across a video with SAM3
- sam3_model
- reference_image
- pose_video
- reference_conditioning
- driving_conditioning
- ref_track_data
- driving_track_data
- reference_image
- pose_video
Identity tracking for the SCAIL-2 pipeline
SCAIL-2 (Z.ai's video model) is one of the Wan-adjacent models the local video community built on after Alibaba stopped shipping open weights. The hard problem in SCAIL-2 avatar work is keeping which person is which across a video - in a scene with multiple characters, the model needs to know that the person on the left of the reference is the same as the person who just entered the driving video. That's this node's job. It's a segment-anything (SAM3) based identity tracker: it segments identities on both the reference image and the driving video, tracks them, and hands the downstream SCAIL-2 pipeline track data so conditioning can be applied per identity.
What goes in
sam3_model- a SAM3 model (the tooltip says it can come fromCheckpointLoaderSimple). This is the heavy dependency; no SAM3, no tracking.reference_image- your processed reference (post background-removal and padding), at model resolution.pose_video- the driving frames at the resolution you feed the sampler.markers- a JSON canvas of drawn boxes, managed by the node's own canvas widget. This is the manual fallback when auto-detection gets confused.
The auto side is driven by auto_detect (on by default): if you connect reference_conditioning and/or driving_conditioning (plain CLIPTextEncodes like "person"), SAM3's text-prompted detection runs on that side alongside any drawn boxes. detection_threshold (0.3) filters weak detections, and detect_interval (every N frames) keeps detection from running on every single frame. refine_iterations (2) is how many SAM decoder refinement passes each seed gets - more is slower but cleaner masks.
What comes out
Two SAM3_TRACK_DATA outputs - ref_track_data and driving_track_data - which are the contract the rest of the SCAIL-2 graph consumes to keep identity-to-conditioning aligned. Plus passthroughs of reference_image and pose_video, so you can chain the tracker without re-plumbing your inputs. Note it's flagged as an output node.
The honest read
This is a specialist node for a specific pipeline - SCAIL-2 identity-consistent video - and it leans on a real dependency stack: a SAM3 model, background removal upstream, and the pack's SCAIL-2 backend stages. The tooltip on reference_conditioning has a nice honest warning: "Text-only loses explicit colour ordering" - meaning if you rely purely on text detection you lose the deterministic left/right colour ordering that drawn boxes give you. In practice, drawn boxes for the first frame plus auto-detect for latecomers is the setup that works.
Install via the pack: ComfyUI Manager (search "IAMCCS") or git clone https://github.com/IAMCCS/IAMCCS-nodes.git into custom_nodes, restart. If the node doesn't appear in the menu, the SCAIL-2 parts of the pack load conditionally - check that the optional SCAIL-2 dependency (the tracker base it subclasses) is present, since the node is registered only when its backend imports cleanly. The refine_iterations knob is your quality/time dial: 2 is a fine default, and you'll feel each extra iteration on a long video.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| sam3_model | MODEL | SAM3 model (e.g. from CheckpointLoaderSimple). | |
| reference_image | IMAGE | Processed reference (post background-removal + padding), at model resolution. | |
| pose_video | IMAGE | Driving/pose video frames, at the resolution fed to the sampler. | |
| refine_iterations | INT | 20–5 | SAM decoder refinement passes per seed. |
| auto_detect | BOOLEAN | true | Master switch for text detection. When on, reference_conditioning / driving_conditioning (if connected) drive SAM3 text detection on that side, alongside any drawn boxes. |
| detection_threshold | FLOAT | 0.300–1 | Score threshold for auto-detected latecomers. |
| detect_interval | INT | 11–64 | Run auto-detection every N frames. |
| markers | STRING | {} | Canvas markers (JSON). Managed by the node's canvas widget. |
| reference_conditioningopt | CONDITIONING | Optional CLIPTextEncode (e.g. 'person') to auto-detect identities on the reference image instead of / alongside drawn boxes. Needs auto_detect on. Text-only loses explicit colour ordering. | |
| driving_conditioningopt | CONDITIONING | Optional CLIPTextEncode to auto-detect / append people on the driving video. Needs auto_detect on. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| ref_track_data | SAM3_TRACK_DATA | — |
| driving_track_data | SAM3_TRACK_DATA | — |
| reference_image | IMAGE | — |
| pose_video | IMAGE | — |