Nodes/ComfyUI Essentials/πŸ”§ Mask Smooth
ComfyUI Node Runs on cloud

πŸ”§ Mask Smooth

Soften hard mask edges to kill compositing seams

By cubiqΒ·Created 3 years agoΒ·Updated about a year agoΒ· 1,155
πŸ”§ Mask Smooth
  • mask
  • MASK
β—„amount0β–Ί

A hard-edged mask is usually the reason a composite or an inpaint looks pasted-on. The transition between "keep" and "replace" is a single crisp pixel line, so you get a visible halo or a razor seam where the two regions meet. MaskSmooth softens that edge - it blurs the mask so the boundary becomes a gradient, and the blend downstream turns invisible. It's a small node with an outsized effect on how professional your inpainting and compositing look.

It's from ComfyUI Essentials by cubiq (Matteo Spinelli, the ComfyUI_IPAdapter_plus author). Masks come out of detectors and segmenters with hard edges by default, so a smoothing step is something you end up wanting constantly.

How it works

It applies a blur to the mask, spreading the boundary over several pixels according to the amount you set. Where the mask was a hard 0-to-1 jump, it becomes a smooth ramp. When that softened mask drives a paste or an inpaint, the feathered edge means the new content fades into the original instead of butting against it.

The inputs and outputs that matter

  • mask (MASK) - the mask to soften.
  • amount (INT, 0–127, default 0) - the blur radius. 0 does nothing; small values (a handful of pixels) feather just enough to hide a seam; large values give a very soft, wide falloff. This is the only knob, and the right value depends on your image resolution - bigger images want more.

Output: the smoothed MASK.

How to install it

ComfyUI Manager: search ComfyUI Essentials, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/cubiq/ComfyUI_essentials
pip install -r ComfyUI_essentials/requirements.txt

then restart. No models.

Common issues & troubleshooting

Nothing changed. amount is probably still 0. That's a no-op - bump it up to actually feather the edge.

My inpaint region grew / bled outside where I wanted. Too much smoothing pushes the soft edge well past the original boundary, so the inpaint starts affecting areas you meant to keep. Dial amount back down - you want just enough feather to hide the seam, not a giant halo.

Seams are still visible. If a modest feather isn't enough, the problem may be elsewhere - a color mismatch between the inpainted region and its surroundings, for instance, which smoothing the mask can't fix. Consider matching color separately. But most "obvious inpaint" complaints really are a too-hard mask, and this is the first thing to try.

Node missing after a ComfyUI update. Essentials is maintenance-only as of April 2025, and pack nodes have broken on newer builds. Update through Manager; roll ComfyUI back if it's genuinely incompatible.

Categoryessentials/mask

Inputs (2)

NameTypeDefaultDescription
maskMASKβ€”
amountINT00–127β€”

Outputs (1)

NameTypeDescription
MASKMASKβ€”