DetectFaces
The face-finder that knows which way a face is pointing
- image
- mask
- faces
If you've ever watched Impact Pack's FaceDetailer turn a big face into a waxy mess - or quietly destroy a LoRA's resemblance - this is the pack that gives you the same detect-and-refine loop with your hands on every dial. DetectFaces is step one of that loop, and it does something FaceDetailer's detector can't: it figures out which way the face is pointing, not just where it is.
What it produces is a FACE object, not an image. That object carries the bounding box, the detected size, and - crucially - the rotation that makes the rest of this pack work. Feed its output into CropFaces and every face comes out of the crop upright, so a sideways or even upside-down head gets a proper detail pass instead of a squinty approximation. People in the wild literally use this pack for that one trick: rotate the face upright, detail it, rotate it back.
How it works
The pack dropped InsightFace entirely back in 2024 (the README's patch notes say so, and the code confirms it - no insightface import anywhere). Detection is now YOLO via face_yolov8m.pt, run through Ultralytics, and that's just the first pass. For each box, the node runs a landmark model (fan2_68_landmark.onnx from the FaceAlignment repo) on the crop rotated at 0/90/180/270 degrees and keeps whichever rotation scores best. That's the "rotation aware" in the pack's description, and it's why the downstream crop comes out aligned to the face, not to the image.
The threshold float (default 0.5) is the YOLO confidence cutoff - lower it toward 0.3 if it's missing faces, nudge it up if you're getting false positives from backgrounds that look vaguely face-shaped. min_size and max_size filter detections by pixel dimension; a face passes if either its height or width is within range, so you can say "ignore anything under 64px" and stop tiny background heads from triggering a detail pass that does nothing useful.
The one input people forget is mask. Feed it a mask and the node multiplies the image by it before detection, so it only looks for faces inside your masked region. Genuinely handy when you want to detail one face in a group shot and leave the rest alone - same idea as a region-restricted FaceDetailer, but explicit.
Install
In ComfyUI Manager, search comfyui_facetools (or just "facetools"). Or, manually:
cd ComfyUI/custom_nodes
git clone https://github.com/dchatel/comfyui_facetools
Restart ComfyUI after either. You'll also need the models. The README documents the landmark model:
# fan2_68_landmark.onnx from bluefoxcreation/FaceAlignment
# → ComfyUI/models/landmarks/
One trap: the README never mentions the YOLO weights, but the source hardcodes face_yolov8m.pt from ComfyUI/models/ultralytics/bbox/. If you get a missing-file error, that's it - drop face_yolov8m.pt there. And because the pack ships no requirements.txt, you're responsible for ultralytics, onnxruntime, opencv-python, mediapipe, scipy and scikit-image yourself if they're not already in your ComfyUI env. If you run Impact Pack you likely already have the Ultralytics ones.
When to reach for it
Honestly: when FaceDetailer's one-button convenience isn't cutting it and you want the underlying mechanism - detect, crop, resample, paste back - under your control. That's the loop the whole ecosystem runs on (ADetailer in A1111, FaceDetailer in ComfyUI, the same idea everywhere). This node just hands you the first two steps with the rotation handling that the one-button versions shrug at. It's more setup, and it's worth it exactly when you care about a specific face surviving a high-denoise pass.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold | FLOAT | 0.500–1 | — |
| min_size | INT | 64 | — |
| max_size | INT | 512 | — |
| maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| faces | FACE | — |