Face Align
Paste the enhanced faces back into the photo
- image
- faces
- IMAGE
Face Align is the last node in the face-restoration chain - it takes the faces Face Enhancement (Stage3) fixed and pastes them back into the full photo, aligned to where they came from. Nothing gets restored here; this is purely the merge step. Run it after Stage2 (Face Detection) and Stage3 (Face Enhancement), and you're done - its output is the final image.
This finishing step is a big part of why people on the pack's launch thread called it more streamlined than the earlier ComfyUI port of the same algorithm: three focused nodes (detect, enhance, align) instead of a more sprawling graph, with Face Align doing the unglamorous but necessary job of making sure the enhanced faces don't just look pasted on.
How it works
It takes the original image and the enhanced FACES data (which still carries each face's landmark/position info from detection) and composites the enhanced face crops back into the full-resolution photo at their original locations, blending the edges so the seam isn't visible. This is the step that turns "here's a nicer-looking face crop" into "here's your restored photo with a nicer face in it."
Inputs and outputs
image(IMAGE) - the photo to paste the faces into. This should be the same image (or its globally-restored version) that you originally fed into Face Detection, so the face positions line up.faces(FACES) - the enhanced output from Face Enhancement (Stage3). It won't accept the raw output from Stage2; it has to be the enhanced version.hr(BOOLEAN, defaultfalse) - the pack-wide higher-parameters toggle.
Output is a single IMAGE - your finished restoration. Save it, preview it, or feed it into further upscaling from here.
Installing it
ComfyUI Manager: search "ComfyUI Old Photo Restoration," install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Haoming02/comfyui-old-photo-restoration
then restart and check the lib_bopb2l folder exists - grab backend.zip from this pack's Releases if it doesn't.
Face Align itself doesn't need its own checkpoint download - it's a compositing step, not a model. But it's useless without the checkpoints the earlier stages need: global_checkpoints.zip and face_checkpoints.zip (both from the Releases page of Haoming02/sd-webui-old-photo-restoration, extracted as full checkpoints folders into lib_bopb2l/Global/ and lib_bopb2l/Face_Enhancement/ respectively) and shape_predictor_68_face_landmarks.zip (the .dat file, into lib_bopb2l/Face_Detection/). If those aren't in place upstream, this node never gets valid input to work with.
Common issues
Faces look misaligned or double-exposed at the edges. Usually means the image fed into Face Align isn't the same one (or same resolution/crop) that went into Face Detection earlier in the chain - the landmark positions Stage2 recorded won't line up with a different image. Keep the same image reference through the whole chain.
Errors about the faces input. Make sure you're feeding it Stage3's enhanced output, not Stage2's raw detection output - Face Align expects the enhanced version, and while both share the FACES type, only the enhanced one is the intended input here.
Result looks fine except the faces are still soft. That means the problem is upstream, not here - check that Face Enhancement (Stage3) actually ran and that its checkpoints loaded correctly; Face Align can only paste back what Stage3 gave it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| faces | FACES | — | |
| hr | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |