Nodes/Eden.art nodesuite/Eden_FaceToMask
ComfyUI Node Runs on cloud

Eden_FaceToMask

MediaPipe face detection, turned into a mask

By edenartlabΒ·Created 3 years agoΒ·Updated 6 months agoΒ· 119
Eden_FaceToMask
  • image
  • MASK

The fastest way to a face mask in ComfyUI is a single node: Eden_FaceToMask. Feed it an image, and it runs Google's MediaPipe face detector, then hands you a binary MASK where every detected face is a white blob on black. No model downloads to hunt down, no ControlNet preprocessor dance - one wire in, one wire out, faces found.

It's the "detect" half of Eden.art's face toolkit, designed to be paired with Eden_Face_Crop for the crop half. It exists because face detection is a solved problem and shouldn't be the thing you spend a morning configuring.

How it works

Under the hood it's a direct call to MediaPipe's FaceDetection (at min_detection_confidence=0.5, the default), which is the same detection engine the ecosystem settled on for license-friendly face work - the KB's identity-preservation essay notes MediaPipe's Apache-2.0 license is precisely why projects migrated off InsightFace. For each face detected, the node takes the bounding box and fills that rectangle white in a black mask, then returns the mask as a MASK tensor.

Two honest caveats about what it isn't. It detects and boxes faces - it does not produce a tight per-face silhouette (you get rectangles, not outlines), and it does not produce identity embeddings, so you can't use it to drive FaceID/InstantID-style matching. It's for finding and isolating faces, which is a big and useful job on its own.

The inputs

One, and it's not optional: image (IMAGE). That's the entire required schema. The output is a single MASK with white regions marking the detected faces.

What you do with it

Wire the MASK into Eden_Face_Crop to crop the main face with padding, then upscale or inpaint the crop and composite it back - the standard face-fix chain. Or use the mask directly in an inpainting pass (mask the face region, regenerate just that area), or as a region selector for regional prompting. Since it detects all faces in frame, group shots give you a multi-blob mask you can then separate into per-face regions with a connected-components node if you want to process each face independently.

Installing

Part of edenartlab/eden_comfy_pipelines (Eden.art nodesuite):

cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines.git
cd eden_comfy_pipelines
pip install -r requirements.txt

Restart ComfyUI, or ComfyUI Manager β†’ search "Eden". Important: MediaPipe is imported at runtime and is not in the pack's requirements.txt - the code does import mediapipe on the fly. If the node errors with a missing module, install it yourself:

pip install mediapipe

That's the one real installation gotcha in the face toolkit.

Gotchas

The mask is rectangular - one white box per detected face, not a face-shaped cutout. For a tight face silhouette, run the result through a segmentation or pass it to a node that refines the mask, or just live with the box (most face-crop pipelines do). Detection confidence is fixed at 0.5 in the source, so very small or heavily angled faces can be missed - the KB notes MediaPipe can trail InsightFace on extreme angles. And it prints a face count to your console when it runs, which is a handy free sanity check: if it says Faces Detected: 0, your input image is the problem, not the node.

CategoryEden 🌱/face

Inputs (1)

NameTypeDefaultDescription
imageIMAGEβ€”

Outputs (1)

NameTypeDescription
MASKMASKβ€”