BD MP Face Mask
Landmark-precise face masks in ~5ms with zero prompts — MediaPipe's free win
- image
- head_mask
- face_oval
- skin
- left_eye
- right_eye
- eyes
- left_brow
- right_brow
- brows
- left_iris
- right_iris
- irises
- lips
- nose
- left_ear
- right_ear
- ears
- forehead
- hair
- status
- bbox_json
BD MP Face Mask extracts per-region face masks from a single image using MediaPipe Face Landmarker landmarks - eyes, brows, lips, nose, ears, forehead, hair, the whole face, as separate masks. The headline numbers are the whole pitch: deterministic, CPU-only, roughly 5 ms per frame, no SAM3 prompts needed. If you need face region masks and you're currently typing "left eyebrow, right eyebrow" into a segmentation model, this node is dramatically cheaper - and it's a natural first stage for the pack's face pipeline.
The masks are drawn from the 468/478 landmark points rather than painted with a big blurry oval: eyebrows are enveloped from their contour, eyes use eroded eyelid regions, lips follow the organic mouth contour. That's the "shared tight drawing" the pack brags about, and it's what makes these masks usable for things like skin repainting where precision matters.
The outputs (there are a lot)
The node produces the full family: face_oval (jaw to hairline, no neck), skin (the oval minus eyes/brows/lips - your primary painting region), individual and combined left_eye/right_eye/eyes, left_brow/right_brow/brows, left_iris/right_iris/irises, lips, nose, left_ear/right_ear/ears, forehead, and hair. Note the left/right convention: "left eye" is the subject's left, which appears on the right side of a front-facing image. Plus status and bbox_json.
The inputs that matter
head_mask- the one you'll reach for most. MediaPipe's face oval can miss bald heads, full chin edges, and unusual head shapes. Wire an external head silhouette (e.g. from SAM3) and it becomes the skin base instead of the oval; MediaPipe still runs for landmarks, it just stops deciding where the head ends.feature_expand- grows eye/brow/lip regions before they're subtracted from skin. Default 4; 3–6 px covers lashes and lip borders. Too low and skin bleeds into features; too high and you carve skin away.face_expand- expands the oval itself. +4 catches jaw-edge hair strands. Negative contracts.subtract_nose- exclude the nose region from skin too, if that's what your pipeline needs.iris_expand- fills out the 4-point iris ring into the coloured disc (3–6 px reads as a natural circle).bbox_feature+bbox_frame- emits the bounding box of a chosen feature asbbox_json, for feeding box-prompted SAM3 (e.g. SAM3_Detect).
The honest limits
These are geometric masks, not semantic ones. They know where an eyebrow is; they don't know whether the pixel at that location is actually eyebrow-colored. That's why the pack layers BD MP SAM3 Face Segment on top when it needs pixel-accurate results - and if you have a stylized brow that's offset from where MediaPipe's landmarks sit, the pure landmark version will be off. For the fast, deterministic, no-GPU baseline, though, this is the node. MediaPipe is also the license-clean play here (Apache 2.0), so it's the one that survives shipping.
Installing
Same as the pack - ComfyUI Manager search "BrainDead", or clone + pip install -r requirements.txt + restart. Requires the mediapipe package; the face_landmarker.task model auto-downloads on first run. All V3 API, so keep ComfyUI current.
Reach for this as the free first pass, then decide how much precision your actual output needs before pulling in SAM3.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image or batch. Each frame processed independently. | |
| head_maskopt | MASK | Optional external head silhouette (e.g. from SAM3). When wired, this mask is used as the base for computing 'skin' instead of MediaPipe's face_oval. MediaPipe still runs for landmark detection (eyes/brows/lips/etc.) — it just doesn't determine the head boundary. Use this when MediaPipe's oval misses bald heads, full chin edges, or unusual head shapes. | |
| detection_confidenceopt | FLOAT | 0.500.1–1 | Face detection confidence threshold. |
| face_expandopt | INT | 0-30–80 | Pixels to expand (+) or contract (-) the face oval boundary. +4 helps catch jaw-edge hair strands. |
| feature_expandopt | INT | 40–40 | Pixels to expand eye/brow/lip regions before subtracting from skin. Covers lashes and lip border. 3–6 px is typical. |
| subtract_noseopt | BOOLEAN | false | When True, nose region is also excluded from skin mask. |
| iris_expandopt | INT | 40–20 | Pixels to expand iris landmark ring outward to fill the coloured disc. Iris ring is 4 points; 3-6 px gives a natural circle. 0 = tight hull only. |
| ear_expandopt | INT | 250–80 | Pixels to expand ear (preauricular) region beyond the face oval edge. |
| hair_expandopt | INT | 200–80 | Pixels to expand hair region downward into the hairline transition zone. |
| bbox_featureopt | COMBO | none | Which feature to emit as a bounding box. 'none' skips bbox computation. bbox is from frame 0 (or first detected frame). Wire bbox to SAM3_Detect bboxes for box-prompted segmentation. |
| bbox_frameopt | INT | 00–63 | Which frame index to extract the bbox from (default 0). |
Outputs (20)
| Name | Type | Description |
|---|---|---|
| face_oval | MASK | Complete face silhouette (jaw to hairline). No neck, no background. |
| skin | MASK | head_mask (if wired) or face_oval, minus eyes + brows + lips (and nose if subtract_nose). Primary skin-painting region. |
| left_eye | MASK | Left eye (subject's left = image right for front-facing). |
| right_eye | MASK | Right eye (subject's right = image left for front-facing). |
| eyes | MASK | Both eyes combined. |
| left_brow | MASK | Left eyebrow. |
| right_brow | MASK | Right eyebrow. |
| brows | MASK | Both brows combined. |
| left_iris | MASK | Left iris disc (coloured part of eye). Requires 478-point model. |
| right_iris | MASK | Right iris disc. |
| irises | MASK | Both irises combined. |
| lips | MASK | Full lip area (upper + lower, inner + outer contour). |
| nose | MASK | Nose — tip, bridge, and nostril rims. |
| left_ear | MASK | Left preauricular region (near lm 234), expanded by ear_expand. |
| right_ear | MASK | Right preauricular region (near lm 454). |
| ears | MASK | Both ears combined. |
| forehead | MASK | Upper ~40% of face_oval minus brow band. |
| hair | MASK | Region above face oval, to image top edge. |
| status | STRING | — |
| bbox_json | STRING | Tight bbox of bbox_feature from bbox_frame as JSON string {"x","y","width","height"}. "{}"when bbox_feature='none' or face not detected. Note: BOUNDING_BOX typed output is omitted — V3 dispatcher routes the dict to the wrong downstream parameter. Use bbox_json + a JSON parse node if you need a bbox socket. |