Nodes/ComfyUI-BFSNodes/BFS Segment Picker (SAM 3)
ComfyUI Node

BFS Segment Picker (SAM 3)

BFS Segment Picker: segment an image into objects with SAM 3.1, pick them with the mouse, get their masks. Click objects on the canvas to select them; add missed ones by text, points or the brush.

By alisson-anjos·Created 8 months ago·Updated about 17 hours ago· 142
BFS Segment Picker (SAM 3)
  • image
  • sam3_model
  • sam3_clip
  • mask
  • masks
  • marked
  • overlay
  • objects
◄conceptsperson, animal►
◄threshold0.40►
◄max_per_concept8►
◄min_area0.002►
◄mark_color#FF00FF►
◄mark_opacity0.30►
◄selection{}►
CategoryBFS/Mask

Inputs (10)

NameTypeDefaultDescription
imageIMAGE—
sam3_modelMODELSAM 3.1: MODEL of a Load Checkpoint node with sam3.1_multiplex_fp16.safetensors.
sam3_clipCLIPSAM 3.1: CLIP of the same Load Checkpoint node; turns the concepts and Find texts into SAM prompts.
conceptsSTRINGperson, animalWhat the automatic pass looks for, comma separated (one SAM 3 text prompt each), e.g. person, animal, car, chair. Empty = no automatic pass, only what you add.
thresholdFLOAT0.400.05–0.95SAM 3 detection score threshold: lower finds more (and more false hits).
max_per_conceptINT81–32Most objects one concept or text prompt can return.
min_areaFLOAT0.0020–0.5Automatic objects smaller than this share of the image are dropped.
mark_colorSTRING#FF00FFTint of the selection in the marked output (hex).
mark_opacityFLOAT0.300–1How strongly the marked output tints the selection (0.3 = the Colored Mark default).
selectionSTRING{}Set by the canvas: the selected objects and the ones added by text or points.

Outputs (5)

NameTypeDescription
maskMASKUnion of the selected objects, minus the selected remove / eraser ones (one mask).
masksMASKOne mask per selected object (remove ones already cut out), in selection order.
markedIMAGEThe image with the selection tinted (mark_color, mark_opacity).
overlayIMAGEEvery object found, numbered; the selection stronger.
objectsSTRINGJSON: size, selected ids and every object's id, label, score, box (relative x, y, w, h) and area.