atlas

Research map / Image generation / Text-to-image diffusion

Towards Understanding Cross and Self-Attention in Stable Diffusion for Text-Guided Image Editing

CVPR 2024 · Image generation › Text-to-image diffusion · approach: Compositional text-to-image guidance · 72 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Probes cross- and self-attention maps in Stable Diffusion and proposes Free-Prompt-Editing (FPE), a tuning-free image editing method that only replaces self-attention maps in layers 4-14 during denoising.

Problem

Tuning-free text-guided image editing with Stable Diffusion relies on cross-attention map replacement, which is unstable and requires source prompts; little is known about what attention layers encode.

Approach

Probing classifiers show cross-attention maps encode object/attribute category information (causing edit failures), while self-attention maps encode spatial structure; so editing only self-attention maps in layers 4-14, without a source prompt, preserves layout while enabling edits.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use FPE instead of P2PStable Diffusion 1.5 image editing · Car-fake-editClip Directional Similarity: 0.2451 -> 0.2659Helped
Use FPE instead of P2PStable Diffusion 1.5 image editing · Car-real-editClip Directional Similarity: 0.2288 -> 0.2605Helped
Use FPE instead of P2PStable Diffusion 1.5 image editing · ImageNet-fake-editClip Directional Similarity: 0.2401 -> 0.2560Helped
Use FPE instead of P2PStable Diffusion 1.5 image editing · ImageNet-real-editClip Directional Similarity: 0.2426 -> 0.2468Helped
Replace cross-attention maps during editing (ablation)Diffusion image editing · Image editing examples in Figure 4Editing successHurt
Replace self-attention maps in all layers (ablation)Diffusion image editing · Image editing examples in Figure 4Target editing successHurt
Replace self-attention maps in Layers 4 to 14 (ablation)FPE · Image editing examples in Figure 4Structure preservation and editing successHelped
Leave the self-attention map unaltered (ablation)Diffusion image editing · Image editing examples in Figure 4Source structure preservationHurt
Use FPE instead of the strongest baseline, MasaCtrlStable Diffusion 1.5 image editing · ImageNet-R-TI2I fakeClip Directional Similarity: 0.3024 -> 0.3559Helped
Use FPE instead of the strongest baseline, P2PStable Diffusion 1.5 image editing · ImageNet-R-TI2I realClip Directional Similarity: 0.2146 -> 0.2271Helped
Use FPE instead of the strongest baseline, MasaCtrlStable Diffusion 1.5 image editing · Wild-TI2I fakeClip Directional Similarity: 0.3474 -> 0.3116Hurt
Use FPE instead of the strongest baseline, P2PStable Diffusion 1.5 image editing · Wild-TI2I realClip Directional Similarity: 0.1930 -> 0.2234Helped

Surprising findings

Limitations

Experimental setup

Datasets: Wild-TI2I ImageNet-R-TI2I FlexIT prompts ImageNet Stanford Cars (CARS196)

Benchmarks: Wild-TI2I ImageNet-R-TI2I Car-fake-edit ImageNet-fake-edit Car-real-edit ImageNet-real-edit

Metrics: CLIP score CLIP directional similarity editing time per image

Baselines: P2P PnP SDEdit DiffEdit MasaCtrl Pix2pix-zero Shape-guided InstructPix2Pix

Builds on: Prompt-to-Prompt Plug-and-Play Null-text inversion SDEdit DDIM inversion

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy