Nodes/comfyui-fvmtools/Person Selector SAM3
ComfyUI Node

Person Selector SAM3

SAM3-powered person selector — uses text grounding for all masks. Produces body, face, head (face+hair), and aux masks per person using SAM3's natural language segmentation. Non-overlapping masks by design. Aux mask presets: upper/lower body, clothing, hands, feet, arms, legs, headless body, or any custom text prompt. Connect LoadSAM3Model → sam3_model. No SAM2 or BiRefNet needed.

By ping1979ping·Created 5 months ago·Updated 2 months ago· 0
Person Selector SAM3
  • sam3_model
  • current_image
  • reference_1
  • outfit_palettes
  • depth_map
  • sam_model
  • reference_2
  • reference_3
  • reference_4
  • reference_5
  • reference_6
  • reference_7
  • reference_8
  • reference_9
  • reference_10
  • person_data
  • face_masks
  • head_masks
  • body_masks
  • aux_masks
  • preview
  • similarities
  • matches
  • matched_count
  • face_count
  • report
auto_thresholdtrue
threshold0.40
guaranteed_refs0
aggregation
det_size
aux_presetnone
aux_custom_prompt
aux_threshold0.30
match_weights50/15/15/20
depth_sort_orderfront_last
aux_yolo_modelNone
aux_yolo_confidence0.30
aux_yolo_label_filter
aux_yolo_sam_refinetrue
aux_yolo_sam_bbox_expansion0
CategoryFVM Tools/Face

Inputs (30)

NameTypeDefaultDescription
sam3_modelSAM3_MODEL_CONFIGSAM3 model from LoadSAM3Model node
current_imageIMAGEImage(s) to process. Supports batch input.
auto_thresholdBOOLEANtrueAuto: optimal 1:1 face-reference assignment. Off: manual threshold.
thresholdFLOAT0.400–1Minimum similarity for matching. Ignored when auto is on.
guaranteed_refsINT00–10Force-assign first N references to best face.
aggregationCOMBOHow to combine similarity scores across reference images.
det_sizeCOMBOFace detection resolution.
aux_presetCOMBOnonePreset aux mask type: - upper_body / lower_body: body halves - clothing: all clothing (no shoes/socks) - hands / feet / arms / legs: body parts - headless_body: body minus head (computed) - custom: uses aux_custom_prompt below
aux_custom_promptSTRINGCustom SAM3 text prompt for aux mask (only used when aux_preset='custom'). Any noun phrase works: 'shoes', 'necklace', 'backpack', etc.
aux_thresholdFLOAT0.300.05–1Confidence threshold for aux detection.
match_weightsSTRING50/15/15/20Face/hair/head/outfit blend: '50/15/15/20'
reference_1optIMAGEReference image(s) for person 1.
outfit_palettesoptIMAGEPalette preview images for outfit matching.
depth_mapoptIMAGEDepth map for render order sorting.
depth_sort_orderoptCOMBOfront_lastRendering order for PersonDetailer.
aux_yolo_modeloptCOMBONoneOptional Ultralytics YOLO model for aux detection. Overrides the SAM3 text-prompt aux pathway when set. Bbox-only models are refined to pixel masks via SAM3/SAM when aux_yolo_sam_refine is on.
aux_yolo_confidenceoptFLOAT0.300.05–1YOLO detection confidence threshold.
aux_yolo_label_filteroptSTRINGComma-separated class-name substrings to keep (empty = all). Example: 'shoe,boot' or 'glasses'.
aux_yolo_sam_refineoptBOOLEANtrueOn (default): refine bbox-only YOLO detections into pixel masks using SAM3 (priority) → SAM2 (fallback). Off: use raw bbox rectangles as aux masks (today's bbox-only behavior).
sam_modeloptSAM_MODELOptional SAM2 model from Impact Pack SAMLoader. Used as fallback when sam3_model isn't suitable for refinement.
aux_yolo_sam_bbox_expansionoptINT00–64Pixels to expand bbox before SAM refinement (helps thin objects).
reference_2optIMAGE
reference_3optIMAGE
reference_4optIMAGE
reference_5optIMAGE
reference_6optIMAGE
reference_7optIMAGE
reference_8optIMAGE
reference_9optIMAGE
reference_10optIMAGE

Outputs (11)

NameTypeDescription
person_dataPERSON_DATA
face_masksMASK
head_masksMASK
body_masksMASK
aux_masksMASK
previewIMAGE
similaritiesSTRING
matchesSTRING
matched_countINT
face_countINT
reportSTRING