restore_face: double face_alpha mask produces shadow frame in top/left of face output #20

Closed
opened 2026-08-14 21:02:18 +00:00 by Mark · 0 comments
Owner

RestoreFaceNode at auraframe/pipeline/nodes/restore_face.py lines 158 and 166 applies face_alpha mask BEFORE (line 158) and AFTER (line 166) GFPGAN. The pre-multiply darkens the GFPGAN input (top-of-head and side fades), so the output inherits those dark edges. The post-multiply compounds them. Only the below-chin region got repaired (line 181-183 chin fill). Measured: top-edge/center ratio = 0.22 after warp-back (was 78% darker). Fix: remove both masks (lines 158 and 166) -- feed GFPGAN the full aligned face. The blend mask (ellipse * face_alpha_warped) at line 241 already handles hair exclusion at paste-back time, matching the reference GFPGAN implementation. Verification: run the diagnostic and check restored_warped top-edge ratio > 0.8.

RestoreFaceNode at auraframe/pipeline/nodes/restore_face.py lines 158 and 166 applies face_alpha mask BEFORE (line 158) and AFTER (line 166) GFPGAN. The pre-multiply darkens the GFPGAN input (top-of-head and side fades), so the output inherits those dark edges. The post-multiply compounds them. Only the below-chin region got repaired (line 181-183 chin fill). Measured: top-edge/center ratio = 0.22 after warp-back (was 78% darker). Fix: remove both masks (lines 158 and 166) -- feed GFPGAN the full aligned face. The blend mask (ellipse * face_alpha_warped) at line 241 already handles hair exclusion at paste-back time, matching the reference GFPGAN implementation. Verification: run the diagnostic and check restored_warped top-edge ratio > 0.8.
Mark closed this issue 2026-08-15 01:00:19 +00:00
Sign in to join this conversation.
No description provided.