MediaPipe Eyes + Lips Mesh
A cloud mask maker for the face-fix pipeline
- image
- image
When a generated face comes back with melted eyes or a mouth that isn't a mouth, the fix is almost always the same: mask the bad region and inpaint over it. Getting that mask is the annoying part - you can paint it by hand, or you can let MediaPipe find the face, landmark the eyes and lips, and hand you a clean region to work with. This node does the second thing, in the cloud.
It runs Google's MediaPipe face landmarking as a Runware image task and returns the result as an IMAGE tensor - a mask of the eyes and lips it detected. MediaPipe is the Apache-2.0, commercially-clean landmarking library the community already reaches for when InsightFace's licensing gets in the way, and here you don't even install it: the pack ships the request to Runware and you get the mask back.
How it works
The node sends the input image with an imageMasking task to Runware's API, MediaPipe finds faces and meshes the eyes and lips, and the returned mask comes back as an IMAGE output. The settings are the parts you'd tune on any detection:
settings.confidence- 0.5 default. Detections below this score get dropped; raise it if you're picking up false faces.settings.maskBlur- 5. Blur radius on mask edges, for smooth transitions so the inpaint doesn't leave a hard seam.settings.maskPadding- 10. Extends (positive) or shrinks (negative) the mask area in pixels. Bump it up when eyes are right at the edge of the mask.settings.maxDetections- 6. Caps how many faces to process, keeping the highest-confidence ones if exceeded.
The output and where it goes
One image socket, type IMAGE, carrying the mask. Wire it into an inpaint workflow - the classic move is: original image + this mask → inpaint model, prompt "fix eyes and mouth," and you've rescued the render instead of restarting it. In a batch of faces it's the difference between manually masking twenty portraits and running them all through one graph.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt
Restart, and set your key via ComfyUI Settings → Runware API key, RUNWARE_API_KEY, or runware auth login. No local MediaPipe install - that's the point of a cloud node.
Where people get burned
Expecting landmarks, not a mask. MediaPipe returns a huge amount of face data, but this node's job is the mask for the eyes and lips region, so don't look for individual landmark coordinates - you won't find them here. Also, its confidence model is tuned for real faces; stylized or heavily deformed faces may detect poorly or not at all, which is a MediaPipe characteristic, not a bug. And if the mask feels too tight or too loose, reach for maskPadding before you touch anything else - it's the control that fixes 90% of fit problems.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| settings.confidenceopt | FLOAT | 0.500–1 | Confidence threshold for detections. Only detections above this score are included. |
| settings.maskBluropt | INT | 50–100 | Blur radius for mask edges, creating smooth transitions. |
| settings.maskPaddingopt | INT | 100–200 | Pixel amount to extend (positive) or shrink (negative) the mask area. |
| settings.maxDetectionsopt | INT | 61–20 | Maximum number of detections. Prioritizes highest confidence scores if exceeded. |
| ttlopt | BOOLEAN | false | Enable to set ttl. Off uses the model's default. |
| ttl_valueopt | INT | 60 | Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`. |
| outputFormatopt | COMBO | JPG | File format for the generated image. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |