Nodes/LLS-node/LLS Simple Mask Create
ComfyUI Node

LLS Simple Mask Create

Draw a rectangle, circle, or ellipse mask from numbers — no painting required

By Gin3601·Created 3 months ago·Updated 3 months ago· 0
LLS Simple Mask Create
  • input_mask
  • mask_image
  • mask
  • area_info
image_width1024
image_height1024
shape_typerectangle
coordinate_modepercent
center_x0.50
center_y0.50
width0.30
height0.30
radius0.15
feather0.0
blur0.0
invert_maskfalse
combine_modereplace

Sometimes you don't need to paint a mask - you need a clean geometric region, positioned precisely, at a size that's easy to reason about. LLS Simple Mask Create is the "give me a rectangle over the center 30%" node. You feed it the output image size and a few shape parameters, and it returns a mask, a visualizable black-and-white mask_image, and a bundle of diagnostics.

The default is genuinely useful: a rectangle centered on the canvas, covering 30% of the width and height - the classic "mask the middle of the image for a focused repair" starting point. shape_type gives you rectangle, square, circle, or ellipse. coordinate_mode flips between pixel and percent, so you can position in absolute pixels or relative fractions (percent mode with center_x/center_y at 0.5 is the sane default).

The knobs that matter

  • image_width / image_height - the mask's canvas size (should match your generation target).
  • center_x / center_y - where the shape sits.
  • width / height - shape size (percent or pixels, depending on coordinate_mode); radius for circles.
  • feather / blur - soften edges so the masked region blends instead of showing a hard boundary.
  • invert_mask - flip it (protect the center, edit everything else).
  • combine_mode - if you connect an optional input_mask, this decides whether the geometric shape replaces, unions, subtracts, or intersects the existing mask.

The area_info output is the sleeper: a structured payload with the bbox, area in pixels, area ratio, and which geometry was used. For a beginner it's mostly "oh good, my mask actually covers 30% of the image"; for automation it's the ground truth about what you're about to regenerate.

Outputs

mask (white = will be redrawn, black = untouched), mask_image (the mask rendered as a viewable image - wire it into a Preview Image so you can actually see what you made), and area_info.

Where it fits

The pack's recommended repair flow wires it straight into the chain: mask → LLS Simple Repair Prepare, or mask → LLS Simple Mask Draw to hand-tune the geometric shape afterward. It's also a fine standalone for "delete this region" masking. Preview the mask_image output before you run a sampler - a mask you can't see is a mask you can't trust.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/Gin3601/LLS-node
# restart ComfyUI

Or ComfyUI Manager → search "LLS-node". No dependencies beyond torch.

Gotchas

The shape can extend past the canvas - the area_info includes clipped_by_image so you can tell when it has - and shapes clipped at the edge behave as you'd expect (they just get cut off, not error). Defaults assume percent mode, so if you switch to pixel mode, remember your center_x/y and sizes change meaning. And a circle's radius default (0.15 in percent mode) is intentionally small - bump it before you wonder why your "circle" covers barely anything.

CategoryLLS/Mask

Inputs (14)

NameTypeDefaultDescription
image_widthINT10241–8192
image_heightINT10241–8192
shape_typeCOMBOrectangle4 options: rectangle, square, circle, ellipse
coordinate_modeCOMBOpercent2 options: pixel, percent
center_xFLOAT0.50
center_yFLOAT0.50
widthFLOAT0.300–8192
heightFLOAT0.300–8192
radiusFLOAT0.150–8192
featherFLOAT0.00–128
blurFLOAT0.00–128
invert_maskBOOLEANfalse
combine_modeCOMBOreplace4 options: replace, union, subtract, intersect
input_maskoptMASK

Outputs (3)

NameTypeDescription
mask_imageIMAGE
maskMASK
area_infoLLS_MASK_INFO