Nodes/ComfyUI_LC_MaskMaker_nodes/LC Segment Anything 🎯
ComfyUI Node

LC Segment Anything 🎯

Select things by describing them. GroundingDINO + SAM (Apache-2.0, downloaded on demand) or SAM 3, then optional guided filter / VITMatte refine, with a before/after wipe on the node.

By lonecatone23Β·Created 6 days agoΒ·Updated about 10 hours agoΒ· 0
LC Segment Anything 🎯
  • image
  • cutout
  • mask
  • raw_mask
β—„promptsubjectβ–Ί
β—„enginegrounding_dino + samβ–Ί
β—„dino_modelβ–Ύβ–Ί
β—„sam_modelβ–Ύβ–Ί
β—„sam3_modelβ–Ύβ–Ί
β—„threshold0.30β–Ί
β—„sam3_threshold0.50β–Ί
β—„max_objects0β–Ί
β—„refinevitmatteβ–Ί
β—„vitmatte_modelβ–Ύβ–Ί
β—„edge_erode10.0β–Ί
β—„edge_dilate10.0β–Ί
β—„black_point0.010β–Ί
β—„white_point0.990β–Ί
β—„max_megapixels2.00β–Ί
β—„preview_viewcutoutβ–Ί
CategoryLC MaskMaker/mask

Inputs (17)

NameTypeDefaultDescription
imageIMAGEImage to cut things out of.
promptSTRINGsubjectWhat to select, as simple words separated by commas: hair, eyes, bikini. Each word is found on its own and the results are combined.
engineCOMBOgrounding_dino + samgrounding_dino + sam: GroundingDINO finds boxes, SAM makes the masks. Apache-2.0 models, downloaded when first used. sam3: SAM 3 does both in one step (SAM License). Pick the SAM 3.1 download, or use your own sam3.safetensors in models/sam3.
dino_modelCOMBOUsed by grounding_dino + sam. Entries marked 'Download' are fetched the first time you run.
sam_modelCOMBOUsed by grounding_dino + sam. base is fastest, huge is the most accurate.
sam3_modelCOMBOUsed by the sam3 engine.
thresholdFLOAT0.300–1grounding_dino + sam: detection confidence. Lower finds more (and more wrong things), higher is pickier.
sam3_thresholdFLOAT0.500–1sam3: detection confidence. SAM 3 scores run higher, so 0.5 is a good start. Around 0.3 it starts inventing matches for words that are not in the image.
max_objectsINT00–64grounding_dino + sam only. Keep at most this many boxes per word (best first). 0 = all.
refineCOMBOvitmatteEdge refinement of the raw mask. vitmatte is best for hair, guided_filter is fast, none keeps the raw mask.
vitmatte_modelCOMBOOnly used when refine is vitmatte.
edge_erodeFLOAT10.00–1024Trimap: how far the sure-foreground is pulled in from the mask edge (pixels).
edge_dilateFLOAT10.00–1024Trimap: how far the unknown band reaches out past the mask edge (pixels).
black_pointFLOAT0.0100–0.999Mask values at or below this become 0.
white_pointFLOAT0.9900.001–1Mask values at or above this become 1.
max_megapixelsFLOAT2.000.25–16vitmatte only. Larger images are matted at this size, then scaled back.
preview_viewCOMBOcutoutWhat the wipe on the node shows. Before is the raw mask.

Outputs (3)

NameTypeDescription
cutoutIMAGEβ€”
maskMASKβ€”
raw_maskMASKβ€”