Nodes/comfyui_face_parsing/MaskBorderDissolve(FaceParsing)
ComfyUI Node

MaskBorderDissolve(FaceParsing)

Feather a mask's edge evenly

By Ryuukeisyou·Created 3 years ago·Updated about a year ago· 193
MaskBorderDissolve(FaceParsing)
  • mask
  • MASK
size10
kernel_size5
sigma0.00

This is the node that keeps a face-parsing mask from producing a visible seam. It shrinks the mask's edge inward by a set number of pixels and then blurs that edge, so instead of a hard pixel-perfect boundary you get a soft transition - the same fix the inpainting world has relied on forever, applied here to a segmentation mask instead of a hand-painted one.

Why a segmentation mask needs this at all

A face-parsing model's output is, by nature, a hard classification - every pixel gets assigned to exactly one class, skin or not-skin, with nothing in between. That's precise, but precise is exactly the problem when you go to composite: paste a region back using a razor-sharp mask boundary and you get a visible edge, a seam where the pasted content and the original don't quite agree on color or texture right at the line. The KB's inpainting notes call this out directly for the equivalent problem in masked inpainting - too little mask blur causes hard seams, too much bleeds the change into surrounding pixels, and 4–12px is the typical sweet spot people land on for that kind of work. The exact right number here depends on your image resolution and how sharp the underlying edge is (a hairline needs different treatment than a jaw), but that's the range to start experimenting from rather than the extremes.

The inputs that matter

  • mask - the mask to soften.
  • size (default 10) - how many pixels to dissolve the border by. This is the main dial. Too small and the seam is still visible; too large and you start eating into detail near the edge - for a face-shaped mask, going too aggressive here can visibly shrink the jaw or eat into the hairline.
  • kernel_size (default 5) and sigma (default 0) - the Gaussian blur applied to smooth that dissolved edge. kernel_size controls how wide the blur window is; sigma at 0 typically lets the blur derive its spread from the kernel size automatically rather than you having to hand-tune both. Nudge kernel_size up if the transition still looks stepped after adjusting size.

Output is a single MASK, softened at the border. This usually sits right before a composite step - MaskComposite, MaskInsertWithBBox, or a straight ImageCompositeMasked-style paste - so the edge you've just softened is the edge that actually shows up in your final image.

Installing the pack

Through ComfyUI Manager: search comfyui_face_parsing, install, restart. Manual clone:

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

Restart ComfyUI. This particular node is pure mask math and needs no model weights of its own, but the pack's face-parsing model and YOLOv8 face detector will download to models/face_parsing/ and models/ultralytics/bbox the first time a workflow needs them, sourced from jonathandinu/face-parsing and Bingsu/adetailer on HuggingFace - see the README for manual-download links if that's flaky for you.

Where it goes wrong

The classic mistake, straight from the general inpainting playbook: dialing size up "to be safe" and ending up with a mask that's noticeably smaller than the region you meant to select, because dissolving eats inward from the edge rather than just blurring in place. If a composited face region looks like it's shrunk away from the hairline or jawline, that's this node, not the parsing model - back off size before touching anything upstream. The other one is leaving kernel_size at its default when the mask's native resolution is large: a small blur kernel on a big image barely registers, so the "soft edge" you're expecting can still look almost hard. Preview the mask output directly (not just the final composite) when tuning this node - it's much easier to judge whether the edge actually looks feathered from the mask alone than from a composited result where other factors are also in play.

Categoryface_parsing

Inputs (4)

NameTypeDefaultDescription
maskMASK
sizeINT10
kernel_sizeINT5
sigmaFLOAT0.00

Outputs (1)

NameTypeDescription
MASKMASK