Abstract
Personalized identity customization in text-to-image models remains a significant challenge due to the trade-off between identity fidelity and semantic disentanglement. We present PIDiff, a novel fine-tuning-based diffusion framework that leverages the highly detailed $\mathcal{W}+$ latent space of StyleGAN and a unique "Style Cross-Attention" (SCA) mechanism. PIDiff accurately captures fine-grained facial details while preventing identity characteristics from bleeding into background elements. Our approach achieves state-of-the-art performance in identity preservation and text alignment, while also enabling advanced facial style editing through identity vector mixing.
Introduction
While large-scale text-to-image models like Stable Diffusion have revolutionized general concept generation, they often struggle with personalized identity customization—the ability to generate a specific individual in diverse, novel contexts. Existing solutions generally fall into two categories: visual prompting (e.g., IP-Adapter) or embedding optimization (e.g., Textual Inversion, DreamBooth).
However, these methods frequently suffer from semantic entanglement, where the model inadvertently learns background or lighting cues from the reference image. This results in low diversity, where generated images either look like simple copy-pastes of the reference or fail to follow the background instructions in the text prompt. PIDiff addresses these issues by utilizing a more granular latent space and a localized attention mechanism.
Methodology
PIDiff builds upon the Stable Diffusion v1.5 architecture, introducing two primary innovations to enhance identity fidelity and disentanglement.
1. Visual Guidance Module (VGM) via $\mathcal{W}+$ Space
Rather than relying on coarse CLIP embeddings, PIDiff employs an e4e encoder to map reference faces into StyleGAN’s $\mathcal{W}+$ latent space. This space is inherently multi-level, capturing features from coarse face shapes to micro-details. A dedicated mapping network then translates these vectors into visual embeddings compatible with the diffusion U-Net.
2. Style Cross-Attention (SCA)
To solve the localization problem, PIDiff introduces the Style Cross-Attention block. Unlike standard parallel injection, the SCA block is placed sequentially after the text cross-attention block. By using the output of the text attention as the query and the visual embeddings as keys and values, the text prompt effectively guides the model on where to apply the identity features, preventing them from affecting the background.
3. Customized Fine-Tuning
The training pipeline utilizes cropped and aligned faces to minimize background noise. The model is fine-tuned for a limited number of steps using pseudo-words (e.g., "a photo of $S^*$"), allowing it to learn the specific identity quickly without overwriting the base model's broad generative capabilities.
Experimental Setup and Datasets
Standard face datasets often lack the multi-image variety or lighting quality required for robust customization. To address this, the authors developed the PIDiff Custom Dataset.
This dataset consists of 27 distinct identities with 10 images each, capturing variations in expression and environment. The dataset is carefully balanced across three racial groups, three age brackets, and genders to ensure broad applicability.
Results and Insights
PIDiff was benchmarked against leading methods including DreamBooth, Custom Diffusion, and IP-Adapter.
- Identity Preservation: PIDiff achieved a state-of-the-art ID score of 0.3112, outperforming IP-Adapter (0.2858).
- Text Alignment: The model maintained high semantic consistency with a CLIP-T score of 0.1938.
- Optimal Training: Ablation studies revealed that 6 images per identity provide the ideal balance; fewer images lead to overfitting on text, while more images can dilute specific identity traits.
Beyond standard generation, the use of $\mathcal{W}+$ space allows for "identity mixing." By concatenating the coarse layers of one identity with the fine layers of another, PIDiff can generate hybrid individuals, inheriting the structural features of one and the detailed textures of another.
Conclusion and Future Work
PIDiff demonstrates that combining the structural priors of StyleGAN with the generative power of Diffusion models can solve long-standing issues in identity customization. While the current model requires a brief fine-tuning stage and careful hyperparameter $(\lambda)$ balancing, it sets a new standard for facial fidelity. Future iterations aim to move toward zero-shot injection, eliminating the need for per-identity fine-tuning while maintaining the current level of disentanglement.
Summary updated