ComfyUI Node
Mask by Name π
Type what to find in a picture, like "the dog" or "the jacket", and get its mask. Nothing to paint. The node shows what it found, tinted on the picture. When it finds nothing it stops the run with a plain message, so nothing after it runs on an empty mask (or it can pass an empty mask on: a setting). Find runs only this node, to check the mask first. It uses ComfyUI's own SAM 3: wire model and clip from a Load Checkpoint that loads the SAM 3 file. It also returns the thing cut out on a see-through background.
Mask by Name π
- image
- model
- clip
- mask
- cut_out
- found
βnamethe personβΊ
βseveralall of themβΊ
βgrow0βΊ
βsoften0.0βΊ
βif_nothingstop the runβΊ
βpreviewtrueβΊ
βthreshold0.70βΊ
βfill_holesfalseβΊ
βfree_vramfalseβΊ
Categoryπ AusBoss/Mask
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The picture to search. | |
| model | MODEL | SAM 3: MODEL from a Load Checkpoint that loads the SAM 3 file. | |
| clip | CLIP | SAM 3's text reader: CLIP from the same Load Checkpoint. | |
| name | STRING | the person | What to find, in a few plain words: "the dog", "the red jacket". Several things: put a comma between them. |
| several | COMBO | all of them | When more than one thing matches: mask all of them, or only the biggest. |
| grow | INT | 00β512 | Pixels to grow the mask past the thing's edge. 0 keeps the exact outline. |
| soften | FLOAT | 0.00β100 | Soften the mask's edge by this many pixels. 0 keeps a hard edge. |
| if_nothing | COMBO | stop the run | When nothing matches the name. Stop the run: the workflow stops here with a message, and nothing after this node runs. Empty mask: the run goes on with a mask of nothing. |
| previewopt | BOOLEAN | true | Show what was found on this node. Off skips writing the preview file to ComfyUI's temp folder. |
| thresholdopt | FLOAT | 0.700.05β0.95 | How sure SAM 3 must be that something matches the name. Lower it when a small thing is missed. Raise it when it picks up something that is not the thing. |
| fill_holesopt | BOOLEAN | false | Fill gaps that lie fully inside the mask, like the spots SAM 3 leaves in hair or cloth. On gives a solid shape. |
| free_vramopt | BOOLEAN | false | Takes SAM 3 out of the graphics card's memory right after the search. Turn it on in a workflow that loads a big model after this node; off keeps the next search a little faster. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| mask | MASK | White where the thing is. One mask per picture. |
| cut_out | IMAGE | The picture with everything but the thing see-through (RGBA). |
| found | INT | How many things matched the name in the first picture. |