ComfyUI Node

YOLOv8s Face

A face mask in seconds, for fix-the-face workflows without the local model

By Runware·Created 2 years ago·Updated about a month ago· 140
YOLOv8s Face
  • image
  • image
settings.confidence0.50
settings.maskBlur5
settings.maskPadding10
settings.maxDetections6
ttlfalse
ttl_value60
outputFormatJPG

Faces are where generation goes to betray you - that slightly-off mouth, the eyes that don't match - and the standard fix is to mask the face and regenerate just that region. YOLOv8s Face is the mask-making half of that fix, running on Runware's cloud. It detects faces in an image and returns a mask of them as an IMAGE, with edge controls built in. The "s" means small: a step up from nano, a step down from medium - the sweet spot for detection quality without the cost of the bigger models.

The workflow it enables is one of the oldest and most reliable in the ecosystem: detect the face, mask it, inpaint it with the rest of the image locked down. Locally that means installing a face-detection model and wiring up the segmentation plumbing; here it's a single node with one image input. If you've already got a mask-based inpainting setup and just needed a reliable face detector that doesn't live on your GPU, this drops straight in.

How it works

An imageMasking task on Runware's cloud (runware:35@2): the node uploads your image via the SDK, sends the request over REST, and downloads the resulting mask into an IMAGE tensor. All the real controls shape that mask:

  • settings.confidence (0.5) - only faces above this score get masked. Lower for smaller/angled faces, but you'll also catch false positives.
  • settings.maskBlur (5) - edge smoothing, so the mask composites without a harsh cut line.
  • settings.maskPadding (10) - extend the mask by pixels. For face inpainting you usually want padding - regenerate a little context around the face, not just the skin.
  • settings.maxDetections (6) - cap on faces masked, highest confidence first.

Output is image (IMAGE) - feed it into your mask-based inpaint/restoration workflow.

The inputs that matter

Required input: image. For a typical face-fix pass, start at confidence 0.5, maskPadding +10, maskBlur 5. Group photos will hit the maxDetections cap - bump it if you're processing a crowd, but remember every detection adds compute (and cost).

Install and API key

Install once for the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt

Restart ComfyUI (or install Runware from ComfyUI Manager). API key from runware.ai/api-keys, set in ComfyUI Settings → Runware API key, exported as RUNWARE_API_KEY, or via runware auth login.

Gotchas

Profile shots and heavily angled faces are where the small model wobbles - if a face isn't detected, drop confidence before you blame the image. The mask is per-detection composited, so overlapping faces can merge into one blob; maskPadding down helps there. And the usual metered-API reminder: each image is a paid call, and unlike running YOLO locally (where the model is free and your GPU does the work), this costs per mask. If you're batch-processing hundreds of faces, the local route eventually wins on price - this node is for the occasional fix or when you don't have the local stack. The output is a mask image, so confirm your inpaint node consumes IMAGE masks the way it expects.

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