Abstract
Face inpainting is essential for applications like photo restoration and virtual reality. However, maintaining a person's unique identity while allowing for semantic edits remains challenging. Current methods like MyStyle require extensive fine-tuning and data. This paper proposes Parallel Visual Attention (PVA) for diffusion models. By inserting parallel attention modules that attend to reference image features, PVA achieves high identity resemblance and language controllability. PVA requires only 40 fine-tuning steps—a 20x speedup over existing benchmarks—while outperforming them in identity preservation and image quality.
Introduction
The goal of personalized face inpainting is to fill in missing facial regions while strictly adhering to the subject's unique identity. Standard generative models often produce generic faces that lack the specific characteristics of the individual. While "personalized" models exist, they are often hindered by slow inference times, high data requirements, or poor adherence to text-based editing prompts (e.g., "add a beard").
This paper addresses these hurdles with the Parallel Visual Attention (PVA) framework, which enables fast, high-quality, and controllable face inpainting using as few as five reference images.
Methodology: Parallel Visual Attention
The core innovation is the PVA module, integrated into a Latent Diffusion Model (LDM). Instead of concatenating visual features with text prompts, the authors insert parallel attention matrices ($Q', K', V'$) into every cross-attention layer of the denoising UNet. This parallel structure allows the model to process identity-specific visual cues and semantic text instructions simultaneously without overwriting the model's pre-trained generative capabilities.
Identity Encoding
Rather than using a standard CLIP vision encoder, which lacks the granularity needed for individual facial recognition, the system employs a pre-trained FaceNet encoder. This is followed by a Transformer to extract identity-specific features from a small set of reference images. During training on the CelebAHQ-IDI dataset, the base UNet is frozen, and only the PVA modules and identity encoder are optimized.
Lightweight Fine-Tuning
For a new identity, PVA performs a "lightweight fine-tuning" of just 40 steps. This process takes less than a minute on a single GPU, making it significantly more practical than previous optimization-heavy approaches like Custom Diffusion.
Results and Discussion
PVA was evaluated against state-of-the-art baselines, including MyStyle, Paint by Example, and Custom Diffusion.
- Identity Preservation: PVA achieved a top ID similarity score of 0.741, surpassing Custom Diffusion (0.729) and MyStyle (0.696).
- Image Quality: The model recorded the lowest (best) FID score of 8.22, indicating superior realism.
- Efficiency: PVA's 40-step fine-tuning represents a 20x speedup over Custom Diffusion's multi-hour optimization.
Qualitative results demonstrate that PVA successfully disentangles identity from attributes. As shown in the figure above, the model can accurately apply complex edits—such as changing an expression to "angry" or adding a beard—while maintaining the recognizable likeness of the subject, a task where competing models often fail.
Conclusion
Parallel Visual Attention provides a robust and efficient solution for personalized face inpainting. By decoupling identity features from semantic attributes through a parallel attention mechanism, the model achieves a superior balance between identity preservation and language controllability. Future work will focus on achieving zero-shot personalization to further streamline the user experience.
Summary updated