Auto Crop Faces
Find every face in an image and crop them out cleanly
- image
- face
- CROP_DATA
This node does one thing and does it well: it finds faces in an image and crops them out. That's it - no inpainting, no resampling, no identity swapping. If you've used Impact Pack's FaceDetailer or ADetailer, this is the "detect and crop" half of that pipeline with the "fix it and paste it back" half left for you to build yourself. That sounds like a downgrade until you realize it's actually a feature: you get a plain face crop to feed into anything - an upscaler, a face-swap node, a fresh sampling pass at higher denoise, a LoRA training set - instead of being locked into one detailer's opinion of how faces should be fixed.
How it works
Under the hood it's RetinaFace, a single-stage face detector forked from biubug6/Pytorch_Retinaface. RetinaFace finds bounding boxes (and facial landmarks, though this node just uses the boxes) in one forward pass, which is why it's fast and doesn't need the heavier setup that identity tools carry. Worth knowing if you've fought with InsightFace before: this node doesn't touch it. No ArcFace embeddings, no non-commercial model-weight license to worry about, no C++ build headaches - it's purely "where is the face," not "whose face is it." That makes it a much lighter, friendlier dependency than anything doing face swapping or FaceID-style conditioning.
The inputs and outputs that matter
- image - whatever you're scanning for faces.
- number_of_faces (default 5) - how many face crops you want out of this run. If your image has three faces and you ask for five, you'll get wraparound behavior (see below), not an error.
- start_index (default 0) - which detected face to start from. Detected faces form a list; if you only want the second face in a group photo, set this to 1. Go out of bounds and it wraps around circularly, Python-list style, rather than crashing.
- scale_factor (default 1.5) - padding around the detected face box. 1.0 is a tight crop right at the face; higher values pull in more of the surrounding head/shoulders, which matters if you're about to inpaint or upscale that crop and don't want a hard seam right at the jawline.
- shift_factor (default 0.45) - where the face sits vertically in the output crop: 0 pins it to the top edge, 0.5 centers it, 1.0 pins it to the bottom. Left at default it's slightly above center, which tends to look natural for portrait-style crops.
- aspect_ratio (default 1:1) - pick from the standard set (16:9, 9:16, 3:4, 4:3, and so on) to match whatever you're feeding the crop into.
- max_faces_per_image (default 50) - an upper cap on how many faces the detector will even look for before
number_of_facesandstart_indexpick from that list. Most people never touch this; it only matters on genuinely crowded images.
Outputs are face (the cropped IMAGE) and CROP_DATA, which is the real reason this node is more useful than it looks. CROP_DATA carries the position info needed to paste your (possibly modified) crop back into the original image later - it's explicitly built to be compatible with WAS Node Suite's paste-back nodes. That's the intended loop: crop the face out with this node, do your fix or swap on the isolated crop, then use CROP_DATA downstream to composite it back exactly where it came from.
One thing to remember: this node isn't an output node itself, so wire face into a Preview Image (or wherever you're sending it) - nothing shows up on its own if you leave it dangling.
Installing it
Easiest path is ComfyUI Manager: search ComfyUI-AutoCropFaces, install, restart. Manually, it's the usual: cd ComfyUI/custom_nodes && git clone https://github.com/liusida/ComfyUI-AutoCropFaces, then restart ComfyUI. No separate model download step is called out in the docs - the RetinaFace weights ship with the pack, so there's nothing extra to fetch before it runs.
Common issues
The README itself flags the big one: if users are uploading large images, detection (and everything downstream) gets slower and blurrier at the edges of what the model can handle, so the recommendation is to run the image through pythongosssss's "Constrain Image" node (from ComfyUI-Custom-Scripts) first to cap the resolution before it hits AutoCropFaces.
It's also strictly a human face detector - RetinaFace was trained on human faces, so don't expect it to find faces on stylized characters, animals, or illustrated figures; that's a real limitation people run into, not a hypothetical one. If you're after that kind of detection, you're better off with a general-purpose YOLO detector from Impact Pack instead.
And double-check number_of_faces against how many faces are actually in your image - if you request more than exist, the circular wraparound on start_index means you'll get duplicate crops of faces you already detected rather than blanks, which can be confusing the first time you see five outputs from a two-person photo.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| number_of_faces | INT | 51–100 | — |
| scale_factor | FLOAT | 1.50.5–10 | — |
| shift_factor | FLOAT | 0.450–1 | — |
| start_index | INT | 0 | — |
| max_faces_per_image | INT | 501–1000 | — |
| aspect_ratio | COMBO | 1:1 | 9 options: 9:16, 2:3, 3:4, 4:5, 1:1, 5:4, +3 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| face | IMAGE | — |
| CROP_DATA | CROP_DATA | — |