MediaPipe Face Full
The License-Clean Face Mask You've Been Missing
- image
- image
Here's the thing almost nobody realizes about MediaPipe: it's Google's Apache 2.0 face-detection and landmarking library, and in this ecosystem it's the legal escape hatch. InsightFace's models - the ones powering most face-swap and ID pipelines - are non-commercial. MediaPipe is how projects get sellable. This node puts that capability in your graph as a cloud call, and it's tuned for one specific job: imageMasking, i.e. it detects faces in an image and hands you a mask back.
That's the honest description. It's not a face-restorer, not a swap model, not an identity embedding. It detects and masks. If you're building a face-aware pipeline and you want the detection step without the licensing anchor, this is the clean version.
The inputs that matter
Required is just image - the frame or portrait you want analyzed. Then four settings, all of which reward a minute of fiddling:
- settings.confidence (default 0.5) - detection threshold. Too low and you get false positives on anything face-shaped; too high and you miss the actual faces. For clean headshots, 0.5 is a fine starting point.
- settings.maskBlur (default 5) - blur radius on mask edges. This is what makes your mask usable for compositing instead of a hard, jagged cutout. Crank it up when you're going to feed the mask into an inpaint and you want soft feathered transitions.
- settings.maskPadding (default 10) - pixels to extend (positive) or shrink (negative) the mask area. Positive padding is the classic move: you want the mask to include a bit of hair and jawline so the region you regenerate doesn't clip the face.
- settings.maxDetections (default 6) - how many faces it bothers with, highest confidence first. If your workflow only ever sees one subject, drop it to 1 and save yourself the occasional stray-detection cleanup.
The output is a single image, and it's a mask image, so it plugs straight into anything expecting a mask - an inpainting model, a background-removal composite, a face-restoration pass. (In a workflow graph, keep in mind the output is the mask itself, not the original photo.)
Why you'd reach for it
This node is the cloud answer to the local MediaPipe face-detection nodes you see in face-swap workflows. The difference is you don't need to install InsightFace, juggle its non-commercial weights, or worry about licensing at all - the call happens on Runware's side. It's also just handy for batch processing: drop in a folder of photos, and each one comes back with a consistent face mask without you writing a line of detection code.
Install and gotchas
Standard Runware pack install - ComfyUI Manager, search "Runware," install, restart:
cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt
You need a Runware API key (Settings → Runware API key or RUNWARE_API_KEY), and each call bills against your account - the node prints cost on its title bar, and it's cheap, but it adds up if you're batch-processing thousands of frames. The outputFormat dropdown (JPG/PNG/WEBP) matters here more than on generation nodes: if you're chaining masks into a pipeline, PNG keeps the mask exact; JPG at 95 will still be fine for a blur-heavy mask but can introduce compression fringing on hard edges.
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 | — |