Nodes/comfyui_imgutils/SAM Predictor
ComfyUI Node

SAM Predictor

Predicts segmentation masks using the SAM model based on prompts.

By LK-168·Created about a year ago·Updated about a year ago· 1
SAM Predictor
  • sam_model
  • image
  • bbox
  • MASK
  • SEGS
threshold0.40
points_methodNone
merge_optionsMerge All
crop_factor3.0
Categoryimgutils/sam

Inputs (7)

NameTypeDefaultDescription
sam_modelSAM_MODEL
imageIMAGE
thresholdFLOAT0.400–1Confidence threshold to include masks
bboxBBOXOptional bounding box [x_min, y_min, x_max, y_max] (pixel space). Connect a MaskToBBoxNode output or similar.
points_methodCOMBONoneMethod to generate points for the SAM model. 'None' means no points
merge_optionsCOMBOMerge AllHow 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_factoroptFLOAT3.01–100Factor to crop the image for SEG

Outputs (2)

NameTypeDescription
MASKMASK
SEGSSEGS