Nodes/comfyui-mixlab-nodes/Face To Mask ♾️Mixlab
ComfyUI Node Runs on cloud

Face To Mask ♾️Mixlab

Turn a photo into a face mask in one node

By MixLabPro·Created 3 years ago·Updated 2 months ago· 1,859
Face To Mask ♾️Mixlab
  • image
  • MASK

You've got a portrait and you want just the face selected - nothing else, no manual painting. Drop the image into Face To Mask and it hands you back a MASK covering the face region. That's the entire node. One input, one output, no settings to fiddle with. It's the "I need a face mask and I need it now" node.

Where this fits: masking a face is the first step in a whole family of edits. Fixing skin, swapping a face, running a detailer pass, relighting just the head, blurring a face for privacy - every one of those starts with a mask that says "here's the face." The inpainting KB makes the case at length: a mask is the one thing an instruction-editing model can't give you, because it's what guarantees the rest of the frame stays untouched. Face To Mask is the cheapest way to produce that starting mask when the target is a face.

How it works

Under the hood it's face detection plus a fill. It runs a detector over your image, finds the face bounding region, and paints that area white on a black canvas - which is exactly what a ComfyUI MASK is. There's no prompt, no threshold dial, no model picker exposed to you. You feed it a face, it gives you the region. The tradeoff for that simplicity is that you don't get to tune anything: if the detector misses, there's no knob to nudge it with.

Inputs and outputs

There's really only one thing to know here, because the schema is tiny:

  • image (IMAGE, required) - the picture with a face in it. That's the only input.

The single output is MASK, the detected face region as a standard ComfyUI mask. Wire it straight into whatever wanted a mask: a VAE Encode for Inpaint, an ImageCompositeMasked, a grow/blur node, or a detailer. If you want a soft edge instead of a hard cutout, run it through a feather or blur node first - Face To Mask gives you the raw region, not a feathered one.

How to install it

This ships inside the Mixlab pack, so you install the whole pack once and get this node with it.

  • ComfyUI Manager: open the Manager, search comfyui-mixlab-nodes (or "Mixlab nodes"), install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git, then install the requirements - on Windows run install.bat inside the folder, otherwise ../../../python_embeded/python.exe -s -m pip install -r requirements.txt (or pip3 install -r requirements.txt in an activated venv). Restart ComfyUI.

One heads-up that catches everyone new to this pack: on first startup you'll see a wall of "model not found" messages pointing at things like models/prompt_generator/text2image-prompt-generator and opus-mt-zh-en. Those are for other Mixlab nodes (the prompt-generator and translation stuff), not for Face To Mask. This node needs none of them. The errors are noise unless you actually plan to use those features.

Common issues

The failure mode is the detector, not the plumbing. If the face is small, heavily turned, occluded, or the image is stylized/anime, detection can miss and you'll get an empty (all-black) mask. When that happens, this node doesn't give you a way to recover - there's no sensitivity setting. Your move is to either upscale/crop closer to the face first, or reach for a more configurable detector: the Impact Pack's face detection with a face_yolov8 model, or a segmentation node from a background-removal pack, both give you thresholds and model choice that this node deliberately hides.

Also worth knowing: it masks a face, and on a group shot you shouldn't assume it isolates the exact one you wanted. For single-subject portraits it's great. For crowds, use something with per-detection control. And since the mask comes out hard-edged, don't skip the feather step before compositing or you'll see a seam.

Category♾️Mixlab/Mask

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
MASKMASK