ComfyUI Node
TBG SAM3 Segmentation
A ComfyUI node in TBG/SAM3 with 13 inputs and 7 outputs.
TBG SAM3 Segmentation
- sam3_model
- image
- sam3_selectors_pipe
- mask_prompt
- masks
- visualization
- boxes
- scores
- segs
- combined_mask
- combined_segs
◄confidence_threshold0.40►
◄pipeline_modeall►
◄detect_alltrue►
◄max_detections50►
◄instancesfalse►
◄crop_factor1.5►
◄min_size100►
◄fill_holesfalse►
◄text_prompt►
CategoryTBG/SAM3
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| sam3_model | SAM3_MODEL | SAM3 model loaded from LoadSAM3Model node | |
| image | IMAGE | Input image to perform segmentation on | |
| confidence_threshold | FLOAT | 0.400–1 | Minimum confidence score to keep detections. Lower threshold (0.2) works better with SAM3's presence scoring |
| pipeline_mode | COMBO | all | Which prompts from pipeline to use. |
| detect_all | BOOLEAN | true | When enabled, detects all objects. When disabled, uses max_detections value. |
| max_detections | INT | 501–100 | Maximum detections when detect_all is disabled. |
| instances | BOOLEAN | false | When ON: keep only detections whose boxes overlap a positive box or contain a positive point. When OFF: return all SAM3 detections including instances. |
| crop_factor | FLOAT | 1.51–4 | Crop factor used when building combined SEGS (Impact Pack style). 1.0 = tight bbox. |
| min_size | INT | 1001–500 | Minimum segment size in pixels as a square side. 1=1x1, 200=200x200; smaller masks are discarded. |
| fill_holes | BOOLEAN | false | When enabled, fills holes inside each mask (solid segments). |
| text_promptopt | STRING | Text to guide segmentation (optional). | |
| sam3_selectors_pipeopt | SAM3_PROMPT_PIPELINE | Unified pipeline containing boxes/points). | |
| mask_promptopt | MASK | Optional mask to refine the segmentation. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| masks | MASK | — |
| visualization | IMAGE | — |
| boxes | STRING | — |
| scores | STRING | — |
| segs | SEGS | — |
| combined_mask | MASK | — |
| combined_segs | SEGS | — |