ComfyUI Node

YOLOv8n Hand

Cloud hand detection that hands you a mask, not a bounding box

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

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.

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