FC MaskOP
FC MaskOP — blur, erode, or dilate any mask before it wrecks your composite
- mask
- MASK
FC MaskOP is the pack's mask-editing utility: three classic morphological operations - blur, erode, dilate - on any MASK you feed it. It's the boring, dependable cleanup node, and in a pack that generates masks from segmentation models (which are rarely perfect the first time), it earns its keep. Blur the seam before compositing, erode a mask that's creeping past the face, dilate one that's too tight.
It's dead simple, which is the point. The README describes it in one line: "operations on the mask," with the note that a bigger kernel means a stronger operation.
The inputs
- mask (
MASK, required) - the mask to transform. Wire in anything:FC FaceSegment'ssoft_mask, aFC FaceDetectCropmask, or one you've drawn. - method - one of three choices:
burl(Gaussian blur),erode(shrink the white region),dilate(grow it). - kernel (
INT, default 16, 0–100) - the size of the operation kernel. Larger = more aggressive. 16 is already a fairly strong default; for fine control start around 4–8.
One MASK output: the transformed mask, ready to feed the next node.
The gotcha: the blur option is spelled burl
Yes, "burl" - it's a typo in the pack's code (["burl", "erode", "dilate"]), and it's what the dropdown literally shows. Don't go hunting for a "blur" option or assume your ComfyUI is broken. The blur uses a Gaussian kernel derived from the kernel size, while erode and dilate use a square structuring element of kernel × kernel.
Where it fits
Every compositing graph in this pack benefits from a pass through this node. The canonical uses:
- Blur the seam. After
FC FaceSegmentor beforeFC ReplaceByMask, a blur softens the hard mask edge so the pasted region doesn't show a sharp cut line. - Erode before paste-back.
FC CropToOriginalready erodes internally, but when you're hand-compositing, eroding keeps the swapped region slightly inside the target rather than bleeding over the boundary. - Dilate to rescue a tight mask. Segmentation masks often miss the hair fringe; a dilation grows them back out.
Install
It's part of ComfyUI-FaceChain, so: ComfyUI Manager (search "ComfyUI-FaceChain") or git clone https://github.com/THtianhao/ComfyUI-FaceChain into custom_nodes/, restart. Unlike the pack's model nodes, this one is pure OpenCV math - no downloads, no ModelScope, no per-run waiting. The pack's heavy startup dependency install still happens once, but after that this node is instant.
One more honest note: it's a utility, not a tool you'll show off, but every serious FaceChain graph ends up with one in it. The alternative is the same operations hand-rolled in a custom script - and you'd write the exact same thing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| method | COMBO | 3 options: burl, erode, dilate | |
| kernel | INT | 160–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |