Nodes/ComfyUI Inspire Pack/MediaPipeFaceMesh Detector Provider
ComfyUI Node Runs on cloud

MediaPipeFaceMesh Detector Provider

A face-part detector for Impact Pack

By ltdrdata·Created 3 years ago·Updated 9 months ago· 805
MediaPipeFaceMesh Detector Provider
    • BBOX_DETECTOR
    • SEGM_DETECTOR
    max_faces10
    facetrue
    mouthfalse
    left_eyebrowfalse
    left_eyefalse
    left_pupilfalse
    right_eyebrowfalse
    right_eyefalse
    right_pupilfalse

    Impact Pack's whole detailing loop starts with a detector: something that finds a region, so the pack can crop it, resample it, and paste it back. Most people reach for a YOLO detector (the bbox/face_yolov8 kind). This node is a different flavor - it uses Google's MediaPipe FaceMesh to find faces and individual facial parts, and hands the result to Impact Pack as a proper detector you can drop into a Detailer or a SAM node.

    The reason you'd pick it over YOLO: granularity. FaceMesh doesn't just box the face. It can isolate the mouth, each eye, each eyebrow, the pupils. So if you want to detail just the eyes - a common fix, since eyes are where small-face generation falls apart worst - this detector can hand you exactly those regions instead of the whole face. It's the precise-scalpel option next to YOLO's reliable-hammer.

    How it works

    The node builds two detector objects and outputs them: a BBOX_DETECTOR and a SEGM_DETECTOR. These are the same detector types Impact Pack's own detectors produce, so they plug straight into the pack's detection nodes - BBOX Detector (SEGS), SAMDetector, FaceDetailer, and friends. Under the hood it runs MediaPipe FaceMesh (via ComfyUI's ControlNet Auxiliary Preprocessors) to find landmarks, then converts the parts you enabled into bounding boxes and segmentation masks. Enable "mouth" and the detector will return mouth regions; enable "left_eye" and it returns left eyes. It's a detector factory configured by checkboxes.

    The inputs that matter

    • max_faces (default 10) - cap on how many faces to detect in a frame. Fine as-is unless you're doing crowds.
    • The part toggles - face (default on), plus mouth, left_eyebrow, left_eye, left_pupil, right_eyebrow, right_eye, right_pupil (all default off). This is the real control surface. Leave face on for whole-face detailing. Turn on just left_eye and right_eye when you specifically want an eye-only detail pass. Mix and match for whatever region you're targeting.

    Two outputs: BBOX_DETECTOR and SEGM_DETECTOR, both feeding Impact Pack detection nodes.

    Installing it

    Part of the Inspire Pack by Dr.Lt.Data - who you already trust if you run ComfyUI Manager or Impact Pack, since he wrote both. Via ComfyUI Manager: search ComfyUI Inspire Pack, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
    

    then restart. You need two other packs: ComfyUI's ControlNet Auxiliary Preprocessors, which supplies the actual MediaPipe FaceMesh preprocessor this wraps, and the Impact Pack, since the BBOX_DETECTOR and SEGM_DETECTOR outputs only make sense feeding Impact Pack's detection nodes.

    Common issues

    It errors, or the node is red on load. The pack's own changelog flags this one directly: the MediaPipe detector broke with old versions of ControlNet Auxiliary Preprocessors. If you hit compatibility errors, update comfyui_controlnet_aux to a current version - that's the documented fix.

    No faces detected. FaceMesh wants a reasonably visible face. On tiny, blurry, or heavily-stylized faces it can come up empty where a YOLO face detector would still fire. If you're detailing small faces in a wide shot, a YOLO bbox detector may be the more reliable first pass.

    I enabled a part but got nothing back. Double-check the toggle actually matches what's in frame - if you turn on only mouth and the subject's mouth is occluded, there's nothing to return. Keep face on as a fallback while you dial in the part-specific toggles.

    Nodes won't load after install. Read the terminal log. It's the standard Inspire Pack failure mode and usually a version mismatch - update Inspire Pack and Impact Pack together and restart.

    CategoryInspirePack/Detector

    Inputs (9)

    NameTypeDefaultDescription
    max_facesINT101–50
    faceBOOLEANtrue
    mouthBOOLEANfalse
    left_eyebrowBOOLEANfalse
    left_eyeBOOLEANfalse
    left_pupilBOOLEANfalse
    right_eyebrowBOOLEANfalse
    right_eyeBOOLEANfalse
    right_pupilBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    BBOX_DETECTORBBOX_DETECTOR
    SEGM_DETECTORSEGM_DETECTOR