Detect Face Landmarks (MediaPipe)
Commercially-clean face detection and 478-point meshes in core
- face_detection_model
- image
- face_landmarks
- bboxes
Face detection in this ecosystem has a quiet licensing landmine: InsightFace's pretrained models are non-commercial, so anything built on them - InstantID, PuLID, most face tools - inherits that restriction whether you noticed or not. MediaPipe is Google's Apache 2.0 answer, and this node is ComfyUI core's native door into it. Since May 2026 you can find, landmark, and crop faces with a fully permissive stack and zero extra packs installed. For anyone planning to sell what they generate, that single fact justifies the whole node.
It's a real-time-class face detector: BlazeFace finds faces, FaceMesh v2 drops 478 landmarks on each, and it even computes the ARKit 52-blend-shape coefficients you'd use for expression work. The whole thing is a pure-PyTorch port running on your GPU - no Google service, no Python package fights, nothing to install.
How it works
The pipeline is two stages. BlazeFace runs first to find faces - it's a fast, lightweight detector with two variants, a "short range" one tuned for close-ups within about two meters and a "full range" one that reaches further for small faces. Then FaceMesh warps a canonical mesh onto each detection, producing per-face landmarks, a presence score, and the blendshape values. Everything runs batched across your input frames, and it also hands back plain bounding boxes - which is the output most ComfyUI workflows actually need.
The inputs and outputs that matter
- face_detection_model - the loaded MediaPipe weights, from the
Load Face Detection Model (MediaPipe)node in model/loaders. Dropmediapipe_face_fp32.safetensorsinmodels/detection/. - image - input frame(s), or a video batch.
- detector_variant -
short(default, close-ups, fast),full(farther/smaller faces, slower), orboth(runs both, keeps whichever found more faces, roughly 2× cost). - num_faces - max faces per frame (default 1;
0= uncapped). - min_confidence - BlazeFace score threshold (default 0.5). Drop it to catch small or occluded faces.
- missing_frame_fallback - for video batches:
emptyleaves failed frames faceless,previouscopies the last good detection,interpolatelerps landmarks between bracketing successful frames. This is your "how much do we paper over detection failures" knob, andinterpolateis genuinely clever for keeping tracking-ish continuity in a batch.
Outputs: face_landmarks (the full FACE_LANDMARKS payload - landmarks, 3D coordinates, blendshapes, per-face boxes) and bboxes (plain boxes with face labels and scores, compatible with DrawBBoxes).
Wiring it up
face_landmarks feeds the two sibling nodes: Draw Face Mask (MediaPipe) for inpainting masks, Visualize Face Landmarks (MediaPipe) for the wireframe overlay (which is exactly what a face-mesh ControlNet conditions on). The bboxes output goes to DrawBBoxes or any crop/detailer that eats boxes.
One honest limitation, from the maintainer who swapped MediaPipe in for a living: it loses to InsightFace on extreme face angles, but otherwise keeps up - and it's faster on CPU and dramatically easier to install. For routine face detection in core ComfyUI, it's now the default that doesn't come with a licence asterisk.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| face_detection_model | FACE_DETECTION_MODEL | — | |
| image | IMAGE | — | |
| detector_variant | COMBO | short | Face detector range. 'short' is tuned for close-up faces (within ~2 m of the camera); 'full' covers farther / smaller faces (up to ~5 m) but is slower. 'both' runs both detectors and keeps whichever found more faces per frame (~2× detection cost). |
| num_faces | INT | 10–16 | Maximum faces to return per frame. 0 = no cap (return all detected). |
| min_confidence | FLOAT | 0.500–1 | BlazeFace score threshold. Lower to catch small/occluded faces. |
| missing_frame_fallback | COMBO | empty | Per-frame behaviour when detection fails in a batch. 'empty' leaves the frame faceless. 'previous' copies the most recent successful detection. 'interpolate' lerps landmarks/bbox/blendshapes between bracketing successful frames. Multi-face: pairs faces across frames by greedy bbox-centre NN. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| face_landmarks | FACE_LANDMARKS | — |
| bboxes | BOUNDING_BOX | — |