Nodes/ComfyUI-Inference-Core-Nodes/[Inference.Core] MediaPipe Face Mesh
ComfyUI Node

[Inference.Core] MediaPipe Face Mesh

Licence-Clean Face Conditioning

By LykosAI·Created 2 years ago·Updated about a year ago· 33
[Inference.Core] MediaPipe Face Mesh
  • image
  • IMAGE
max_faces10
min_confidence0.50
resolution512

Face detection in this ecosystem has a quiet licensing split most people never think about until they hit it: InsightFace's pretrained models are non-commercial, which means anything built on them (InstantID, PuLID, most FaceID tools) inherits that restriction. MediaPipe is Google's answer to the same problem - Apache 2.0, no strings attached - and this node is the ComfyUI door into it. It draws a colored face-mesh overlay from a detected face, which a matching MediaPipe Face ControlNet checkpoint then conditions on.

Worth being precise about what this actually gives you, because it's easy to conflate with tools it isn't. MediaPipe here is a detection and landmarking backend - it finds faces and maps out their geometry. It is not an identity model. If you're hoping this swaps in for InstantID or a FaceID-style embedding, it can't; those need an actual identity embedding (ArcFace, in InsightFace's case), and MediaPipe doesn't produce one. What it's good for is exactly what it's doing here: turning a face into a structural condition - where the eyes, nose, jawline, and mouth are - without touching identity at all. Tools that only need detection and cropping can swap MediaPipe in freely; tools built on the embedding itself can't.

What you set: image is required. max_faces (default 10, range 1–50) caps how many faces get detected and drawn in a single image - lower it if you only want the largest/primary face in a busy group shot, raise it if you're working with a crowd. min_confidence (default 0.5, range 0.01–1) is the detection threshold - raise it if the node is picking up false-positive faces in cluttered or low-contrast images, lower it if it's missing partially obscured or small faces. resolution (default 512) is the standard preprocessing size across this pack. The single IMAGE output feeds into a ControlNet Apply node paired with a MediaPipe Face ControlNet checkpoint, loaded separately - as with every preprocessor here, this node only produces the condition image, not the ControlNet itself.

The tradeoff against InsightFace-based detection, from the person who did the best-documented swap of this kind: InsightFace handles more extreme head angles, but MediaPipe otherwise keeps pace and runs noticeably faster on CPU. That last point is underrated - "lots of people have issues even just installing InsightFace" is a common complaint, and MediaPipe's install is comparatively painless, which matters if you've ever fought InsightFace's build dependencies.

Installing it: bundled in LykosAI's ComfyUI-Inference-Core-Nodes - LykosAI also builds Stability Matrix, the meta-installer a lot of people use for local SD UIs, so this pack's dependency handling is more deliberate than most solo repos. Install via ComfyUI Manager (search "ComfyUI-Inference-Core-Nodes") or manually: cd ComfyUI/custom_nodes && git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes, then run install.py against ComfyUI's Python environment, or pip install -e .[cuda] / .[cuda12] / .[rocm] / .[directml] / .[cpu] matched to your hardware, or a plain pip install -e . if you'd rather skip the acceleration extras. Note that mediapipe itself is a moderately hefty Python dependency to pull in - expect a bit of extra install time and disk space the first time this particular node's requirements get installed.

Troubleshooting: pack-wide, the recurring real issue is ModuleNotFoundError: No module named 'inference_core_nodes' after a git clone, meaning the Python install step didn't finish - often from install.py running against the wrong interpreter on a portable ComfyUI build. If detection is missing faces you'd expect it to catch, min_confidence is the first thing to check before assuming something's broken. And if you're getting an outright IMPORT FAILED for the whole pack rather than a face-mesh-specific error, that points to a broader dependency conflict - worth checking opencv-python version compatibility with any other preprocessor node packs you've got installed alongside this one.

CategoryControlNet Preprocessors/Faces and Poses Estimators

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
max_facesoptINT101–50
min_confidenceoptFLOAT0.500.01–1
resolutionoptINT51264–2048

Outputs (1)

NameTypeDescription
IMAGEIMAGE