MediaPipe Nose + Lips Mesh
Nose + lips in one mask, for the middle of the face
- image
- image
Nose and mouth are the two features that anchor a portrait's lower half, and when one of them is off, fixing the pair together beats fixing them apart. This node hands you a single fused mask of both regions, computed by MediaPipe on Runware's cloud, so your inpaint can rework the nose and lips as one coherent shape instead of two patched halves.
How it works
It's an imageMasking task in the Runware pack. Your image is uploaded, face-mesh landmarks locate the nose and mouth, and you get back one image mask covering both. No local model, no weights download - the mask is computed server-side and returned as a grayscale IMAGE tensor.
From there it's the standard mask → inpaint flow: convert the IMAGE mask to MASK with core ImageToMask for a sampler, or wire it into a Runware inpaint node that takes IMAGE masks directly. Because the edit region is pinned, everything outside the nose and lips stays bit-identical - the guarantee masked inpainting still uniquely offers in the era of whole-image edit models.
Settings that matter
The four shared MediaPipe widgets:
settings.confidence(default 0.5) - detection threshold. Bump it down if features get missed in profile shots.settings.maskBlur(default 5) - edge feathering. The nose meets the cheeks at a subtle gradient, so keep blur moderate or you'll get a soft "smudged" boundary.settings.maskPadding(default 10) - extend/shrink the region. Going negative tightens the mask around the nose and mouth specifically.settings.maxDetections(default 6) - max faces in a batch.
ttl, ttl_value, and outputFormat are shared pack plumbing - ignore them.
Install
Install the whole pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt
Restart ComfyUI, or use ComfyUI Manager → search "Runware" → install. The deps are just runware-sdk, pillow, and soundfile; the model itself lives in the cloud. Add a Runware API key from the dashboard via Settings → Runware API key, the RUNWARE_API_KEY env var, or runware auth login.
Gotchas
Each run costs a little and depends on the network - the node's title bar shows the per-run cost and a NSFW flag after content checks. And the recurring trip-up: the output is a mask image, so convert to MASK before plugging into a standard sampler. One feature, not a bug: the combined region means both nose and lips regenerate together, which is exactly what you want when fixing a profile where they're read as one silhouette.
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 | — |