Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

Make sure your ComfyUI is updated.Workflows in this guide can be found in the Workflow Templates. If you can’t find them in the template, your ComfyUI may be outdated. (Desktop version’s update will delay sometime)If nodes are missing when loading a workflow, possible reasons:
  1. You are not using the latest ComfyUI version (Nightly version)
  2. Some nodes failed to import at startup
MediaPipe is Google’s open-source machine learning solution for real-time perception. In ComfyUI, MediaPipe Face Detection provides BlazeFace detection, FaceMesh v2 landmark estimation, and ARKit-52 blendshapes — all in a single unified workflow. MediaPipe Face Detection is natively supported in ComfyUI (PR #14009), and the model weights are available under the Apache 2.0 License. MediaPipe GitHub | Comfy-Org Model Repository

Key capabilities

  • Fast face detection — BlazeFace-based detector with short (~2 m) and full (~5 m) range variants
  • 478 facial landmarks — dense FaceMesh v2 keypoints per detected face
  • ARKit-52 blendshapes — real-time facial expression coefficients
  • Face region masks — per-region masks for face oval, lips, eyes, and irises
  • Face bounding boxes — outputs compatible with DrawBBoxes for bounding box visualization
Scope: Face detection only — BlazeFace + FaceMesh v2 + ARKit blendshapes. This does not cover hand, pose, or holistic detection.

MediaPipe Face Detection Workflow

1. Download the Workflow

Update your ComfyUI to the latest version, then go to WorkflowBrowse Templates and find “Mediapipe: Image Face Detection” under the Utility category.

Download JSON Workflow File

Download workflow

Run on Comfy Cloud

Open in cloud

Download Sample Image

Get the example input image for this workflow
MediaPipe Face Detection preview

2. Download the Model

The MediaPipe Face Detection model is hosted on the Comfy-Org MediaPipe model repository. Place it in the following directory structure:
📂 ComfyUI/
└── 📂 models/
    └── 📂 detection/
        └── mediapipe_face_fp32.safetensors

3. Using the Workflow

This workflow uses a subgraph node that orchestrates face detection, visualization, and mask generation. The subgraph exposes the following controls:

Learn about Subgraph

This workflow uses Subgraph nodes for modular processing. Check out the Subgraph documentation to learn how to customize and extend the workflow.
Subgraph inputs:
InputDescription
imageInput image batch to analyze
face_landmarkerOptional. Leave empty to use the built-in model loader. Connect an external FACE_DETECTION_MODEL output to override
Subgraph parameters:
ParameterDefaultDescription
model_namemediapipe_face_fp32.safetensorsCheckpoint in ComfyUI/models/detection/. If missing, download the model above
detector_variantshortshort — tuned for close/large faces (~2 m range). full — covers smaller/farther faces (~5 m), slower. both — runs both detectors and keeps whichever found more faces per frame (~2× cost)
num_faces1Maximum faces to return per frame. 0 = no cap (return all detected). Range: 0–16
custom_face_ovalfalseInclude face-outline region in the mask output
custom_lipsfalseInclude lips in the mask (union with other enabled regions)
custom_left_eyefalseInclude left eye region in the mask
custom_right_eyefalseInclude right eye region in the mask
custom_irisesfalseInclude iris regions in the mask
Mask toggles use custom mode internally: only checked regions are filled; multiple ON regions are unioned into one mask per frame. Subgraph outputs:
OutputTypeDescription
face_landmarksFACE_LANDMARKSPer-frame faces with 478 2D/3D landmarks, ARKit-52 blendshapes, mesh topology data — feeds into visualization and mask nodes
bboxesBOUNDING_BOXFace bounding boxes — compatible with DrawBBoxes node
maskMASKBinary mask from the enabled region toggles

4. Run the Workflow

  1. Ensure the model file is placed in ComfyUI/models/detection/
  2. Load an image in the Load Image node
  3. Adjust detection parameters as needed
  4. Click Queue or use Ctrl(Cmd) + Enter to run
  5. The workflow outputs the mesh overlay, bounding boxes, and mask preview

Community Resources