Nodes/comfyui-magic-hour/Magic Hour: Face Detection
ComfyUI Node

Magic Hour: Face Detection

The one node here that spends credits telling you where a face is

By magichourhq·Created about 16 hours ago·Updated about 15 hours ago· 0
Magic Hour: Face Detection
  • image
  • json
◄confidence_score0.00►

Face Detection is the odd one out in this pack, and the oddness is instructive. Every other node hands you media back. This one uploads your image, asks a server where the faces are, and returns JSON as text. Nothing typed. Nothing you can wire anywhere.

Is that a scam? No, but be clear-eyed

Face detection locally is a solved, free, instant problem. MediaPipe, InsightFace, the face detectors bundled in the impact pack and in a dozen ADetailer-adjacent nodes - all of it runs in milliseconds on your own machine and produces bounding boxes you can feed straight into a mask. The KB's masking-and-detection doc treats detection as plumbing you already have, not a capability you need to buy.

What you're paying for here is not accuracy. It's the format: Magic Hour's own result payload, which is what you need if you're matching an existing system, checking what their pipeline sees, or debugging a mismatch between the boxes Magic Hour's tools assume and the ones your local detector produces. That's a narrow but legitimate reason to exist.

If you just want boxes to crop a face with - do it locally. Spending credits per inference on something your CPU does for free is silly, and this is the article where I'll say so plainly.

How it works

The image is written to a temp PNG, uploaded as the target asset, and the remote detector runs on it. The node then serialises the entire response object to indented JSON and returns that as a string.

One structural detail from the source that has real consequences: this is the only node in the pack that doesn't send a name field with the request, because the underlying SDK call doesn't accept one. Also, because it returns data rather than files, it has no credits_charged output - you cannot see what the run cost from inside the graph. Check your account if that matters to you.

Inputs and outputs

Required image - your photo. As with every image input in this pack, only the first image of a batch is uploaded, so a batch of ten frames gets you one detection result.

confidence_score is a float from 0 to 1, default 0, and the tooltip is the honest answer to what that means: 0 = API default. Zero isn't "accept anything", it's "don't override the server's threshold". Bump it toward 0.8+ when you only care about unambiguous, near-frontal faces and want the marginal hits gone. Drop it toward 0.2 when you're hunting for a face in a crowded or badly lit frame and would rather sort false positives yourself.

The single output is json, a STRING. Wire it into a Show Text or Note node to read it. There is no IMAGE, no mask, no list output - you're parsing text, and whatever you do with the coordinates is your business.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/magichourhq/comfyui-magic-hour
pip install -r comfyui-magic-hour/requirements.txt

Restart ComfyUI and look under Magic Hour. The only dependency is magic-hour>=0.87.1, and there's nothing to download into models/. Manager users can search "Magic Hour".

export MAGIC_HOUR_API_KEY=your_key_here

before starting ComfyUI, or a bare key in comfyui-magic-hour/api_key.txt. Not a wizard field, not a widget - the pack's design is that keys never live inside a workflow file.

The rougher edges

You can't feed it anywhere. People wire json into a node expecting a bounding box type and get a type mismatch. It's a string; parse it with string handling or a script node.

Nothing to inspect on cost. No credits_charged output, as noted. Image jobs are cheap individually, but a loop over a thousand images is not, and the graph won't warn you.

Batch confusion. A batch input doesn't produce a batch of results. Frame zero only.

The pause. Small, but real - it's a network round trip with polling, against a local detector's instant answer.

Use it to inspect, not to build. If you find yourself running it inside a per-frame loop, that's the signal to swap in a local detector and keep the credits for something that actually needs a GPU you don't own.

CategoryMagic Hour

Inputs (2)

NameTypeDefaultDescription
imageIMAGE—
confidence_scoreFLOAT0.000–10 = API default

Outputs (1)

NameTypeDescription
jsonSTRING—