ComfyUI Node

MediaPipe Nose + Lips Mesh

Nose + lips in one mask, for the middle of the face

By Runware·Created 2 years ago·Updated about a month ago· 140
MediaPipe Nose + Lips Mesh
  • image
  • image
settings.confidence0.50
settings.maskBlur5
settings.maskPadding10
settings.maxDetections6
ttlfalse
ttl_value60
outputFormatJPG

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.

CategoryRunware/Image/runware

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
settings.confidenceoptFLOAT0.500–1Confidence threshold for detections. Only detections above this score are included.
settings.maskBluroptINT50–100Blur radius for mask edges, creating smooth transitions.
settings.maskPaddingoptINT100–200Pixel amount to extend (positive) or shrink (negative) the mask area.
settings.maxDetectionsoptINT61–20Maximum number of detections. Prioritizes highest confidence scores if exceeded.
ttloptBOOLEANfalseEnable to set ttl. Off uses the model's default.
ttl_valueoptINT60Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.
outputFormatoptCOMBOJPGFile format for the generated image.

Outputs (1)

NameTypeDescription
imageIMAGE