ComfyUI Node

SolidMaskAdv

Solid masks, now with an ellipse option

By jkrauss82·Created 2 years ago·Updated 7 months ago· 8
SolidMaskAdv
    • MASK
    value1.00
    width512
    height512
    typerectangle

    SolidMaskAdv is the rare node that does exactly one thing the stock node can't. ComfyUI's built-in SolidMask only makes rectangles. This one makes rectangles and ellipses - or, as the dropdown actually spells it, "ellipsis." That's the whole pitch. It's a two-minute addition from the ULTools pack that you'll keep around because every now and then you need a round mask and don't want to build one out of three image ops.

    What it's for

    A solid mask is a full-frame image filled with one value - 0 (black, masked out) to 1 (white, fully included) - used to tell ComfyUI where to work. The classic use is inpainting: you generate a mask over the region you want regenerated, and the sampler only touches that area while the rest stays pixel-identical. Round masks come up more than you'd think: eyes and faces for face fixing, circular objects for object replacement, soft vignettes for compositing. The shape matters because a rectangle mask crops your subject with hard corners, and for a face or a lens or a ball, that's the wrong shape.

    How it works

    Nothing mysterious. Rectangle mode builds the mask with torch.full - a plain filled tensor. Ellipse mode switches to PIL's ImageDraw.ellipse and converts the result to a tensor. Four inputs, one output:

    • value - the fill level, 0 to 1 (default 1). 1 = fully included, 0 = fully masked, decimals = partial (useful with mask-blur style ops downstream).
    • width / height - mask dimensions, up to 16384. Set these to match your image resolution or you'll get size mismatches when you composite.
    • type - rectangle or ellipsis. Yes, the typo is in the shipped code; treat it as the "round" option.

    Output is a single MASK, which wires into anything that accepts one: a MaskSetLatentNoiseMask chain for inpainting, mask math nodes to subtract or combine regions, or a composite step to paste regenerated detail back into the frame.

    One thing it doesn't give you: a feathered or gradient edge. It's a hard-edged solid mask, same as the stock node. If you need soft falloff, pipe the output through a mask-blur or feather node before it hits the sampler - that's the usual combo anyway, since hard mask edges are exactly what causes visible seams.

    Installing it

    SolidMaskAdv is part of the ULTools for ComfyUI pack (jkrauss82/ultools-comfyui) - install the pack and you get all four of its nodes at once. Via ComfyUI Manager, search "ULTools for ComfyUI". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jkrauss82/ultools-comfyui
    cd ultools-comfyui
    pip install -r requirements.txt   # pandas, numpy, piexif
    

    Restart ComfyUI, done. No models, no heavy dependencies, and it's a hobby project so there's no SLA - but for a node this small there isn't much to break.

    Honest take: this is a convenience node, not a headline feature. If you're doing any mask-based inpainting at all, the one circular option saves you a fiddly detour, and the rectangle behavior matches stock ComfyUI exactly, so there's no downside to swapping it in.

    Categorymask

    Inputs (4)

    NameTypeDefaultDescription
    valueFLOAT1.000–1
    widthINT5121–16384
    heightINT5121–16384
    typeCOMBOrectangle2 options: rectangle, ellipsis

    Outputs (1)

    NameTypeDescription
    MASKMASK