LucidFace

Observation-locked restoration of out-of-focus faces in interview video. The restoration may add only what the camera could not record.

LucidFace pipeline: input video, pass 1 tracking, focus gate, then on the GPU align, restore, consistency lock, temporal steadier and paste back, then QC with fallback and a composite onto the original file.
Two passes over the video. Only the face box of the original file is ever replaced.

Abstract

A missed focus pull leaves the background sharp and the speaker soft for the whole take. Video upscalers barely help: the frame is not under-sampled, it is low-passed by the lens. Face models rebuild a convincing face, but they also rewrite what the camera did record, such as where the person is looking or the colour of their eyes.

LucidFace pins the restored face to the observed frame below a cutoff frequency (consistency lock), blends only fine detail over time along trustworthy optical flow (temporal steadier), leaves in-focus shots untouched (focus gate), and flags and fades out doubtful frames. On a reproducible benchmark built from public-domain interviews it halves perceptual distance to the sharp original and raises identity similarity in 13 of 15 cases. We also report what did not work.

The problem

Tried first

Upscalers do not fix defocus

On a 27-minute defocused interview, a state-of-the-art video restorer (SeedVR2, 3B and 7B, input pre-shrunk 1x to 4x) only slightly crisped the eyes. Defocus removes high frequencies from a face that already has enough pixels.

Then

Face models invent, including the eyes

A face prior (CodeFormer) rebuilt eyes, brows and lips. At its usual setting it also turned one brown iris grey and pointed that eye at the camera while the other looked away. Viewers notice eyes first.

Method

1 · The consistency lock

A defocused lens keeps the low frequencies of the face: iris position and colour, gaze, shading. LucidFace keeps exactly those from the camera and takes only the high band from the model: r′ = r + Gs * (a − r), with the cutoff tied to the eye distance. It is closed-form and works with any face model.

Chart: below the lock cutoff each frequency comes from the camera, above it from the restoration model; the defocused lens response is drawn for comparison.

2 · The temporal steadier

Per-frame restoration shimmers. Restored detail is blended with the previous frame's, moved along optical flow, and only where the flow is trustworthy, so blinks and speech are never ghosted. Low frequencies stay locked to the current frame, so motion never lags.

Diagram of the temporal steadier: optical flow between blurry frames gives a confidence map, and the previous frame's detail is warped and blended in where confidence is high.

3 · The focus gate

Face models degrade faces that are already sharp. A scale-free focus score separates sharp from defocused faces with a clear gap; only shots below the threshold are restored.

Dot plot: sharp faces score 0.32 to 0.60, defocused faces 0.15 to 0.24, with the gate threshold at 0.28.

4 · Quality control with graceful fallback

Frames where the model departed from the footage, eyes shimmer, identity drifts or tracking is unreliable are flagged, faded back to the original, and listed with timestamps in an HTML report.

Timeline: around flagged frames the blend weight ramps smoothly from restored to original and back.

5 · Built for real files

Only the face box travels to the GPU and back, and it is composited onto the untouched original at the same bit depth, with the original audio and timecode.

Diagram: a face box inside a 1920 by 1080 frame is cropped, restored on a GPU and composited back; the upload drops from 10.6 GB to 815 MB.

Results

Five public-domain interviews (US government works), synthetic lens blur at three strengths, scored against the sharp originals in the face and eye regions.

15 / 15cases with lower perceptual distance than the blurry input
13 / 15cases with higher identity similarity
~10 fpsat 1080p on an RTX 4080 SUPER, end to end
Three line charts by blur strength: perceptual distance, identity similarity and eye flicker for the blurry input, CodeFormer at its usual setting, and LucidFace.
blurmethodLPIPS ↓identity ↑eye flicker ↓
mildblurry input0.2220.8996.10
mildLucidFace0.0960.9257.59
mediumblurry input0.2480.7636.41
mediumLucidFace0.1160.8138.58
heavyblurry input0.2650.5776.59
heavyLucidFace0.1350.5918.82

What did not work

The lock does not improve averaged scores on synthetic blur. It was built for a failure seen on real camera defocus (rewritten gaze and iris colour) that synthetic blur on clean footage did not trigger. It stays on as a guarantee; --lock 0 turns it off.

Restoration adds flicker. Every restored version flickers more against the ground truth than the blurry input does. The steadier reduces it but does not close the gap.

Colour bias in this run. A colour-matrix bug, since fixed and tested, biased these comparisons against restoration, so the wins above are lower bounds. Full details in the benchmark.

Get started

git clone https://github.com/ironmark72/lucidface && cd lucidface
bash scripts/pod_setup.sh ~/models
export LUCIDFACE_CODEFORMER_DIR=~/models/CodeFormer
lucidface run interview.mp4 -o interview_fixed.mov

You get the restored video and an HTML QC report. Requires a CUDA GPU with 16 GB or more. The code is MIT; the default face model (CodeFormer) is non-commercial, see NOTICE. Restored faces are estimates, not evidence: do not use them for identification.

Citation

@software{lucidface2026,
  title  = {LucidFace: Observation-Locked Restoration of Out-of-Focus Faces in Interview Video},
  author = {{LucidFace contributors}},
  year   = {2026},
  url    = {https://github.com/ironmark72/lucidface}
}