Face Bounding Box
The detect-and-crop half of FaceDetailer, on its own
- analysis_models
- image
- IMAGE
- x
- y
- width
- height
If you've used Impact Pack's FaceDetailer, you already know the detect-crop-refine loop: find the face, crop it, resample it at higher effective resolution, paste it back. FaceDetailer bundles all of that into one node and hides the middle steps from you. Face Bounding Box only does the first half - detect and crop - and hands you the raw box coordinates instead of doing anything else with them. That's the tradeoff: less convenience, more control over what happens next.
Where it fits
Reach for this when you want to build your own version of that pipeline instead of trusting FaceDetailer's built-in resample-and-paste, or when you don't want a full detail pass at all - you just need the face isolated for something else, like feeding it into FaceEmbedDistance for a similarity check, or into a completely custom mask-and-composite chain. It's also handy for straightforward "crop every face in this batch out into its own image" jobs that don't need any generative work at all.
The inputs and what they do
- analysis_models (
ANALYSIS_MODELS) - from Face Analysis Models, same as every other node here. - image (
IMAGE) - the source image (or batch) to detect faces in. - padding (INT, default 0) and padding_percent (FLOAT, default 0, max 2) - how much extra margin to add around the detected box. Padding is a fixed pixel amount; padding_percent scales with the face size instead, which behaves more sensibly across a batch of faces at different distances from camera. Use one or the other rather than stacking both, or you'll end up over-padding without meaning to.
- index (INT, default -1) - which detected face to return. Leave it at -1 and you get every face found, as a list; set it to 0, 1, 2… to grab a specific one when there are multiple people in frame and you only care about one of them.
The outputs
Everything comes back as a list, matching however many faces were found: IMAGE (the cropped face images), plus x, y, width, and height as separate INT lists. That last part is the whole point of using this node over something more automated - you get the actual box math, so you can feed it into a Composite node later and paste a processed face back into its exact original position, without the crop-and-paste logic being locked inside a black-box node.
Installing it
- ComfyUI Manager - search "Face Analysis for ComfyUI", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_FaceAnalysis, restart.
No extra downloads for this node itself beyond whatever backend (InsightFace, AuraFace, or Dlib) you set up in Face Analysis Models.
Common issues
The main gotcha is the list output - if zero faces are detected, you get an empty list, and anything downstream expecting a fixed-size batch will error out or silently do nothing. Worth adding a check (or at least previewing the output) before wiring this deep into an automated pipeline. index set past the number of faces actually found is the other easy mistake - if you're hardcoding index: 1 expecting a second face and the image only has one person in it, you'll get an out-of-range failure rather than a graceful fallback. If your crops look tighter or looser than expected, that's almost always a padding setting, not a detector problem - try padding_percent instead of raw padding if faces vary in size across your batch. And compared to FaceDetailer's rectangular crop-and-paste, remember this node gives you only a rectangle - if you need a face-shaped mask rather than a box (say, to avoid inpainting background inside the crop), that's Face Segmentation's job, not this one.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| analysis_models | ANALYSIS_MODELS | — | |
| image | IMAGE | — | |
| padding | INT | 00–4096 | — |
| padding_percent | FLOAT | 0.000–2 | — |
| index | INT | -1-1–4096 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| x | INT | — |
| y | INT | — |
| width | INT | — |
| height | INT | — |