YOLOv8n Person Seg
Person silhouettes as masks, no local segmentation stack
- image
- image
When you need a person cut out of an image - not just a box around them, but an actual silhouette - YOLOv8n Person Seg is the node. It's the nano Ultralytics person-segmentation model running on Runware's cloud, and it returns the detected people as a mask IMAGE with edge controls. The "nano" part means it's the fast, cheap tier: good enough for compositing and mask-based editing, not the highest-fidelity segmentation on earth.
The use case triangle it serves is the one the ecosystem keeps circling: background replacement (person mask → new background), selective inpainting (mask the person, regenerate everything else), and subject isolation for further processing. Locally, person segmentation means installing a segmentation model plus its plumbing; here it's one node with one image input and a mask out. If you just need "give me the people as masks," this is the shortest path in the pack.
How it works
An imageMasking task on Runware's cloud (runware:35@4): upload the image via the SDK, request over REST, and the resulting segmentation mask downloads into an IMAGE tensor. The settings shape the mask quality:
- settings.confidence (0.5) - detection threshold for people.
- settings.maskBlur (5) - edge-smoothing radius; a little blur hides the cut-out seam when you composite.
- settings.maskPadding (10) - extend or shrink the mask by pixels. For cutting out a person you often want slight positive padding so no hair or clothing edge gets clipped.
- settings.maxDetections (6) - cap on people masked, highest confidence first.
Output is image (IMAGE) - feed it into compositing, background-removal, or mask-based inpaint workflows.
The inputs that matter
Required input: image. For a clean cut-out: confidence 0.5, maskPadding +10, maskBlur 5, then composite. Crowd shots hit the maxDetections cap; raise it if you're segmenting a group.
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
Nano-tier segmentation has known weak spots: flyaway hair, thin clothing edges, and people overlapping each other. For those cases the honest advice is that dedicated background-removal models (BiRefNet and friends) are usually better at hair than any YOLO segmentation, so if your goal is a clean person cut-out with hair intact, that's a different node than this one - this node is for "person mask, fast and cheap." Overlapping people also merge into one blob; raise confidence or separate subjects. And the cost reality: YOLO is open source and free to run locally, so on a big batch the per-image cloud price will eventually make you install it locally - this node is for the occasional mask or when you're already paying for the cloud stack.
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 | — |