Nodes/ComfyUI/Feather Mask
ComfyUI Node Runs on cloud

Feather Mask

The soft edge that keeps inpaints from looking glued on

By Comfy-Org·Created 4 years ago·Updated 31 minutes ago· 129,926
Feather Mask
  • mask
  • MASK
left0
top0
right0
bottom0

Feather Mask softens the edges of a mask by fading each edge inward, per side. It's the difference between an inpaint that looks like a sticker and one that looks like the change was always there. If Grow Mask is the node that gives the model room to work, Feather Mask is the node that makes the seam invisible.

Why you'll reach for it

Hard mask edges are the number-one cause of visible seams in inpainting and compositing. A mask that goes straight from 1.0 to 0.0 in one pixel hands the model a knife-edge boundary, and the result is a visible transition line even when the generation itself is good. The community standard - from the inpainting playbooks to the troubleshooting docs - is 4–12 pixels of feathering on mask edges. That's the entire job of this node.

Where it earns its keep beyond the default inpainting flow:

  • After growing. Grow a mask for context and it gets a hard cliff; feather it after and the expansion blends instead of announcing itself.
  • Before compositing. IC-Light workflows and any paste-an-object-into-a-scene pipeline want feathered masks so the composited region melts into the destination.
  • Fix-up passes. After a ThresholdMask hardens a soft selection, a feather is what gives you back a usable gradient.

How it works

This is a linear ramp, not a blur, and knowing the difference saves you confusion. For each edge you set, the node multiplies that edge's columns (or rows) by a ramp: pixel one gets 1/N, pixel two gets 2/N, and so on up to the last feathered pixel at 1.0. So left = 8 fades the leftmost 8 columns from 0.125 up to full. Because it's multiplicative, existing values are scaled, not replaced - a partially white mask stays proportionally softer. It's also CPU-fast: just a handful of tensor multiplies, no expensive blur kernel.

The one thing that makes this node unusual is that it feathers per side. Most tools feather uniformly; here you set left, top, right, and bottom independently. That's the killer feature for outpainting - you extend the image on the right and feather only the right edge so the new content blends while the original three sides stay untouched.

The inputs that matter

  • mask - what you're softening.
  • left, top, right, bottom - feather width in pixels for each edge, each defaulting to 0 (no feather). Set only the sides you need.

One output, MASK.

Getting it

Core ComfyUI, nothing to install. It's in comfy_extras/nodes_mask.py with the rest of the mask family, and it's been there since the mask nodes were introduced.

Where people get burned

  • Defaults do nothing. All four sides default to 0, so a bare FeatherMask is a pass-through. People connect it, see no change, and assume it's broken. It's not - you have to pick the edges.
  • It's not a blur. If you want a uniform soft edge from a distance-based falloff, you might actually want a blur node instead. Feather Mask fades linearly from the edge inward, which is the right shape for most seams but not a gaussian.
  • Too much feather bleeds. The inpainting docs warn about this: over-feathering lets the change leak far outside the region you wanted, so the model "fixes" pixels you meant to protect. 4–12px is the sweet spot; more is usually a mistake.
Categoryimage/mask

Inputs (5)

NameTypeDefaultDescription
maskMASK
leftINT00–16384
topINT00–16384
rightINT00–16384
bottomINT00–16384

Outputs (1)

NameTypeDescription
MASKMASK