Nodes/comfyui-mixlab-nodes/Smooth Mask ♾️Mixlab
ComfyUI Node Runs on cloud

Smooth Mask ♾️Mixlab

The one-dial way to soften a hard mask edge

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Smooth Mask ♾️Mixlab
  • mask
  • MASK
smoothness1

A crisp, hard-edged mask is usually the thing that gives a composite away - you can see exactly where one image was pasted onto another. Smooth Mask exists to fix that with the smallest possible interface: one input, one number, one output. Feed it a mask, turn up smoothness, and the boundary softens into a gradient instead of a sharp line.

The README groups this node with FeatheredMask under the same one-line description - "add edges to an image" - and they do overlap in purpose, but they're not the same tool. FeatheredMask is a two-step node: it grows or shrinks the mask boundary first (start_offset, positive or negative), then blurs that boundary separately (feathering_weight). Smooth Mask skips the grow/shrink step entirely and just has smoothness, an integer from 0 to 150 (default 1), controlling how soft the edge gets. If you need to resize the masked region and soften it in one pass, FeatheredMask is the more capable node. If you already have the region right and just want the edge less harsh, Smooth Mask is the faster, simpler way to get there - one slider, no second parameter to think about.

The output is a single MASK, ready to feed straight into whatever consumes a mask next: a composite node, an inpaint step, or TransparentImage if you're building an RGBA cutout. Because there's no offset control, the region's size and position don't change at all - only how gradual the transition at its edge is.

Install is the pack-wide standard:

cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git
cd comfyui-mixlab-nodes
install.bat

or via ComfyUI Manager (search "comfyui-mixlab-nodes"), or pip3 install -r requirements.txt in a venv. No model download needed - this is pure mask math, not inference, so it's usable the moment the pack loads.

The default smoothness of 1 is subtle almost to the point of doing nothing visible - if a seam is still showing after adding this node, push the value up meaningfully (think tens, not single digits) before concluding it isn't working. Going too far the other direction has its own cost: crank smoothness high on a mask with fine detail - hair, thin object edges, small gaps - and you can blur those details away along with the hard edge, effectively rounding off shapes you wanted to keep sharp. There's no way to smooth only part of a mask's boundary with this node; it applies uniformly, so if you need a strong soften in one area and a crisp edge somewhere else on the same mask, you'll want to isolate those regions before this node rather than expecting one smoothness value to serve both. And if the mask coming in already has soft or antialiased edges - say, from a matting-aware background-removal model rather than a hand-painted or thresholded one - running it through Smooth Mask on top can be redundant or even counterproductive; check what produced your mask before assuming it needs this step at all.

Category♾️Mixlab/Mask

Inputs (2)

NameTypeDefaultDescription
maskMASK
smoothnessINT10–150

Outputs (1)

NameTypeDescription
MASKMASK