ComfyUI Node Runs on cloud

Mask Feather

Soften a mask's edges the controlled way

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Mask Feather
  • mask
  • MASK
left0
top0
right0
bottom0

Mask Feather fades the edges of a mask to black - and unlike the usual one-blur-fits-all approach, it fades each of the mask's four edges by its own distance. Left edge soft by 4 pixels, bottom edge soft by 60, top and right left hard. That per-edge control is the whole reason this node exists, and it matters more than it sounds: when a subject fills the bottom of a frame, the seam you're fighting is at the bottom, and feathering the top edge of the mask just eats into clean image you wanted left alone.

The name is doing honest work here - this is edge feathering, not a Gaussian blur. The mask's interior stays exactly as it was; only the named edges taper to black over a run of pixels. It's part of WAS Node Suite's masking family (WAS Suite/Image/Masking), and its job is the classic one: no hard edge, no visible seam in a composite or an inpaint.

How it works

One mask in, four distances: left, top, right, bottom, each the number of pixels the fade runs over. 0 leaves that edge hard, 2 is a hairline, 64 is a wide falloff. Mechanically, the outermost column of the fade gets cut to a fraction of its value and the innermost keeps all of it, with a linear ramp between. A batch of masks is handled one plane at a time, all with the same distances.

What makes it safe to use blind is the band the node draws on itself: it reports the mask's coverage before and after, what was cleared, and the box the mask fills. Feather too aggressively and the fade can swallow a small mask entirely - the node shows you the coverage dropping instead of letting you discover it as a missing subject three nodes downstream. That self-reporting is a v3 habit across the suite's mask nodes and it's the right one.

Why you'd reach for it

Two standard jobs. In masked inpainting, the KB's own guidance is that you want mask edges softened so generated content blends with original pixels - 4–12 pixels is the typical range, too little leaves a hard seam, too much bleeds changes into the surroundings. This node gives you that with per-edge control for the cases where a single blur radius can't do the right thing.

In compositing, a hard mask makes a cut-out read as a sticker. Feathering the mask a few pixels turns the paste into a blend. And because the feathering happens on the mask, not on the image, it composes with everything downstream - crop, paste, inpaint - that consumes a MASK wire.

The output is a single MASK at the same size and batch length as the input, ready to wire anywhere a mask goes.

Installing it

Standard WAS Node Suite v3 install:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

or ComfyUI Manager → "WAS Node Suite v3", then restart. ComfyUI 0.14.0+ and Python 3.10+; no pip dependencies, and the suite's mask math runs on ComfyUI's own device.

Where people get burned

The most common mistake is feathering everything because you're used to a uniform mask blur - then wondering why the top of a head that butts against the frame edge now has a transparent halo. Feather only the edges that actually touch background, which is exactly what the four independent distances let you do. Second: a feathered mask still has a hard-ish start at the outermost pixel, so a very wide fade (say, several hundred pixels) on a thin mask can erase it to nothing - read the coverage band before you commit. And don't use this to rescue an already-rough mask; if the edge itself is wrong, that's Mask Guided Filter's job, not feathering's.

CategoryWAS Suite/Image/Masking

Inputs (5)

NameTypeDefaultDescription
maskMASKThe mask to soften. A batch is handled one plane at a time, all by the same distances.
leftINT00–16384Pixels the fade runs over at the left edge; INT. 0 leaves it hard, 2 is a hairline, 64 is a wide falloff. The outermost column is cut to a fraction of its value and the innermost keeps all of it.
topINT00–16384Pixels the fade runs over at the top edge; INT. 0 leaves it hard, 2 is a hairline, 64 is a wide falloff.
rightINT00–16384Pixels the fade runs over at the right edge; INT. 0 leaves it hard, 2 is a hairline, 64 is a wide falloff.
bottomINT00–16384Pixels the fade runs over at the bottom edge; INT. 0 leaves it hard, 2 is a hairline, 64 is a wide falloff.

Outputs (1)

NameTypeDescription
MASKMASKThe mask with the named edges faded to black, at the same size and batch length as the one that went in.