LC Create Mask 🖼️✏️:
LCSplineMask lets you draw a closed shape directly on an image preview to create a mask for later nodes in your workflow. You can place and move points to define a precise area, or draw freehand with the pencil mode. The shape can have straight or smooth edges, and you can soften its boundary, reverse the selected area, or reduce its strength. The node also offers an optional hold behavior that pauses downstream processing when the mask needs your attention, giving you a chance to draw on the displayed picture before continuing.
LC Create Mask 🖼️✏️ Input Parameters:
image
The IMAGE you want to draw on. The node uses its width and height to turn your drawn shape into a mask at the same resolution, displays the first image in the batch as its preview when preview saving succeeds, and passes the input image through unchanged as control_image during normal execution. No default, minimum, or maximum is specified; you must connect an image.
block
Controls whether the node pauses downstream execution. The default is False (never), which always passes the image and mask through. Set it to True (if_empty_mask) to stop downstream nodes when there is no usable drawn mask or when a new picture arrives, so you can draw on the picture shown and run the workflow again. This behavior depends on ComfyUI’s ExecutionBlocker support; if that support is unavailable, blocking is disabled.
pencil
Selects how you draw on the node preview. The default is False (points): click to add points, drag them to reshape the outline, and Shift-click to remove them. Set it to True (pencil) to draw freehand. This is a drawing-mode setting; the resulting stored points determine the mask.
smooth
Controls the shape of the boundary between drawn points. The default is False (straight), which joins points with straight edges. Set it to True (smooth) for a curved outline through the points. Smoothing changes the rendered shape, so check the preview when you need an exact boundary.
invert
Reverses the rendered mask. The default is False, with the drawn area white and the outside black. Set it to True to make the outside white and the drawn area black. Inversion happens before opacity is applied. With fewer than three points, inversion can produce a white mask, although the node still treats the shape as empty for block purposes.
feather
Softens the mask boundary using a Gaussian blur. Its default is 0.0 pixels, with a minimum of 0.0, a maximum of 200.0, and a step of 0.5. At zero, the mask keeps its unblurred edge; higher values spread the transition between black and white over more pixels. The value is a blur radius in pixels, so the same setting may look different on images of different sizes.
opacity
Sets the strength of the mask after rendering and optional inversion. Its default is 1.0, with a minimum of 0.0, a maximum of 1.0, and a step of 0.01. At 1.0, white areas retain full mask strength; lower values reduce all mask values proportionally, and 0.0 makes the output mask entirely black. If block is enabled, an all-black result is treated as empty.
overlay_opacity
Sets how strongly the mask overlay appears on the node’s preview. Its default is 0.45, with a minimum of 0.0, a maximum of 1.0, and a step of 0.01. Increase it when you need to see the selected area more clearly, or decrease it to see more of the image underneath. This setting affects the display only; it does not change control_mask.
points
Stores the drawn outline as a JSON list of normalized coordinates. The default is []; no numeric range is specified for the string itself. The node accepts point pairs such as [[0.2, 0.2], [0.8, 0.2], [0.5, 0.8]] or objects containing x and y. Coordinates are interpreted relative to the image, with 0 and 1 representing opposite edges; values outside that interval are clamped to it. Invalid entries are skipped, and at least three valid points are needed to draw a filled shape. This is an internal value ordinarily maintained through drawing on the preview.
LC Create Mask 🖼️✏️ Output Parameters:
control_image
An IMAGE containing the input image unchanged during normal execution. This lets downstream nodes use the same picture on which you drew the mask. If block is enabled and the node holds execution, this socket receives an ExecutionBlocker instead of an image.
control_mask
A MASK at the input image’s width and height, with values from 0 to 1. White or higher-value areas indicate more mask strength, black indicates none, and intermediate values can result from softening or reduced opacity. The same rendered mask is repeated for every image in the input batch; it is not separately drawn for each batch item. If block is enabled and the node holds execution, this socket receives an ExecutionBlocker instead of a mask.
LC Create Mask 🖼️✏️ Usage Tips:
- Use
pointsmode withsmoothoff for shapes with crisp corners. Turnsmoothon for curved outlines, or usepencilwhen a freehand boundary is quicker to draw. - Start with
featherat0to position the boundary accurately, then raise it gradually if you need a softer transition. Useopacityto reduce overall mask strength without changing the shape. - Use
invertwhen you want to affect everything outside the drawn shape. Check the resulting mask before continuing, particularly if you have not yet drawn at least three points. - Enable
blockwhile working interactively if downstream processing should wait for you to draw on an empty mask or a newly arriving picture. Leave it atneverwhen you want the workflow to continue regardless. - For an image batch, remember that one mask is applied to every image at the same pixel coordinates. Use images with compatible composition when the selected area needs to line up across the batch.
LC Create Mask 🖼️✏️ Common Errors and Solutions:
[LC Create Mask] ComfyUI is too old for ExecutionBlocker - block is disabled.
- Explanation: The node could not import the ComfyUI feature it needs to stop downstream execution. Mask generation may still work, but
blockwill not pause the workflow. - Solution: Update ComfyUI to a version that provides
comfy_execution.graph.ExecutionBlocker, or leaveblockset toneverand manage workflow runs manually.
[LC Create Mask] New picture: stopped so you can draw on it, then Run.
- Explanation: This is an informational console message, not an error. With
blockenabled, the node detected a new picture and stopped downstream processing because the existing mask was drawn on the previous picture. - Solution: Review or redraw the mask on the newly displayed picture, then run the workflow again. Set
blocktoneverif you do not want new pictures to pause downstream processing.
Downstream nodes do not run when the mask is empty
- Explanation: With
blockset toif_empty_mask, fewer than three valid points or an all-black final mask causes both outputs to become blockers. Anopacityvalue of0.0also makes the final mask all black. - Solution: Draw a shape with at least three valid points, set
opacityabove0.0, and run again. If an empty mask is intentional, setblocktonever.
The output mask is black or does not show the expected shape
- Explanation: Fewer than three valid points produce a black rendered mask before inversion, and
opacityat0.0makes any final mask black. A missing area may also be the result ofinvertselecting the opposite side of your outline. - Solution: Check that the outline has at least three points, raise
opacity, and verify theinvertsetting. If editingpointsdirectly, ensure it contains a valid JSON list of coordinate pairs orx/yobjects.
The drawn outline looks distorted or clipped
- Explanation: Point coordinates outside the normalized
0to1interval are clamped to the image edges. Smoothing can also change the boundary between the points you placed. - Solution: Move points back inside the preview or correct their stored coordinates. Turn
smoothoff if you need the outline to follow straight segments precisely.
The preview overlay changes, but the output mask does not
- Explanation:
overlay_opacitycontrols only how strongly the mask is displayed over the node preview; it does not change the mask sent downstream. - Solution: Adjust
opacityto change output mask strength,featherto change edge softness, orinvertto switch which side is selected.
