{"course":{"slug":"ai-video","title":"Video with AI","url":"https://addaly.com/learn/ai-video","level":"intermediate","track":"create"},"lesson":{"slug":"post-hoc-identity-repair","title":"Fixing a face after the clip exists","url":"https://addaly.com/learn/ai-video/post-hoc-identity-repair","position":36,"of":66,"minutes":9,"answer":"Face restoration and face replacement operate per frame on a finished clip.","keyIdea":"Face restoration and face replacement operate per frame on a finished clip, which makes them useful for small drift and dangerous for large changes. And the same tooling that rescues your own shot is the tooling behind non-consensual synthetic media."},"body":{"format":"markdown","text":"## Two different tools with similar names\n\n**Face restoration** improves a face that is already the right face but degraded: soft, low resolution, slightly malformed. Models such as GFPGAN and CodeFormer take a face region and reconstruct plausible detail: eyes, teeth, skin texture, edges.\n\n**Face replacement** puts a different face onto the body in the footage. Different job, different ethics, dealt with below.\n\nBoth run per frame on a finished clip. Both are widely available, free, and easy.\n\n## When restoration helps\n\nA face at a distance in a 720p generation is perhaps eighty pixels across. The encoder discarded most of its detail and the decoder invented a soft approximation. Restoration is the honest fix for exactly this, and it is the difference between a usable wide shot and an unusable one.\n\nGood cases:\n\n- Faces in the middle distance, soft but correct.\n- A close-up where eyes and teeth are mushy but the geometry is right.\n- Upscaling a lower-resolution generation where the face is the limiting factor.\n\n## Where it fails, and the failure is specific\n\n**Temporal flicker.** Restoration runs per frame. Each frame's face is reconstructed independently, so the invented detail differs slightly from frame to frame. The result is a face that boils: skin texture crawling, eye highlights popping, teeth shifting. On a still it looks great; in motion it announces itself.\n\nMitigations, in order:\n\n- Use a lower restoration strength. CodeFormer's fidelity weight trades detail against faithfulness to the input; keeping it closer to the input reduces flicker sharply.\n- Blend the restored face back at partial opacity over the original. Fifty per cent often looks better than a hundred.\n- Use video-aware restoration where available, which considers neighbouring frames.\n- Restore fewer frames: on a short shot, restore and check rather than restoring the whole timeline by default.\n\n**Identity shift.** Aggressive restoration invents a more conventionally attractive, more symmetrical, younger face. It is pulling toward the average of its training data. On a character with distinctive features this quietly replaces them, and on non-white faces the pull toward a training-set average has been a documented and repeatedly criticised problem. Check the output against your character sheet rather than against your impression.\n\n## Face replacement, and the line\n\nThe technical description is short: detect the face, align it, swap in a face generated or transferred from a source, blend the edges, run per frame.\n\nLegitimate uses exist and are real. Holding your own trained character across shots where the generation drifted. Replacing a background actor's face with a synthetic one to avoid needing their release. Fixing one shot in a sequence where everything else matched.\n\nThe illegitimate use is the one this technology is famous for, and the mechanics are identical. There is no technical difference between the operation that rescues your shot and the operation that puts a real person into a video they were never in.\n\nSo the line is not technical, it is about permission and disclosure:\n\n- A real person's face requires that person's written, specific permission. Consent to be filmed is not consent to be synthesised.\n- The output requires a visible label, for reasons dealt with properly in the final module.\n- Many jurisdictions now legislate here specifically, and the direction of travel is one way. Non-consensual intimate synthetic imagery is criminal in a growing number of places, and personality-rights actions over synthetic likeness have succeeded in several courts since 2023.\n\nIf you find yourself reasoning about why a particular case is an exception, that is the signal to stop and ask the person.\n\n## The free path\n\nGFPGAN, CodeFormer and the current successors are free and open, available as Hugging Face Spaces for browser use and as ComfyUI nodes locally. FFmpeg extracts frames and reassembles them. Resolve's free tier blends a restored sequence back over the original with an opacity slider.\n\nNone of this needs a paid tool, which is precisely why the ethical question cannot be left to whoever can afford the software.\n\n---\n\nToday: restore one face in a soft wide shot at low strength, blend it back at fifty per cent, and watch the result in motion rather than as a frame."},"check":{"question":"A restored face looks excellent in a single frame but appears to crawl and boil when the clip plays. What causes this?","options":[{"text":"The restoration model was trained on still photographs, so it produces detail at a spatial frequency the video codec cannot encode without shimmering.","correct":false,"tempting":"Blames the codec for an artefact that is present in the uncompressed frames before any encoding happens."},{"text":"Restoration runs independently on each frame, so the detail it invents differs slightly every time and that difference reads as movement.","correct":true},{"text":"Restoration increases contrast in the face region, and the interpolation step then amplifies those differences into visible flicker between frames.","correct":false,"tempting":"Names two real steps and invents a causal link; flicker appears whether or not interpolation is applied."},{"text":"The face detector's bounding box shifts by a pixel or two between frames, so the alignment differs and the reconstructed face is resampled at a slightly different position each time.","correct":false,"tempting":"Describes a genuine secondary contributor that is usually smoothed away by tracking, while the independent reconstruction of detail remains regardless."}]},"prev":{"slug":"wardrobe-props-and-colour-continuity","title":"The blue that is not quite the same blue","url":"https://addaly.com/learn/ai-video/wardrobe-props-and-colour-continuity"},"next":{"slug":"the-look-file","title":"Deciding the look once, in writing","url":"https://addaly.com/learn/ai-video/the-look-file"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Fixing a face after the clip exists', in Video with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-video/post-hoc-identity-repair (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Fixing a face after the clip exists","courseTitle":"Video with AI","module":{"index":4,"slug":"continuity-and-character","title":"Making separate shots belong to each other"},"answer":null,"keyIdea":"Face restoration and face replacement operate per frame on a finished clip, which makes them useful for small drift and dangerous for large changes. And the same tooling that rescues your own shot is the tooling behind non-consensual synthetic media.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"two-different-tools-with-similar-names","runs":[{"text":"Two different tools with similar names"}]},{"t":"p","runs":[{"text":"Face restoration","b":true},{"text":" improves a face that is already the right face but degraded: soft, low resolution, slightly malformed. Models such as GFPGAN and CodeFormer take a face region and reconstruct plausible detail: eyes, teeth, skin texture, edges."}]},{"t":"p","runs":[{"text":"Face replacement","b":true},{"text":" puts a different face onto the body in the footage. Different job, different ethics, dealt with below."}]},{"t":"p","runs":[{"text":"Both run per frame on a finished clip. Both are widely available, free, and easy."}]},{"t":"h2","id":"when-restoration-helps","runs":[{"text":"When restoration helps"}]},{"t":"p","runs":[{"text":"A face at a distance in a 720p generation is perhaps eighty pixels across. The encoder discarded most of its detail and the decoder invented a soft approximation. Restoration is the honest fix for exactly this, and it is the difference between a usable wide shot and an unusable one."}]},{"t":"p","runs":[{"text":"Good cases:"}]},{"t":"ul","items":[[{"text":"Faces in the middle distance, soft but correct."}],[{"text":"A close-up where eyes and teeth are mushy but the geometry is right."}],[{"text":"Upscaling a lower-resolution generation where the face is the limiting factor."}]]},{"t":"h2","id":"where-it-fails-and-the-failure-is-specific","runs":[{"text":"Where it fails, and the failure is specific"}]},{"t":"p","runs":[{"text":"Temporal flicker.","b":true},{"text":" Restoration runs per frame. Each frame’s face is reconstructed independently, so the invented detail differs slightly from frame to frame. The result is a face that boils: skin texture crawling, eye highlights popping, teeth shifting. On a still it looks great; in motion it announces itself."}]},{"t":"p","runs":[{"text":"Mitigations, in order:"}]},{"t":"ul","items":[[{"text":"Use a lower restoration strength. CodeFormer’s fidelity weight trades detail against faithfulness to the input; keeping it closer to the input reduces flicker sharply."}],[{"text":"Blend the restored face back at partial opacity over the original. Fifty per cent often looks better than a hundred."}],[{"text":"Use video-aware restoration where available, which considers neighbouring frames."}],[{"text":"Restore fewer frames: on a short shot, restore and check rather than restoring the whole timeline by default."}]]},{"t":"p","runs":[{"text":"Identity shift.","b":true},{"text":" Aggressive restoration invents a more conventionally attractive, more symmetrical, younger face. It is pulling toward the average of its training data. On a character with distinctive features this quietly replaces them, and on non-white faces the pull toward a training-set average has been a documented and repeatedly criticised problem. Check the output against your character sheet rather than against your impression."}]},{"t":"h2","id":"face-replacement-and-the-line","runs":[{"text":"Face replacement, and the line"}]},{"t":"p","runs":[{"text":"The technical description is short: detect the face, align it, swap in a face generated or transferred from a source, blend the edges, run per frame."}]},{"t":"p","runs":[{"text":"Legitimate uses exist and are real. Holding your own trained character across shots where the generation drifted. Replacing a background actor’s face with a synthetic one to avoid needing their release. Fixing one shot in a sequence where everything else matched."}]},{"t":"p","runs":[{"text":"The illegitimate use is the one this technology is famous for, and the mechanics are identical. There is no technical difference between the operation that rescues your shot and the operation that puts a real person into a video they were never in."}]},{"t":"p","runs":[{"text":"So the line is not technical, it is about permission and disclosure:"}]},{"t":"ul","items":[[{"text":"A real person’s face requires that person’s written, specific permission. Consent to be filmed is not consent to be synthesised."}],[{"text":"The output requires a visible label, for reasons dealt with properly in the final module."}],[{"text":"Many jurisdictions now legislate here specifically, and the direction of travel is one way. Non-consensual intimate synthetic imagery is criminal in a growing number of places, and personality-rights actions over synthetic likeness have succeeded in several courts since 2023."}]]},{"t":"p","runs":[{"text":"If you find yourself reasoning about why a particular case is an exception, that is the signal to stop and ask the person."}]},{"t":"h2","id":"the-free-path","runs":[{"text":"The free path"}],"role":"free"},{"t":"p","runs":[{"text":"GFPGAN, CodeFormer and the current successors are free and open, available as Hugging Face Spaces for browser use and as ComfyUI nodes locally. FFmpeg extracts frames and reassembles them. Resolve’s free tier blends a restored sequence back over the original with an opacity slider."}]},{"t":"p","runs":[{"text":"None of this needs a paid tool, which is precisely why the ethical question cannot be left to whoever can afford the software."}]},{"t":"rule"},{"t":"p","runs":[{"text":"Today: restore one face in a soft wide shot at low strength, blend it back at fifty per cent, and watch the result in motion rather than as a frame."}]}],"check":{"question":[{"text":"A restored face looks excellent in a single frame but appears to crawl and boil when the clip plays. What causes this?"}],"options":[{"text":[{"text":"The restoration model was trained on still photographs, so it produces detail at a spatial frequency the video codec cannot encode without shimmering."}],"correct":false,"tempting":[{"text":"Blames the codec for an artefact that is present in the uncompressed frames before any encoding happens."}]},{"text":[{"text":"Restoration runs independently on each frame, so the detail it invents differs slightly every time and that difference reads as movement."}],"correct":true,"tempting":null},{"text":[{"text":"Restoration increases contrast in the face region, and the interpolation step then amplifies those differences into visible flicker between frames."}],"correct":false,"tempting":[{"text":"Names two real steps and invents a causal link; flicker appears whether or not interpolation is applied."}]},{"text":[{"text":"The face detector’s bounding box shifts by a pixel or two between frames, so the alignment differs and the reconstructed face is resampled at a slightly different position each time."}],"correct":false,"tempting":[{"text":"Describes a genuine secondary contributor that is usually smoothed away by tracking, while the independent reconstruction of detail remains regardless."}]}],"order":[2,0,3,1],"why":null},"prev":{"slug":"wardrobe-props-and-colour-continuity","title":"The blue that is not quite the same blue","minutes":8},"next":{"slug":"the-look-file","title":"Deciding the look once, in writing","minutes":8}}}