LC Create Mask πΌοΈβοΈ
Draw the mask on the node instead of in a second app
- image
- control_image
- control_mask
The honest workflow for one-off masking in ComfyUI has been: paint it in an external editor, save, load, hope the dimensions line up. Or install a pack whose mask editor is its own little universe. Or spend forty minutes learning a detector you didn't need for a single image.
This is the small version. The image is on the node, you click points around the thing you want, and the mask comes out. Three points minimum. That's the whole interaction.
How it works
Points are stored as normalized coordinates, so the mask survives a resolution change, and rasterized into a polygon with PIL. With smooth on, the points get run through a closed Catmull-Rom spline first, so you get curves through your clicks instead of hard corners. The render happens at 2Γ resolution for images up to 2048px and is then downscaled with Lanczos, which is where the clean edges come from - it's the same trick you'd do by hand in a paint program, just automatic.
feather is a real Gaussian blur radius in pixels, applied in the render. So the softness you see is the softness that ships, which is not always true of mask nodes.
Driving it
Click to add a point. Drag a point to move it. Shift+click removes one. There's no limit on point count, and there are Undo and Clear buttons on the node. Flip the pencil toggle and you're drawing freehand instead - handy for irregular shapes where clicking a hundred points is not a plan.
The widgets behind it:
- feather (0β200 in 0.5 steps) - edge softness. For inpainting, a little is almost always better than none; a hard mask edge shows up as a visible seam in the output.
- invert - flips the mask so outside becomes white. Fastest way to do "everything but this".
- opacity (0β1) - scales the mask values. 1.0 is solid; lower gives you a partially-applied mask, which the sampler will read as partial strength.
- overlay_opacity (0.45) - display only. It changes how strongly the mask is drawn over the preview on the node and nothing about the output. Don't go looking for an effect.
- block - set it to
if_empty_maskand everything downstream stops until you've actually drawn something, or until the mask is all black. Same trick as Impact Pack's Preview Bridge: draw, queue again, and the run continues. No more accidentally sampling a full-denoise inpaint on an empty mask over your original.
Two outputs. mask is the obvious one. image is the input passed straight through, which exists so the node can act as a passthrough in a chain and so the node has something to render the preview from. Queue once to get the preview - the node draws from its last execution, so an unexecuted node shows nothing.
What you'd use it for
Anything masked. Inpainting a region you can point at but can't describe to a detector. Building a region for a detail pass. A mask for LC Image Blend Advance when you want to hide part of a layer rather than all of it. A quick mask to feed a color grade through LC Auto Adjust, which measures its histogram through that mask - mask the face, and the auto levels get computed against skin instead of the whole frame.
The mental model worth keeping: this node produces a mask, and a mask is one input to inpainting, not the whole job. Generous overlap with the region you're changing, some feather, and a denoise that matches what you're actually trying to do - those rules apply unchanged no matter how the mask got drawn.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_MaskMaker_nodes
# restart ComfyUI
Manager β search LC MaskMaker. This node is torch-and-PIL only, no model, no download, nothing to install beyond the pack itself - which makes it the cheapest thing in the pack to try.
Gotchas
- Nothing happens when you click. You need the node's own canvas, not the graph background, and you need to have queued once so there's an image to draw on.
- Two clicks produce no mask. A polygon needs three points. It's the author's explicit rule and the render returns an empty mask below that.
- The mask has visible corners on a curved subject. Turn smooth on. That's what the spline is for.
- The mask looks softer in the output than on the node. Check feather, not overlay_opacity - the second one is display only.
- Point handles refuse to sit exactly where you want. Coordinates are normalized to the image; zooming into the node helps more than trying to click precisely at 100%.
if_empty_maskdoesn't block anything. On an old ComfyUI the blocking quietly disables itself. Update ComfyUI and it works as advertised.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image to draw the mask on. | |
| block | BOOLEAN | false | if_empty_mask: when nothing is drawn (no shape, or an all-black mask), everything downstream of this node is stopped so you can draw, then queue again. never: always passes the image and mask through. |
| pencil | BOOLEAN | false | points: click to add, drag to move, shift+click removes. pencil: draw freehand. |
| smooth | BOOLEAN | false | smooth curves through the points instead of straight edges. |
| invert | BOOLEAN | false | Flip the mask (outside becomes white). |
| feather | FLOAT | 0.00β200 | Edge softness in pixels (gaussian blur radius). |
| opacity | FLOAT | 1.000β1 | Mask strength. Scales the mask values (1.0 = solid). |
| overlay_opacity | FLOAT | 0.450β1 | How strongly the mask shows over the preview on the node. Display only. |
| points | STRING | [] | Internal: normalized point list. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| control_image | IMAGE | β |
| control_mask | MASK | β |