Lune

NeurIPS2023Top-tier venue

Dynamic Prompt Learning: Addressing Cross-Attention Leakage for Text-Based Image Editing

Kai Wang, Fei Yang, Shiqi Yang, Muhammad Atif Butt, Joost van de Weijer

Abstract

Large-scale text-to-image generative models have been a ground-breaking development in generative AI, with diffusion models showing their astounding ability to synthesize convincing images following an input text prompt. The goal of image editing research is to give users control over the generated images by modifying the text prompt. Current image editing techniques are susceptible to unintended modifications of regions outside the targeted area, such as on the background or on distractor objects which have some semantic or visual relationship with the targeted object. According to our experimental findings, inaccurate cross-attention maps are at the root of this problem. Based on this observation, we propose Dynamic Prompt Learning (DPL) to force cross-attention maps to focus on correct noun words in the text prompt. By updating the dynamic tokens for nouns in the textual input with the proposed leakage repairment losses, we achieve fine-grained image editing over particular objects while preventing undesired changes to other image regions. Our method DPL, based on the publicly available Stable Diffusion, is extensively evaluated on a wide range of images, and consistently obtains superior results both quantitatively (CLIP score, Structure-Dist) and qualitatively (on user-evaluation). We show improved prompt editing results for Word-Swap, Prompt Refinement, and Attention Re-weighting, especially for complex multi-object scenes.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

29 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models cites Denoising Diffusion Implicit Models
  • Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models cites Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding
  • Free-Lunch Color-Texture Disentanglement for Stylized Image Generation cites Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models
  • Free-Lunch Color-Texture Disentanglement for Stylized Image Generation cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Free-Lunch Color-Texture Disentanglement for Stylized Image Generation cites Token Merging for Training-Free Semantic Binding in Text-to-Image Synthesis
  • Free-Lunch Color-Texture Disentanglement for Stylized Image Generation cites Learning Transferable Visual Models From Natural Language Supervision
  • Free-Lunch Color-Texture Disentanglement for Stylized Image Generation cites Denoising Diffusion Implicit Models
  • Free-Lunch Color-Texture Disentanglement for Stylized Image Generation cites Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding
  • High-Resolution Image Synthesis with Latent Diffusion Models cites Zero-Shot Text-to-Image Generation
  • High-Resolution Image Synthesis with Latent Diffusion Models cites Denoising Diffusion Implicit Models
  • Token Merging for Training-Free Semantic Binding in Text-to-Image Synthesis cites Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models
  • Token Merging for Training-Free Semantic Binding in Text-to-Image Synthesis cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Token Merging for Training-Free Semantic Binding in Text-to-Image Synthesis cites Learning Transferable Visual Models From Natural Language Supervision
  • Zero-Shot Text-to-Image Generation cites Learning Transferable Visual Models From Natural Language Supervision
  • EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing cites High-Resolution Image Synthesis with Latent Diffusion Models
  • EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing cites Zero-Shot Text-to-Image Generation
  • EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing cites Learning Transferable Visual Models From Natural Language Supervision
  • Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models cites Learning Transferable Visual Models From Natural Language Supervision
  • Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models cites Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites High-Resolution Image Synthesis with Latent Diffusion Models
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites Zero-Shot Text-to-Image Generation
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites Learning Transferable Visual Models From Natural Language Supervision
  • Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding cites Denoising Diffusion Implicit Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers29

  1. Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion ModelsSenmao Li, Joost van de Weijer, Taihang Hu, Fahad Shahbaz Khan et al.ICLR 2024 · 56 citations
  2. Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion ModelsDominik Hintersdorf, Lukas Struppek, Kristian Kersting, Adam Dziedzic et al.NeurIPS 2024 · 46 citations
  3. Token Merging for Training-Free Semantic Binding in Text-to-Image SynthesisTaihang Hu, Linxuan Li, Joost van de Weijer, Hongcheng Gao et al.NeurIPS 2024 · 45 citations
  4. EditMGT: Unleashing Potentials of Masked Generative Transformers in Image EditingWei Chow, Linfeng Li, Lingdong Kong, Zefeng Li et al.CVPR 2026 · 14 citations
  5. Free-Lunch Color-Texture Disentanglement for Stylized Image GenerationJiang Qin, Alexandra Gomez-Villa, Senmao Li, Shiqi Yang et al.NeurIPS 2025 · 12 citations

Builds on31

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  2. High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
  3. Denoising Diffusion Implicit ModelsJiaming Song, Chenlin Meng, Stefano ErmonICLR 2021 · 11,743 citations
  4. Photorealistic Text-to-Image Diffusion Models with Deep Language UnderstandingChitwan Saharia, William Chan, Saurabh Saxena, Lala Li et al.NeurIPS 2022 · 8,965 citations
  5. Zero-Shot Text-to-Image GenerationAditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray et al.ICML 2021 · 6,356 citations

Related papers

  1. Multi-Region Text-Driven Manipulation of Diffusion ImageryYiming Li, Peng Zhou, Jun Sun, Yi XuAAAI 2024 · 4 citations
  2. An Item Is Worth a Prompt: Versatile Image Editing with Disentangled ControlAosong Feng, Weikang Qiu, Jinbin Bai, Zhen Dong et al.AAAI 2025 · 9 citations
  3. Training-Free Structured Diffusion Guidance for Compositional Text-to-Image SynthesisWeixi Feng, Xuehai He, Tsu-Jui Fu, Varun Jampani et al.ICLR 2023 · 70 citations
  4. MAG-Edit: Localized Image Editing in Complex Scenarios via Mask-Based Attention-Adjusted GuidanceQi Mao, Lan Chen, Yuchao Gu, Zhen Fang et al.ACM MM 2024 · 7 citations
  5. Prompt Tuning Inversion for Text-Driven Image Editing Using Diffusion ModelsWenkai Dong, Song Xue, Xiaoyue Duan, Shumin HanICCV 2023 · 104 citations
Dusk over the sea between two cliffs drawn in fine vertical lines