MediaPipe FaceMesh to SEGS
Detail just the eyes, or just the mouth, not the whole face
- image
- SEGS
A regular face detector gives you one box: "here's a face." Sometimes that's too blunt. You want to fix the eyes specifically, or clean up the mouth, without re-rendering the whole face and risking it drifting into someone else. MediaPipe FaceMesh to SEGS gives you that granularity. It takes a MediaPipe face-mesh image and splits it into labeled SEGS per facial landmark - face, mouth, eyebrows, eyes, pupils - so you can send just the parts you want into a detailer.
MediaPipe itself is Google's on-device landmarking library. In this ecosystem it usually matters for being Apache-2.0 and licence-clean, but here its job is narrower and simpler: it's the thing that locates the facial features precisely enough to carve them into separate regions.
How it works
Upstream, you run a MediaPipe FaceMesh preprocessor (from a ControlNet auxiliary preprocessor pack) on your image - that produces the mesh image, the tangle of green lines mapping the face. This node reads that mesh and, for each landmark group you've enabled, produces a SEG covering it. So with only left_eye and right_eye switched on, you get two eye regions and nothing else, ready to hand to a detailer for an eyes-only pass.
The inputs and outputs that matter
image(IMAGE) - the MediaPipe face-mesh image, not your original render. This is the one people wire wrong; it wants the preprocessor's mesh output.- The landmark toggles -
face,mouth,left_eyebrow,left_eye,left_pupil,right_eyebrow,right_eye,right_pupil. Turn on the parts you want as regions.faceis on by default; switch it off and enable, say, both eyes to target only those. crop_factor(default 3) - context around each landmark crop, same meaning as elsewhere in the pack.dilation(default 0) - grow or shrink each landmark region; negative erodes.crop_min_size(default 50) anddrop_size(default 1) - floor sizes so tiny landmark regions don't produce unusable crops.
The single output is SEGS, labeled per landmark, which you send to a Detailer or a SEGS filter.
How to install it
Install the pack via ComfyUI Manager (search ComfyUI Impact Pack, Install, restart) or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack
cd ComfyUI-Impact-Pack
pip install -r requirements.txt
Run the pip in ComfyUI's Python environment and restart. The extra piece: this node only converts a mesh, it doesn't make one. You need a ControlNet auxiliary preprocessor pack installed to generate the MediaPipe FaceMesh image in the first place (the mediapipe Python library rides along with that). Install that from the Manager if you don't have it.
Common issues & troubleshooting
Empty or wrong SEGS. Almost always the wrong input image - you fed it the original photo instead of the face-mesh preprocessor output. This node wants the mesh, not the render.
Version mismatch with the preprocessor. The Impact Pack README flags that this node isn't compatible with old versions of the ControlNet auxiliary preprocessor; if it errors right after install, update the preprocessor pack to a current build.
The whole face got detailed when you only wanted eyes. The face toggle is on by default. Turn it off and enable only the specific landmarks you want, or your "eyes only" pass quietly includes the entire face region too.
Landmark regions are tiny and the fix looks pasted. Pupils and eyes are small; bump crop_factor so each crop carries enough surrounding skin to blend back cleanly, and keep the downstream detailer's denoise low.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| crop_factor | FLOAT | 3.01–100 | — |
| bbox_fill | BOOLEAN | false | — |
| crop_min_size | INT | 5010–16384 | — |
| drop_size | INT | 11–16384 | — |
| dilation | INT | 0-512–512 | — |
| face | BOOLEAN | true | — |
| mouth | BOOLEAN | false | — |
| left_eyebrow | BOOLEAN | false | — |
| left_eye | BOOLEAN | false | — |
| left_pupil | BOOLEAN | false | — |
| right_eyebrow | BOOLEAN | false | — |
| right_eye | BOOLEAN | false | — |
| right_pupil | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SEGS | SEGS | — |