
CodeFormer blind face restoration on an Image. Faces are detected, restored with a transformer codebook prior and pasted into the upscaled frame; the sink picks the arm: restored Image, face count, or per-face crops.
Restore faces in a folder of photos and serve the full frames over HTTP.
Restore faces in a live stream and push the cleaned frames to the browser.
oneof t[Image, UInt64, [Image]] of the same restoration: the full restored frame, the count of restored faces, or the list of per-face 512x512 crops. The count always equals the crops length. Output pixels are RGB regardless of the input colour order.
Image arm returns the source enlarged by upscale, the UInt64 arm `0`, and the [Image] arm an empty list; a zero-sized frame is passed through on the full-frame arm.
fidelity_weight trades restoration aggressiveness against identity: `0.0` enhances most freely and may drift from the original face, `1.0` stays closest to the input; `0.5`-`0.7` is typical.
upscale enlarges the whole output frame by that factor on top of face restoration, so a larger factor raises memory and time roughly with the output area; the per-face crops stay 512x512 regardless.
face_upsample and background_upsample each add a Real-ESRGAN super-resolution pass (faces, background) and raise compute and memory; leave them off when only face cleanup is needed.
Automated release