Nodes/ComfyUI/Detect Face Landmarks (MediaPipe)
ComfyUI Node Runs on cloud

Detect Face Landmarks (MediaPipe)

Commercially-clean face detection and 478-point meshes in core

By Comfy-Org·Created 4 years ago·Updated 20 days ago· 121,575
Detect Face Landmarks (MediaPipe)
  • face_detection_model
  • image
  • face_landmarks
  • bboxes
detector_variantshort
num_faces1
min_confidence0.50
missing_frame_fallbackempty

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. Drop mediapipe_face_fp32.safetensors in models/detection/.
  • image - input frame(s), or a video batch.
  • detector_variant - short (default, close-ups, fast), full (farther/smaller faces, slower), or both (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: empty leaves failed frames faceless, previous copies the last good detection, interpolate lerps landmarks between bracketing successful frames. This is your "how much do we paper over detection failures" knob, and interpolate is 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.

Categoryimage/detection

Inputs (6)

NameTypeDefaultDescription
face_detection_modelFACE_DETECTION_MODEL
imageIMAGE
detector_variantCOMBOshortFace 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_facesINT10–16Maximum faces to return per frame. 0 = no cap (return all detected).
min_confidenceFLOAT0.500–1BlazeFace score threshold. Lower to catch small/occluded faces.
missing_frame_fallbackCOMBOemptyPer-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)

NameTypeDescription
face_landmarksFACE_LANDMARKS
bboxesBOUNDING_BOX