Nodes/SaltAI-Open-Resources/Smooth Mask Regions
ComfyUI Node

Smooth Mask Regions

Feather a hard mask edge with a Gaussian blur

By get-salt-AI·Created 2 years ago·Updated 2 years ago· 84
Smooth Mask Regions
  • masks
  • MASKS
sigma5.0

A hard-edged mask produces a hard-edged seam - you'll see exactly where the composite or inpaint stops, because nothing about a sharp cutoff mimics how real edges look. SaltMaskSmoothRegion is the standard fix: a Gaussian blur applied to the mask itself, softening a binary edge into a graded feather.

What it does

One tunable parameter, sigma (float, default 5, range 0–128), which controls the blur's radius - think of it as how wide the feathered transition zone gets. A sigma of 0 leaves the mask essentially untouched; higher values spread the edge over a wider band. The output, MASKS, is the softened mask.

Where you'd use it

This is the classic "feather your mask before you composite" step that shows up constantly in inpainting work - whether you drew the mask by hand or got it from a segmentation model like CLIPSeg, a raw mask is usually harder-edged than what you actually want blending into a final image. Feathering it beforehand means the transition between "regenerated" and "original" reads as smooth rather than as a visible boundary. It pairs naturally upstream of anything that composites based on the mask - this pack's SaltImagePasteCrop has its own crop_blending control, but smoothing the mask itself earlier in the chain is the more general version of the same idea, useful anywhere a mask feeds a blend.

Installing it

ComfyUI Manager: search SaltAI-Open-Resources. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/get-salt-AI/SaltAI

Restart ComfyUI. No dependencies beyond the pack itself - a Gaussian blur is cheap, ordinary image math.

Common issues

On a small or thin mask region, a high sigma can blur the shape into near-nothing - the same risk as over-eroding a small mask, just via blurring instead of shrinking. If your mask is disappearing rather than just softening at the edges, bring sigma down and check the result visually rather than assuming a bigger number is always better. If you actually want the opposite of this node - a crisper edge, not a softer one - that's SaltMaskSharpeningFilter elsewhere in the pack, not a negative sigma here (there isn't one; the range starts at 0). And remember smoothing is a blur, not a shape correction: if the underlying mask boundary is in the wrong place, softening its edge doesn't fix that, it just makes the wrong boundary fuzzy instead of sharp.

CategorySALT/Masking/Filter

Inputs (2)

NameTypeDefaultDescription
masksMASK
sigmaFLOAT5.00–128

Outputs (1)

NameTypeDescription
MASKSMASK