DiffusionCLIP: Text-Guided Diffusion Models for Robust Image Manipulation

Gwanghyun Kim, Taesung Kwon, Jong Chul Ye · DOI

Abstract

DiffusionCLIP is a novel framework that marries the high-fidelity generation of diffusion models with the semantic power of CLIP to perform robust, text-guided image manipulation. By leveraging the near-perfect inversion capabilities of Denoising Diffusion Implicit Models (DDIM), it overcomes the reconstruction artifacts and identity-loss issues that plague traditional GAN-based editing methods. The framework demonstrates superior performance across diverse datasets, including CelebA-HQ, AFHQ-Dog, LSUN, and ImageNet.

Introduction

Generative Adversarial Networks (GANs) have long been the standard for image manipulation but suffer from a significant "reconstruction-editability" trade-off. Inverting real images into a GAN's latent space often results in artifacts or loss of identity, particularly for images with complex backgrounds or novel poses. DiffusionCLIP addresses these challenges by shifting the paradigm to Diffusion Models, which offer superior inversion and generalization capabilities.

Methodology

The DiffusionCLIP framework operates in three primary stages:

  1. Near-Perfect Inversion: Utilizing DDIM, real images are converted into latent noise maps. This process is nearly deterministic and reversible, allowing for reconstruction with minimal loss of detail.
  2. Model Fine-Tuning with CLIP: Instead of optimizing latent codes, the diffusion model itself is fine-tuned using a directional CLIP loss. This aligns the image change in CLIP’s embedding space with the target text prompt.
  3. Multi-Attribute Editing: Multiple single-attribute fine-tuned models can have their noise predictions combined during the sampling process to perform complex, multi-attribute edits simultaneously.
Zero-shot domain translation from a sketch to a realistic image.

To enhance efficiency, a "return step" ($t_0$) strategy is employed, where diffusion is only partial rather than all the way to pure noise, significantly accelerating the editing process.

Experiments and Datasets

The robustness of DiffusionCLIP was evaluated on several diverse datasets to prove its versatility:

  • CelebA-HQ & AFHQ-Dog: High-resolution human faces and diverse dog breeds.
  • LSUN-Bedroom & LSUN-Church: Architectural and indoor scenes.
  • ImageNet: A massive dataset used to test the model's ability to handle general objects, a known weak point for GANs.
Reconstruction of architectural scenes from the LSUN-Church dataset.

Key Results and Insights

  • Inversion Advantage: Diffusion models are fundamentally better at "remembering" specific details of a real input image compared to GANs.
  • Quantitative Superiority: DiffusionCLIP achieved an MSE of 0.020 in face reconstruction, significantly better than SOTA GAN methods like e4e (0.092).
  • Human Preference: In user studies, participants preferred DiffusionCLIP results over StyleCLIP and StyleGAN-NADA by a landslide, with preference rates as high as 94.6% in complex cases.
  • Generalization: The model successfully performs edits on ImageNet objects, such as turning a green frog red or a tennis ball into an orange, where GAN-based methods typically fail.
  • Efficiency: Fine-tuning for a new attribute takes only 1 to 7 minutes on a single NVIDIA RTX 6000.

Conclusion and Limitations

While DiffusionCLIP offers significant improvements, it is subject to CLIP's inherent biases and requires balancing edit strength with identity preservation. Future work will focus on further reducing fine-tuning time and integrating more advanced vision-language models as they emerge.

Summary updated

BibTeX
@inproceedings{kim2022diffusionclip,
  author = {Gwanghyun Kim and Taesung Kwon and Jong Chul Ye},
  title = {{DiffusionCLIP: Text-Guided Diffusion Models for Robust Image Manipulation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00246},
}
Figure