Nodes/FUSE Face Enhancer/FUSE Mask Optionals
ComfyUI Node

FUSE Mask Optionals

The knob node that decides how clean your face paste looks

By WASasquatch·Created about a year ago·Updated 10 months ago· 13
FUSE Mask Optionals
    • mask_optionals
    mask_dilation0
    mask_erosion0
    mask_smoothing0.00
    mask_fill_holestrue
    blend_samplingbilinear
    blend_amount0.30
    blend_modebox
    use_sam_maskfalse
    color_transfernone

    This node does nothing on its own, and that's the point. FUSE Mask Optionals is a settings brick: you dial in how you want the face fix's masking and blending to behave, and it hands a DICT to the mask_optionals input on FUSE KSampler, the video version, or the generic one. Same pattern as the pack's YOLO settings node - a bunch of rarely-touched controls kept out of the main sampler's face so beginners aren't staring at sixteen sliders before their first run.

    You don't need it at all for a basic pass. The samplers have sane defaults baked in. Reach for this node when a face fix leaves a visible seam, a hard box edge, or a color patch that doesn't match the rest of the skin.

    What each control actually does

    • mask_dilation / mask_erosion - expand or shrink the processed mask by N pixels. Dilation is the classic fix for the pasted face ending slightly smaller than the region it's covering; a couple of pixels of erosion helps when the blend is eating into the eyes.
    • mask_smoothing - Gaussian blur radius for the mask edges. 0 means hard edges; a few pixels softens the transition, which is usually what you want on skin.
    • mask_fill_holes - fills gaps in the detected mask. Leave it on; turning it off is for when SAM's mask has a hole you're deliberately trying to keep (rarely).
    • blend_sampling - the resampling filter used when cropping the face and pasting it back. Bilinear is the default and the safe pick; lanczos gives crisper scaling at a tiny cost.
    • blend_amount (0.0–1.0, default 0.3) - the slider. How strongly the re-sampled face replaces the original pixels. Too low and the fix is invisible; too high and the pasted face stops looking like it belongs. 0.3–0.5 is the working range most people land in.
    • blend_mode - box or radial feathering. Box feathers around the rectangle; radial feathers from the center outward, which hides corners better on rounder face shapes.
    • use_sam_mask - swap the YOLO bounding box for a SAM segment-anything mask when blending. This is the "no more box edges" switch: it hugs the face contour instead of a rectangle. Costs a SAM model load, so it's off by default.
    • color_transfer - none, lab, pdf, or mean_std. When the re-sampled face's colors don't match the surrounding skin, these re-grade the pasted region to the original colors before blending. If you see a distinct patch, this is the fix.

    Output

    A single mask_optionals output of type DICT, wired into the mask_optionals input on any of the FUSE samplers. If you leave this node out, the sampler uses its built-in defaults - so treat it as an optional refinement layer, not a required step.

    Install note

    It ships inside the FUSE Face Enhancer pack, so installing FUSE KSampler installs this too - there's nothing extra to grab. Install the pack via ComfyUI Manager (search "FUSE Face Enhancer") or clone it into custom_nodes and pip install -r requirements.txt. Like the rest of the pack, it needs the YOLO and SAM models in models/yolo-face/ and models/sams/ before any of the samplers will offer you anything.

    One thing worth knowing: these settings are read per-run, not baked in. You can change blend_amount or color_transfer between executions without re-detecting faces - the sampler caches detection and crops, so the knobs here are the cheap ones to fiddle with while you iterate.

    CategoryFace Enhancement

    Inputs (9)

    NameTypeDefaultDescription
    mask_dilationoptINT00–16384Dilate (expand) the mask by this many pixels.
    mask_erosionoptINT00–16384Erode (shrink) the mask by this many pixels.
    mask_smoothingoptFLOAT0.000–1024Gaussian blur radius for mask smoothing.
    mask_fill_holesoptBOOLEANtrueFill holes in the detected mask.
    blend_samplingoptCOMBObilinearResampling method for resizing operations (face/mask crop and paste back).
    blend_amountoptFLOAT0.300–1The amount of blending to apply to the face embedding process.
    blend_modeoptCOMBOboxThe feathering mode to use for blending.
    use_sam_maskoptBOOLEANfalseUse the SAM face mask for blending instead of YOLO bounding box.
    color_transferoptCOMBOnoneColor transfer mode to use for maintaining original colors.

    Outputs (1)

    NameTypeDescription
    mask_optionalsDICT