Source-linked AI summary

PuLID: Pure and Lightning ID Customization via Contrastive Alignment

Zinan Guo, Yanze Wu, Zhuowei Chen, Lang Chen, Peng Zhang, Qian He

arXiv:2404.16022v2cs.CV

TL;DR

Tuning-free identity customization must preserve the original text-to-image model’s behavior while achieving high identity fidelity and prompt editability. PuLID combines a Lightning T2I branch with contrastive alignment and accurate ID losses, and experiments report superior fidelity and editability with minimal disruption. The method’s main costs are slower, more memory-intensive training and some image-quality degradation, including facial blurriness.

  • Problem

    Tuning-free identity customization can disrupt identity-irrelevant elements and reduce prompt control, while high-fidelity identity-loss training is difficult with noisy diffusion predictions.

  • Method

    PuLID adds a Lightning T2I branch to standard diffusion training and uses contrastive alignment with an accurate ID loss computed from precise x0 predictions.

  • Results

    PuLID achieves SOTA performance in ID fidelity and editability while causing less disruption to the original model’s behavior.

  • Takeaways & Limitations

    PuLID provides a tuning-free approach for flexible and efficient personalized image generation with more consistent non-identity image elements after ID insertion.

  • Takeaways & Limitations

    The Lightning T2I branch slows training and increases CUDA-memory requirements, while accurate ID loss can cause facial blurriness and affect image quality.

Abstract

from arXiv · show

We propose Pure and Lightning ID customization (PuLID), a novel tuning-free ID customization method for text-to-image generation. By incorporating a Lightning T2I branch with a standard diffusion one, PuLID introduces both contrastive alignment loss and accurate ID loss, minimizing disruption to the original model and ensuring high ID fidelity. Experiments show that PuLID achieves superior performance in both ID fidelity and editability. Another attractive property of PuLID is that the image elements (e.g., background, lighting, composition, and style) before and after the ID insertion are kept as consistent as possible. Codes and models are available at https://github.com/ToTheBeginning/PuLID

1 Introduction

PuLID addresses the high cost of per-identity fine-tuning and the disruption–fidelity trade-off in tuning-free ID customization. It combines a Lightning T2I branch with contrastive alignment and accurate ID losses to preserve model behavior while improving identity fidelity and editability.

  • Tuning-based ID customization requires tens of minutes of fine-tuning for each identity, making personalization economically expensive.
  • Tuning-free methods efficiently encode identity features into diffusion models but can disrupt the original model’s behavior.
  • Ideal identity insertion changes identity-related attributes while keeping background, lighting, composition, and style consistent with the original model.
  • Identity customization should retain prompt-based control over attributes such as age, gender, expression, hair, orientation, and accessories.
  • High identity fidelity is crucial, but accurate identity-loss training is expensive because diffusion models require multiple denoising steps to obtain x0.
  • PuLID introduces a Lightning T2I branch alongside standard diffusion training, using contrastive alignment and ID losses to limit behavioral disruption while preserving fidelity.
  • Experiments report SOTA performance in both ID fidelity and editability, with less invasive identity information and greater flexibility for practical applications.

2 Related Work

Related work develops tuning-free identity customization, methods for reducing behavioral disruption, identity-loss objectives, and fast diffusion sampling. PuLID builds on precise x0 prediction while using a testing-aligned generation process.

  • Tuning-free methods encode identity information directly into the generation process to reduce the resource demands of tuning-based customization.
  • Face-recognition representations and multi-image identity datasets improve disruption control, but prior approaches do not fundamentally solve the disruption issue.
  • Prior identity-loss methods often calculate loss from noisy single-step x0 predictions, which are poorly suited to face-recognition models trained on real-world images.
  • LCM-Lookahead predicts x0 during conventional denoising, whereas PuLID starts from pure noise and iteratively denoises to x0, aligning optimization more closely with testing.
  • Fast sampling methods shorten diffusion inference from hundreds or thousands of steps to a few dozen or fewer steps.
  • SDXL-Lightning enables PuLID’s Lightning T2I branch to generate high-quality images from pure noise in 4 steps.

3 Methods

PuLID adds a Lightning T2I branch to standard diffusion training, using contrastive alignment to preserve the original model’s behavior and an accurate ID loss to improve identity fidelity. The method trains ID-conditioning components while keeping the remaining model frozen.

  • 3. Methods: PuLID combines conventional diffusion training with a Lightning T2I branch that denoises pure noise into high-quality images in four steps.The Lightning branch mirrors the test setting and enables accurate image-level supervision after ID insertion.
  • 3. Methods: The ID condition is extracted from the input face and integrated through an encoder with parallel cross-attention layers in the pretrained T2I model.The implementation uses face-recognition and CLIP features, mapped into global and local ID tokens.
  • 3. Methods: Contrastive alignment compares paths with and without ID injection across corresponding UNET cross-attention layers to limit changes to the original model’s behavior.The alignment loss contains semantic and layout components; the layout term is kept relatively small because larger values compromise ID fidelity.
  • 3. Methods: The semantic alignment loss reduces ID-information contamination, while the layout alignment loss is added because semantic alignment alone cannot guarantee layout consistency.The losses compare prompt responses and UNET features between the two contrastive paths.
  • 3. Methods: PuLID computes ID loss from a face embedding of the Lightning branch’s generated image, which is close to the real data distribution and aligned with testing.The loss compares the generated face embedding with the ground-truth ID embedding using a face-recognition backbone.
  • 3. Methods: The full objective combines diffusion, alignment, and ID losses, while optimization updates only the newly introduced MLPs and ID cross-attention projections.The other model parameters remain frozen.

