Imgutils Detect
Faces, Hands, Censors, Text, Even Booru Objects
- image
- detections
- json
Ten detectors behind one dropdown. Imgutils Detect is the front end of the whole detection story in this pack - the thing that finds the faces, hands, heads, eyes, persons, censors, text, or danbooru-tagged objects in your anime image and hands you the coordinates. Everything else in the utility layer (Bbox Crop, Bbox Mask, Bbox Unpack) exists to consume its output.
What it detects
The mode dropdown is where the real menu lives:
- Detect Faces / Hands / Heads / Eyes - the body-part detectors, your workhorses for the detail-repair loop.
- Detect Person / Detect Halfbody - full-figure and upper-body detection.
- Detect with NudeNet - anatomy detection; also what the pack's Censor node uses under the hood.
- Detect Censors - finds existing censor bars/mosaic on an image (useful for "is this image already censored" dataset queries).
- Detect Text with OCR - extracts text regions (PaddleOCR-backed).
- Detect with Booru YOLO - the interesting one: a YOLO detector trained on danbooru-tagged object categories, so it recognizes anime-specific things (wings, cat ears, tails...) that generic COCO-style detectors never learned.
How it works
Each mode routes to a different detector model inside imgutils - a YOLO-family model for body parts, NudeNet for anatomy, PaddleOCR for text, the booru-YOLO for tagged objects. The confidence input (FLOAT, default 0.5, 0–1, step 0.05) filters every detection below the threshold before output. Two outputs:
detections(STRING) - human-readable,[x1,y1,x2,y2] label (score)per item. What you'd read.json(STRING) - the structured array. What the bbox utility nodes want.
The honest take
This is the detect step of the detect → crop → re-render → paste automation loop the KB's masking-detection doc calls the highest-value automation pattern in the ecosystem - the loop that fixes bad faces and hands unattended across a whole batch. But note the format difference: this outputs JSON text, not Impact Pack's SEGS type. If you're coming from Impact Pack, the loop here is DIY - Detect → Bbox Unpack into a for-each (or Bbox Crop for the crops directly), then your own paste step. More wiring, more control, zero dependency on the Impact ecosystem.
Two practical notes. Different modes download different models on first use, each cached separately - flipping through modes the first time means several downloads. And confidence at 0.5 is a sane default; drop toward 0.3 if it's missing small faces, but expect false positives to creep in.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/xiaden/comfyui-imgutils.git
cd comfyui-imgutils
pip install -r requirements.txt
Or via ComfyUI Manager (search "imgutils"). Needs ComfyUI >= 0.25.0 and Python >= 3.10; dependency is dghs-imgutils[gpu].
Troubleshooting
Zero detections on an image you're sure has a face? Drop confidence - 0.5 can miss small or partially-occluded faces. Everything firing at once? Raise it. If a mode's first run stalls, it's the per-mode model download. And if you wired detections into a bbox utility and got nothing back, that's the string-vs-json mismatch: the utilities want the json output, not the pretty detections string.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image for object detection. | |
| mode | COMBO | Detect Faces | What to detect — faces, hands, heads, eyes, persons, nudity, censors, text, or Booru YOLO objects. |
| confidence | FLOAT | 0.500–1 | Minimum confidence threshold. Detections below this are filtered out. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| detections | STRING | — |
| json | STRING | — |