Restore and enhance faces in an image using GFPGAN.
Detects all faces via RetinaFace, restores quality (fixes blur, noise,
compression artifacts), and pastes them back. Optionally enhances the
background using Real-ESRGAN. GPU-accelerated, sub-3s latency.
Args:
image_base64: Base64-encoded image data containing faces (PNG, JPEG, WebP).
upscale: Output upscale factor -- 1 to 4 (default: 2).
enhance_background: Whether to enhance background with Real-ESRGAN (default: true).
Returns:
dict with keys:
- image (str): Base64-encoded restored image
- format (str): Output image format
- width (int): Output width
- height (int): Output height
- upscale (int): Scale factor applied
- processing_time_ms (float): Processing time in milliseconds
Connector