Nodes/comfyui-fvmtools/Sign Selector SAM3
ComfyUI Node

Sign Selector SAM3

Finds signs, labels, prints and other text-bearing regions with SAM3 text grounding. Nine built-in classes (sign, label, garment_print, poster, screen, book, plate, paper, graffiti), each with its own prompts, threshold and minimum size. All classes share ONE SAM3 vision encode per image, so enabling all nine is cheap. Regions below the size gate are flagged too_small rather than dropped — the Detailer decides whether to skip them or soften them into believable out-of-focus text. When an OCR backend is installed, each region also gets a slop score: SAM3 saying 'there is text here' while OCR reads nothing is the classic pseudo-glyph signature. Connect LoadSAM3Model -> sam3_model. Feed sign_data into Sign Text Proposer.

By ping1979ping·Created 5 months ago·Updated 21 days ago· 0
Sign Selector SAM3
  • sam3_model
  • image
  • restrict_mask
  • sign_data
  • masks
  • crops
  • preview
  • region_count
  • report
class_signtrue
class_labeltrue
class_garment_printtrue
class_postertrue
class_screentrue
class_booktrue
class_platetrue
class_papertrue
class_graffititrue
custom_prompts
threshold_scale1.00
min_height_px24
min_area_ratio0.0005
max_regions12
merge_iou0.50
slop_detectionocr
slop_threshold0.50
only_slopfalse
cluster_similartrue
cluster_distance0.15
sort_orderarea_desc
ocr_backendauto
CategoryFVM Tools/Text

Inputs (25)

NameTypeDefaultDescription
sam3_modelSAM3_MODEL_CONFIGSAM3 model from the LoadSAM3Model node
imageIMAGEImage(s) to scan for text regions. Batch supported.
class_signBOOLEANtrueGround 'sign' — prompts: sign, street sign, shop sign (default threshold 0.3, min height 32px)
class_labelBOOLEANtrueGround 'label' — prompts: bottle label, product label, packaging label (default threshold 0.28, min height 24px)
class_garment_printBOOLEANtrueGround 'garment_print' — prompts: printed text on clothing, t-shirt print, logo on shirt (default threshold 0.3, min height 40px)
class_posterBOOLEANtrueGround 'poster' — prompts: poster, banner, billboard (default threshold 0.28, min height 40px)
class_screenBOOLEANtrueGround 'screen' — prompts: phone screen, computer monitor, display screen (default threshold 0.3, min height 32px)
class_bookBOOLEANtrueGround 'book' — prompts: book cover, magazine cover (default threshold 0.3, min height 32px)
class_plateBOOLEANtrueGround 'plate' — prompts: license plate (default threshold 0.35, min height 20px)
class_paperBOOLEANtrueGround 'paper' — prompts: document, menu, price tag, receipt (default threshold 0.28, min height 24px)
class_graffitiBOOLEANtrueGround 'graffiti' — prompts: graffiti, handwritten text (default threshold 0.3, min height 40px)
custom_promptsSTRINGExtra SAM3 prompts beyond the built-in classes. Format: 'neon sign:0.25, bottle label:0.3' — the threshold is optional.
threshold_scaleFLOAT1.000.3–2Multiplies every class's default threshold. Below 1.0 finds more (and more false positives), above 1.0 is stricter.
min_height_pxINT244–512Global floor for text height in the ORIGINAL image (min-area-rect short side). Per-class minimums still apply on top of this.
min_area_ratioFLOAT0.00050–0.5Region must cover at least this fraction of the image area.
max_regionsINT121–100Cost brake — keeps only the top N regions after sorting.
merge_iouFLOAT0.500–1Two classes hitting the same object are merged above this IoU. The higher-scoring detection keeps its class.
slop_detectionCOMBOocrHow to judge whether existing lettering is believable. - ocr: OCR confidence + dictionary + bigram plausibility - vlm: leave the judgement to the Proposer's vision model - ocr+vlm: both, combined in the Proposer Falls back gracefully when no OCR backend is installed.
slop_thresholdFLOAT0.500–1Regions scoring at or above this are marked as needing a re-render.
only_slopBOOLEANfalseON: drop regions whose text already looks fine. OFF: keep everything and let the Detailer decide.
cluster_similarBOOLEANtrueGroup near-identical regions (a shelf of identical bottles) so they share one text decision.
cluster_distanceFLOAT0.150.01–0.9Lower = stricter grouping. Combines perceptual hash and colour signature.
sort_orderCOMBOarea_descOrder of regions — also the order in which the Detailer renders them.
restrict_maskoptMASKOnly search inside this mask. Regions must overlap it by 30%+.
ocr_backendoptCOMBOautoOCR engine for slop detection. 'auto' picks the first installed one. Missing models degrade to VLM-only judgement, never an error.

Outputs (6)

NameTypeDescription
sign_dataSIGN_DATA
masksMASK
cropsIMAGE
previewIMAGE
region_countINT
reportSTRING