ComfyUI Node
BD MP Face Mask
Extracts per-region face masks via MediaPipe Face Landmarker landmarks. Deterministic, CPU-only, ~5 ms per frame. No SAM3 prompts needed. Outputs face_oval, skin (face minus eyes/brows/lips), individual feature masks (eye, brow, lips, nose, ear, forehead, hair).
BD MP Face Mask
- 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
◄detection_confidence0.50►
◄face_expand0►
◄feature_expand4►
◄subtract_nosefalse►
◄iris_expand4►
◄ear_expand25►
◄hair_expand20►
◄bbox_featurenone►
◄bbox_frame0►
Category🧠BrainDead/Segmentation
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. |