Face Align
Straighten a face out before you measure or train on it
- analysis_models
- image_from
- image_to
- IMAGE
Face Align is the smallest, dumbest-looking node in the pack, and also the one that quietly fixes the most annoying problem: face embeddings and landmark models are picky about pose. A slightly tilted head, a face that's a bit off-center, a photo taken at a weird angle - all of that adds noise to whatever a downstream node tries to do with the face, whether that's a similarity score or a training crop. Face Align exists to straighten that out before anything else touches the image.
Why this matters
This is standard practice in face recognition, not something cubiq invented - detect the face, find its landmarks, then rotate/scale/crop it into a consistent, canonical framing where the eyes sit level and the face fills a predictable portion of the frame. Models like the ArcFace embedding this pack's InsightFace backend uses were trained on aligned faces, so feeding them a crooked or off-center face is asking for a worse embedding than the source photo deserves. If you've ever gotten an oddly high "distance" score out of FaceEmbedDistance and the two photos looked like the same person to your own eyes, an alignment mismatch is a common suspect - align both images first and the number tends to get more honest.
It's also the right prep step if you're building a small dataset for LoRA training or for the pack's own "average three reference photos" evaluation trick from the README: consistent framing across your reference set matters more than people expect.
The inputs - there are only two
- analysis_models (
ANALYSIS_MODELS) - the loader from Face Analysis Models. Whichever library you picked there (insightface, auraface, or dlib) does the landmark detection here. - image_from (
IMAGE, required) - the face you want aligned. - image_to (
IMAGE, optional) - if you provide this, Face Align doesn't align to a generic canonical pose; it alignsimage_from's face to matchimage_to's face position and orientation instead. Leave it empty and you get the standard fixed alignment.
That's it - no rotation angle to set, no crop margin, no interpolation mode. The node makes those calls internally based on the detected landmarks. The single IMAGE output is the aligned face, ready to feed into whatever measures or trains on it next.
When to use image_to
Wiring image_to is for the case where you specifically want two faces aligned to each other rather than to some fixed template - useful right before a FaceEmbedDistance comparison, or before a FaceWarp, where having both faces in matching orientation makes the operation behave more predictably. Without it, you're just normalizing one face on its own, which is what you want for consistent dataset prep or a one-off embedding.
Installing it
Same pack as everything else here:
- ComfyUI Manager - search "Face Analysis for ComfyUI", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_FaceAnalysis, restart.
Face Align needs no model files of its own - it's entirely dependent on whatever backend you loaded in Face Analysis Models, so get that node working first.
Common issues
Almost everything that goes wrong here traces back one level, to Face Analysis Models: no face detected upstream means Face Align has nothing to align, and you'll get an error or a pass-through of the original image depending on the failure mode. The other thing to know is that the fixed, no-image_to alignment can crop tighter than you expect - it's optimized for a clean, centered face, not for preserving background or framing. If you need more headroom around the aligned result, run a FaceBoundingBox with some padding first, or just accept that this node's job is a tight, recognition-ready crop rather than a nicely composed image. Since the repo's maintenance-only now, there's no active development to fix edge cases like unusual face angles that the underlying detector genuinely can't handle - that's a limitation of the library you picked in Face Analysis Models, not this node specifically.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| analysis_models | ANALYSIS_MODELS | — | |
| image_from | IMAGE | — | |
| image_toopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |