Nodes/ComfyUI-Utility-Suite/Blur Mask Outward Grow Amount
ComfyUI Node

Blur Mask Outward Grow Amount

Your mask blur is secretly a shrink — this node tells you by how much

By tom-m-2020·Created about a month ago·Updated 7 days ago· 1
Blur Mask Outward Grow Amount
    • grow_amount
    ◄blur_radius0.0►
    ◄tapered_cornersfalse►
    ◄outwardtrue►

    A node that draws nothing

    Blur Mask Outward Grow Amount produces no pixels. It takes three widgets and hands back one integer. That's the whole node.

    It's still worth understanding, because the thing it reports is the trap hiding inside every "soften the mask edge" step in an inpainting or outpainting graph. Blur the edge of a hard mask and you don't just get a soft edge - you get a soft edge that has moved inward. The inner half of the blur eats into the region you wanted fully masked, so a pixel that was confidently 1.0 comes back as 0.8, and your sampler treats it as a partial. That's fine at radius 4 (you'll barely see it, and inpainting docs put the useful mask blur range at roughly 4–12 px anyway). Push the radius to 32 for a fat, tile-friendly feather and you've quietly carved tens of pixels off your mask interior.

    The fix is to grow the mask before you blur it, so the blur's inward tail lands in padding instead of in your subject. This node tells you how much growing is needed. The pack's companion node, Blur Mask Outward, does exactly that internally - and Grow Amount is the reporting half of the same math, split out so you can read the number and use it elsewhere.

    How the number is derived

    Nothing here is a magic constant; the code measures. It builds a synthetic hard edge, blurs it with the same routine the real node uses (Pillow's GaussianBlur, three box passes), and finds where the blur starts to dim pixels on the inside of the edge. That distance is the compensation. Square-corner masks use that straight measure; tapered corners bisect for the smallest diamond dilation whose centre pixel survives a blur completely untouched, which is why the tapered answer is bigger - close to double.

    Rule of thumb: square-cornered, the number tracks a little under three times blur_radius (a radius-32 blur lands in the ballpark of ninety pixels). Tapered corners, near double that. The node measures rather than guesses, so trust its number over mine.

    The three widgets that matter

    • blur_radius (0–100, step 0.1, default 0) - the same value you're feeding the blur. Default 0 means the answer is 0; nothing to compensate for.
    • tapered_corners (default off) - off uses a square structuring element, on uses a diamond, matching the semantics of core ComfyUI's GrowMask. This changes the answer a lot, so keep it consistent with whatever node actually grows your mask.
    • outward (default on) - turn it off and the node returns 0, because inward blurring doesn't push past the boundary and needs no compensation.

    Output is a single grow_amount (INT).

    Wiring it

    Wire grow_amount into any integer input that wants a pixel count: the expand widget on core GrowMask (right-click, convert to input) when you're growing manually before a blur you control, a crop padding, or the overlap margin on a tiled pass - this pack's own tiling nodes included, where how far the blur bleeds decides how much context each tile needs.

    One plumbing note: it isn't an output node, so if nothing downstream consumes the integer, ComfyUI is free to never run it. If you just want to read the value, connect it to something that uses it.

    Installing

    The pack has no README worth reading (the file is empty), so this is the real route. Search ComfyUI-Utility-Suite in ComfyUI Manager - it's published to the Comfy registry under publisher tom-m - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tom-m-2020/ComfyUI-Utility-Suite
    

    Then restart. requirements.txt is one line, opencv-python-headless, and that's what actually installs; skip it if another pack already gave you cv2, since pip swapping headless and non-headless builds is a good way to break the other pack. No models, no weights. The nodes land under the Utility Suite/Mask category.

    Common issues

    The number looks bigger than you expected. It should. The compensation is the blur's inward reach, not the blur's visible softness, and it grows faster than the radius does.

    It won't import at all. Every module in this suite is written against ComfyUI's newer V3 backend API (from comfy_api.latest import io). If your ComfyUI predates that, you'll get an import error and no nodes. Update ComfyUI; don't try to patch the pack.

    It doesn't match another pack's blur. Different implementations map "radius" to sigma differently - treat this as exact for Blur Mask Outward, and as an estimate for anything else. If you want the closest community equivalent in one node, KJNodes ships GrowMaskWithBlur, which grows and blurs in a single step instead of reporting the arithmetic.

    Fair warning on the pack itself: it's new - one commit, version 1.4.0 - so there's no community troubleshooting thread to fall back on yet. The source is the documentation.

    CategoryUtility Suite/Mask

    Inputs (3)

    NameTypeDefaultDescription
    blur_radiusFLOAT0.00–100—
    tapered_cornersBOOLEANfalse—
    outwardBOOLEANtrue—

    Outputs (1)

    NameTypeDescription
    grow_amountINT—