Nodes/comfyui_face_parsing/MaskBorderDissolveAdvanced(FaceParsing)
ComfyUI Node

MaskBorderDissolveAdvanced(FaceParsing)

Feather each edge independently

By Ryuukeisyou·Created 3 years ago·Updated about a year ago· 193
MaskBorderDissolveAdvanced(FaceParsing)
  • mask
  • MASK
l10
t10
r10
b10
kernel_size5
sigma0.00

Same job as its sibling MaskBorderDissolve - soften a mask's edge so it composites without a visible seam - but with one uniform size value swapped out for four independent ones: left, top, right, bottom. If the plain version is "blur the border," this is "blur the border, but let each side be different," which turns out to matter more than it sounds for a face-shaped mask.

Why you'd want per-edge control

A face isn't symmetric in how it meets a mask boundary. Think about what's actually at each edge of a typical face-parsing mask: the top runs into the hairline, which is soft and irregular by nature and can tolerate - even benefits from - a wider dissolve. The bottom runs into the jaw and neck, often a much cleaner edge against skin where you might want a tighter, more precise transition to avoid smearing detail you want to keep. The sides run into hair, ears, or background depending on head angle. Using one size value for all four, via the plain MaskBorderDissolve, means picking a compromise that's slightly wrong for at least one edge. This node lets you actually tune each one instead of averaging.

Reach for this over the plain version specifically when a composite is looking uneven - feathered nicely on one side, still showing a seam on another - rather than reaching for it by default. Most of the time the simpler node with one size value is enough, and there's no reason to add the extra tuning surface unless you can see it's needed.

The inputs that matter

  • mask - the mask to soften.
  • l, t, r, b (each default 10) - dissolve amount in pixels for the left, top, right, and bottom edges independently. Same underlying effect as MaskBorderDissolve's single size, just split four ways. Start all four at the same default and only pull one away from the others once you've actually seen where the seam is.
  • kernel_size (default 5) and sigma (default 0) - the Gaussian blur smoothing the dissolved edges, same as the plain version. This applies globally across all four edges rather than being independently tunable per side.

Output is a single MASK, ready for a composite step - typically MaskComposite or MaskInsertWithBBox right after, since the whole point of feathering is to make the eventual paste-back invisible.

Installing it

Via ComfyUI Manager: search comfyui_face_parsing, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Ryuukeisyou/comfyui_face_parsing.git

Restart ComfyUI afterward. No model weights are needed for this specific node - it's mask arithmetic - but the pack overall pulls its face-parsing model into models/face_parsing/ and a YOLOv8 face detector into models/ultralytics/bbox on first use, both from HuggingFace repos named in the README, with manual-download instructions there if you need them.

Where people trip up

The obvious one: forgetting which side is which and dissolving the wrong edge. l/t/r/b map to left/top/right/bottom of the mask as it sits in the image - not relative to the face's orientation if the head is tilted or turned, which catches people who assume "top" means "top of the head" rather than "top of the frame." Preview the mask after adjusting a single edge to confirm you dissolved the one you meant to. The other trap is the same one as the plain node, just multiplied by four: pushing any one of l/t/r/b too high eats visibly into the mask from that side, so if a composite starts looking asymmetrically shrunk - smaller on one edge than the others - that's almost always this node's settings rather than anything upstream in the parsing itself.

Categoryface_parsing

Inputs (7)

NameTypeDefaultDescription
maskMASK
lINT10
tINT10
rINT10
bINT10
kernel_sizeINT5
sigmaFLOAT0.00

Outputs (1)

NameTypeDescription
MASKMASK