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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image to cut things out of. | |
| prompt | STRING | subject | What to select, as simple words separated by commas: hair, eyes, bikini. Each word is found on its own and the results are combined. |
| engine | COMBO | grounding_dino + sam | grounding_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_model | COMBO | Used by grounding_dino + sam. Entries marked 'Download' are fetched the first time you run. | |
| sam_model | COMBO | Used by grounding_dino + sam. base is fastest, huge is the most accurate. | |
| sam3_model | COMBO | Used by the sam3 engine. | |
| threshold | FLOAT | 0.300β1 | grounding_dino + sam: detection confidence. Lower finds more (and more wrong things), higher is pickier. |
| sam3_threshold | FLOAT | 0.500β1 | sam3: 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_objects | INT | 00β64 | grounding_dino + sam only. Keep at most this many boxes per word (best first). 0 = all. |
| refine | COMBO | vitmatte | Edge refinement of the raw mask. vitmatte is best for hair, guided_filter is fast, none keeps the raw mask. |
| vitmatte_model | COMBO | Only used when refine is vitmatte. | |
| edge_erode | FLOAT | 10.00β1024 | Trimap: how far the sure-foreground is pulled in from the mask edge (pixels). |
| edge_dilate | FLOAT | 10.00β1024 | Trimap: how far the unknown band reaches out past the mask edge (pixels). |
| black_point | FLOAT | 0.0100β0.999 | Mask values at or below this become 0. |
| white_point | FLOAT | 0.9900.001β1 | Mask values at or above this become 1. |
| max_megapixels | FLOAT | 2.000.25β16 | vitmatte only. Larger images are matted at this size, then scaled back. |
| preview_view | COMBO | cutout | What the wipe on the node shows. Before is the raw mask. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| cutout | IMAGE | β |
| mask | MASK | β |
| raw_mask | MASK | β |