ComfyUI Node
Mask by Touch π
Click a thing on the picture, or paint over it, and get its mask. No name to type and no MaskEditor. Moving over the picture lights up what a click would take. A painted stroke takes the thing under it, or exactly the paint. What is lit is what the mask will be. When nothing is picked 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). 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 picked area cut out on a see-through background, and the names of what you picked as text.
Mask by Touch π
- image
- model
- clip
- mask
- cut_out
- names
βtouchesβΊ
βgrow0βΊ
βsoften0.0βΊ
βsmooth0βΊ
βfill_holestrueβΊ
βif_nothingstop the runβΊ
βfree_vramfalseβΊ
βinvertfalseβΊ
βaskβΊ
βfine_edgesoffβΊ
Categoryπ AusBoss/Mask
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The picture to pick from. | |
| 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. | |
| touches | STRING | What you picked on the node's picture. The node writes this itself when you click or paint; Clear on the node empties it. | |
| grow | INT | 0-128β256 | Grow the picked area by this many pixels. Below zero shrinks it. 0 keeps the exact outline. |
| soften | FLOAT | 0.00β100 | Soften the mask's edge by this many pixels. 0 keeps a hard edge. |
| smooth | INT | 00β64 | Round off a ragged outline by this many pixels. 0 leaves the outline as found. |
| fill_holes | BOOLEAN | true | Closes pinholes inside the picked area. Larger openings stay open, like a mug's handle. |
| if_nothing | COMBO | stop the run | When nothing is picked. 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. |
| free_vramopt | BOOLEAN | false | Takes SAM 3 out of the graphics card's memory when the workflow has run this node. Turn it on in a workflow that loads a big model after this node. |
| invertopt | BOOLEAN | false | Turns the mask round: white everywhere except what you picked. With nothing picked the mask stays empty. |
| askopt | STRING | Used by the node's own picture for a single run. Leave it empty: it is never saved with the workflow. | |
| fine_edgesopt | COMBO | off | Hair and fur, strand by strand: where what you picked ends at the outline of the picture's main subject, that outline is taken from ComfyUI's background-removal model. The cut-out also loses the colour of the old background. Off keeps the edge as found. The ? page says where to get the model file. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| mask | MASK | White where the picked area is. One mask per picture. |
| cut_out | IMAGE | The picture with everything but the picked area see-through (RGBA). |
| names | STRING | The names of the things you picked, in the order you picked them, like: jacket, hat. Empty when nothing you picked has a name. |