4 Experiments

Experiments evaluate PuLID against existing methods using diverse portrait sets, qualitative comparisons, quantitative metrics, and ablations. PuLID achieves high ID fidelity and editability while preserving the original model’s image elements and prompt-following behavior.

  • 4.2 Test Settings: The evaluation uses a 120-image diverse portrait set, DivID-120, alongside the 50-image Unsplash-50 benchmark.DivID-120 covers varied skin tones, ages, and genders.
  • 4.3 Qualitative Comparison: PuLID generally achieves higher ID fidelity than IPAdapter and InstantID while causing less disruption to the original model.Qualitative comparisons also report better aesthetics in realistic portrait scenes.
  • 4.3 Qualitative Comparison: PuLID reproduces the original model’s lighting, style, and layout while supporting prompt edits to orientation, attributes, and accessories.These properties are illustrated across the qualitative comparison rows and columns.
  • 4.4 Quantitative Comparison: PuLID surpasses comparison methods across Face Sim., CLIP-T, and CLIP-I, achieving state-of-the-art ID fidelity and editability.Its stronger CLIP-I indicates less change in image elements after ID insertion.
  • 4.5 Ablation: Adding alignment loss substantially improves CLIP-T and CLIP-I, reducing failures in style, orientation, and layout seen without it.Without alignment loss, faces can dominate the image and layout diversity diminishes.
  • 4.5 Ablation: The accurate ID loss improves ID fidelity more than naive ID loss, while the full PuLID training paradigm improves fidelity and editability beyond the baseline.The ablation attributes the stronger ID-loss improvement to more precise x0 estimates from the Lightning-T2I branch.

5 Limitation

PuLID’s Lightning T2I branch slows training iterations and increases CUDA memory use. Accurate ID loss can also reduce image quality, including facial blurriness, although contrastive alignment largely alleviates this issue.

  • Training Cost: The Lightning T2I branch makes each training iteration slower than conventional diffusion training and requires more CUDA memory.The authors note that future one-step fast sampling could significantly mitigate this cost.
  • Image Quality: Accurate ID loss can harm image quality by causing facial blurriness, though the proposed contrastive alignment loss can largely alleviate this effect.The authors identify improved ID loss as future work to avoid this quality trade-off.

6 Conclusion

PuLID is a tuning-free approach for text-to-image ID customization that combines a Lightning T2I branch with contrastive alignment to improve ID fidelity and editability while minimally disrupting the base model.

  • PuLID is a tuning-free method for ID customization in text-to-image generation.
  • PuLID combines a Lightning T2I branch with a contrastive alignment strategy.
  • PuLID achieves superior ID fidelity and editability with minimal disruption to the base model’s behavior.
  • The approach may support flexible and efficient personalized image generation, while future work could extend it to IP and style customization.

7 Appendix

The appendix examines PuLID’s applications, generalization, training choices, evaluation settings, comparisons, and broader impacts. It reports practical trade-offs in acceleration and model choice alongside qualitative and quantitative evidence of fidelity, editability, and low interference.

  • More applications: PuLID supports style alteration, IP fusion, accessory modification, recontextualization, attribute editing, photorealistic transformation, and ID mixing.
  • Generalization ability: SDXL-Lightning preserves SDXL’s style and layout, helping PuLID generalize to community models based on SDXL.
  • Training with non-accelerated base models: Without fast sampling, the T2I branch requires 30 inference steps with CFG instead of 4 steps without CFG.
  • Ablation study on fast sampling methods: Four steps balances efficiency and quality; 1- or 2-step training reduces face similarity, whereas 8-step training slightly improves overall performance.
  • Evaluation settings: Evaluation measures CLIP-T, CLIP-I, and Face Sim. using defined prompts and four randomly generated images per ID and prompt.
  • Test settings: For InstantID and IPAdapter, small ID weights minimize model disruption but substantially reduce ID similarity.
  • Comparisons on SDXL-base: PuLID outperforms comparison methods in most SDXL-base scenarios, while preserving high ID similarity, editability, and low interference.
  • Broader impacts: PuLID’s capabilities could benefit personalized content creation but also enable misleading representations, privacy infringements, and malicious deepfakes.
Loading 2404.16022v2…