YOLOv8n Hand
Cloud hand detection that hands you a mask, not a bounding box
- image
- image
If you've ever generated a gorgeous image and then spotted the hands, you know the exact problem this node is for. YOLOv8n Hand runs a hand-detection model on an image and returns a mask of the hands as an IMAGE - the thing you feed into an inpainting node to fix them in place. It's the "n" in the name that tells you what tier you're on: YOLOv8 nano, the smallest and fastest Ultralytics detection model. Fast and cheap, at the cost of a little precision. For "find the hands so I can regenerate them," that's the right trade.
The clever bit is that it returns a mask, not detections. Classic YOLO gives you boxes; this node converts the detections into a usable mask image with edge controls, so the output drops straight into the mask-based workflows the ecosystem already knows. You're not paying for a custom detection pipeline - you're paying for the last step of one, pre-wired for ComfyUI.
How it works
Standard pack machinery under the hood: this is an imageMasking task on Runware's cloud. The node (runware:35@3) uploads your image through the SDK, sends the request over REST, and downloads the result - a mask image - into an IMAGE tensor. The settings are all about shaping that mask:
- settings.confidence (0.5) - detection threshold; only hands above this score make the mask. Lower = catch more (and more false positives).
- settings.maskBlur (5) - edge-smoothing radius. Blur helps the mask composite cleanly instead of having a hard cutout.
- settings.maskPadding (10) - extend (positive) or shrink (negative) the mask by pixels. Hands usually want a little padding so you regenerate slightly more than the strict detection.
- settings.maxDetections (6) - cap on hands detected, highest confidence first. A crowd of hands gets truncated here.
Output is image (IMAGE) - wire it into a mask/segmentation-compatible inpaint workflow, or use it as a map for editing.
The inputs that matter
The one required input is image - anything from Load Image or a generation node. For a typical fix-the-hands pass: confidence 0.5, maskPadding +10, maskBlur 5, and let it rip. If the mask misses a hand, drop confidence a notch; if it's grabbing background, raise it.
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
The nano model is fast, not perfect - small hands, partially occluded hands, and hands near the frame edge are where it drops or double-counts. If the mask is rough, that's the model tier, not your wiring; the fix is more maskPadding/maskBlur, or patience. And note this is a metered cloud call per run, so don't loop it on a batch of 100 images without checking one first. The output is a mask image, so make sure the node you feed it into actually consumes masks - some inpainting setups want a MASK, and a gray-scale IMAGE sometimes needs converting depending on your workflow.
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 | — |