SAM3 ExatrConfig
The knobs nobody touches until your SAM 3 video tracks fall apart
- exatr_config
SAM 3's magic trick is that it doesn't just mask an object in one image - in video mode it tracks the thing across frames, keeping a stable ID on every instance of "the guy in the red jacket" as he walks behind a lamppost. The tracking is genuinely good out of the box. But when it isn't, you get flicker: an ID jumps from one person to another, a track that should have died keeps ghosting around the frame, or two tracks merge into one. That's the problem SAM3 ExatrConfig exists to fix.
It's the config node of this pack, and it's the one you'll ignore until something breaks. It emits a single exatr_config blob that you feed into the optional exatr_config input on SAM3 Segmentation - the same pack's segmentation node. Every tracking-related threshold lives here instead of cluttering the segmentation node.
How it works
Under the hood this node is gloriously boring: it collects your settings into a dict and hands them over. The segmentation node then walks that dict and writes each key onto the loaded SAM 3 tracker model - but only if the model actually has that attribute (set_exatr_config checks with hasattr). Two consequences worth knowing. One: these knobs only do anything in video mode with a tracker model. Point this at an image-only run and every value is silently skipped, no error, no effect. Two: because it's attribute-setting on a live model, you can re-run with different values without reloading weights - that's the nice part of this design.
The name "exatr" is the author's shorthand for the SAM 3 tracker, and the parameters are the tracker's internals: detection-to-track association, non-max suppression, and a "hotstart" set of heuristics that decide when to prune or merge tracks in the first frames.
The inputs that matter
Nine knobs, and you will realistically touch four:
- suppress_unmatched_globally - the one the author shouts at you about in the tooltip: "Set to True to actually remove dead tracks!" Keep it True. Set it False and tracks whose keep-alive counter hits zero are only suppressed during the hotstart period, which is how you get ghost objects that never leave.
- init_trk_keep_alive - how many frames a brand-new track survives without matching a detection. The tooltip recommends 5–20 for robust tracking; if objects are getting dropped mid-scene, raise this.
- hotstart_unmatch_thresh - frames a track can go unmatched before it's removed. Higher tolerates occlusions (walking behind the lamppost), but too high and one object splitting into two fake tracks sticks around. Default 3 is a sane middle.
- fill_hole_area - maximum pixel area of holes to fill inside masks, in pixels. 0 disables it. Leave it on at the default 16 unless you specifically want to keep holes in a mask (see-through objects, for instance).
The rest - assoc_iou_thresh, det_nms_thresh, hotstart_dup_thresh, hotstart_delay, decrease_keep_alive_empty - are genuinely useful when you're debugging a specific failure, and genuinely ignorable until you are.
Installing it
It ships inside ComfyUI-SegmentAnything3, so you get it with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/lihaoyun6/ComfyUI-SegmentAnything3.git
python -m pip install -r ComfyUI-SegmentAnything3/requirements.txt
ComfyUI Manager finds it as "ComfyUI-SegmentAnything3" too. The heavy lift is the SAM 3 model itself (~473M params, auto-downloaded on first load) and a transformers >= 5.0.0dev requirement that can clobber other packs - more on that in the Model Loader article.
Common issues
The classic mistakes are the reverse of each other. Cranking init_trk_keep_alive and both hotstart thresholds to 999 to "make tracking robust" disables the cleanup heuristics entirely and you'll end up with tracks that never die and identities that drift - the tracking equivalent of a room of clones. And setting suppress_unmatched_globally to False because you want lenient tracking is how you get ghosts. If tracks are breaking (ID jumping, objects vanishing), raise keep-alive; if they're sticking (ghosts, duplicates), lower it. And if nothing you touch changes anything, check you're actually in video mode - this node is a silent no-op for images.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| fill_hole_area | INT | 160–1000 | Maximum area (in pixels) of holes to fill in masks. 0 disables hole filling. Useful for cleaning up mask interiors. |
| assoc_iou_thresh | FLOAT | 0.100–1 | IOU threshold for detection-to-track association (0.0-1.0). Lower = more lenient matching for maintaining track continuity. |
| det_nms_thresh | FLOAT | 0.100–1 | IOU threshold for Non-Maximum Suppression (0.0-1.0). Lower = more aggressive duplicate removal. 0.0 disables NMS. |
| hotstart_unmatch_thresh | INT | 30–999 | Number of unmatched frames before removing a track (hotstart heuristic). Higher = more tolerant of temporary occlusions. Set to 999 to effectively disable. |
| hotstart_dup_thresh | INT | 30–999 | Number of overlapping frames before removing duplicate tracks. Higher = more tolerant of temporary overlaps. Set to 999 to effectively disable. |
| init_trk_keep_alive | INT | 0-10–50 | Initial keep-alive counter for new tracks. Higher = tracks survive longer without matching detections. Recommended: 5-20 for robust tracking. |
| hotstart_delay | INT | 00–200 | Delay (in frames) before applying hotstart removal heuristics. Useful to let tracks stabilize in early frames. Set to 999 to disable hotstart entirely. |
| decrease_keep_alive_empty | BOOLEAN | true | Whether empty masks (zero area predictions) decrease the keep-alive counter. Disable for more lenient tracking. |
| suppress_unmatched_globally | BOOLEAN | true | Whether to suppress tracks with keep_alive <= 0 globally (True) or only during hotstart period (False). CRITICAL: Set to True to actually remove dead tracks! |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| exatr_config | exatr_config | — |