DiffusionCLIP
A diffusion U-Net fine-tuned with a CLIP loss so that real images can be edited from a text prompt.
Diffusion and generative · 654 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 113.7M
- Operations
- 654
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2022
- Cited by
- 568 (as of 28 October 2026)
- Authors
- Gwanghyun Kim, Taesung Kwon, Jong Chul Ye
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m16145
- Graph hash
- 048ee52d437e8611757c0226a2353629651ac3c7630028aee09d4a89e817665c
- Skeleton hash
- 70b16561618ab4ea85ec4bd743307f935815612e61c1a0919dcf7197fc67743c
- Architecture hash
- 1c6b6e98fe338e575f25deec609c1b993e114370fc5eee2dff894213b028555f
- Diagram SHA-256
- 9fec69613dc7aa8d93fb517dde2ac2b6a9c86491e22213e247df840e3817df04
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
DiffusionCLIP performs text-driven image manipulation with diffusion models. The paper's starting point is that methods combining GAN inversion with CLIP are difficult to apply to diverse real images because GAN inversion capability is limited.
An input image is first converted to latent noise through a forward diffusion, which in the case of DDIM can be inverted nearly perfectly back to the original image. The reverse diffusion model is then fine-tuned with a CLIP loss that controls the attributes of the generated image from the text prompt. The loss used is the directional CLIP loss, which aligns the change between the reference and generated image embeddings with the direction between a reference text and a target text. An identity loss is added to prevent unwanted changes and preserve the identity of the object. The network being fine-tuned is the U-Net that existing diffusion models share across all time steps, with the time step inserted through a sinusoidal position embedding.
Noise predicted by several fine-tuned models can be combined to change multiple attributes in one sampling process. The paper reports that fine-tuning finishes in 1 to 7 minutes. It also manipulates images from ImageNet, a dataset the paper says has rarely been explored with GAN inversion.
Key idea. DiffusionCLIP fine-tunes the reverse process of a pretrained diffusion model with a CLIP loss, so that images inverted by DDIM are regenerated to match a target text.
- DiffusionCLIP
- text-guided image manipulation
- text-driven image editing
- CLIP-guided diffusion
- DDIM inversion
- zero-shot image manipulation
- diffusion model fine-tuning
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{kim2022diffusioncliptextguideddiffusionmodels,
title={DiffusionCLIP: Text-Guided Diffusion Models for Robust Image Manipulation},
author={Gwanghyun Kim and Taesung Kwon and Jong Chul Ye},
year={2022},
eprint={2110.02711},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2110.02711},
}