ComfyUI Node
SAM Predictor
Predicts segmentation masks using the SAM model based on prompts.
SAM Predictor
- sam_model
- image
- bbox
- MASK
- SEGS
◄threshold0.40►
◄points_methodNone►
◄merge_optionsMerge All►
◄crop_factor3.0►
Categoryimgutils/sam
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| sam_model | SAM_MODEL | — | |
| image | IMAGE | — | |
| threshold | FLOAT | 0.400–1 | Confidence threshold to include masks |
| bbox | BBOX | Optional bounding box [x_min, y_min, x_max, y_max] (pixel space). Connect a MaskToBBoxNode output or similar. | |
| points_method | COMBO | None | Method to generate points for the SAM model. 'None' means no points |
| merge_options | COMBO | Merge All | How to merge masks if multiple are generated. 'Merge All' combines all masks, 'BBox Merge' merges masks within the same bbox, 'No Merge' returns all masks separately. |
| crop_factoropt | FLOAT | 3.01–100 | Factor to crop the image for SEG |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |
| SEGS | SEGS | — |