Smooth Mask Regions
Feather a hard mask edge with a Gaussian blur
- masks
- MASKS
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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | — | |
| sigma | FLOAT | 5.00–128 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASKS | MASK | — |