NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models

Senmao Li, Joost van de Weijer, Taihang Hu, Fahad Shahbaz Khan, Qibin Hou, Yaxing Wang, Jian Yang

TL;DR

Current text-to-image diffusion models frequently ignore negative constraints in prompts, stubbornly generating objects users explicitly ask to omit (e.g., adding glasses when prompted for "a man without glasses"). This paper introduces a training-free, plug-and-play method that scrubs unwanted concepts from text embeddings by regularizing their underlying singular values and optimizing cross-attention maps during inference. The result is precise content suppression without sacrificing image quality or altering the rest of the scene.

What Problem Does This Paper Address?

If you ask a state-of-the-art diffusion model like Stable Diffusion or DeepFloyd-IF to generate "a man without glasses," there is a frustratingly high probability it will give you a man with glasses anyway. While these models excel at composition, they struggle heavily with negation.

Why does this happen? The authors dive deep into the text encoders (like CLIP and T5) that guide these models. They discover a fascinating architectural quirk: the End-of-Text ([EOT]) padding tokens appended to the end of a prompt aren't just empty placeholders. Instead, they act as a semantic sponge, absorbing a low-rank, highly redundant copy of the entire prompt's meaning.

Because of this, naively zeroing out the embedding for the word "glasses" fails. The concept of "glasses" remains leaked and distributed across all the trailing [EOT] tokens, which continue to broadcast the unwanted object to the image generator.

Figure 1: Failure cases of Stable Diffusion (SD) and DeepFloyd-IF. Given the prompt ”A man with- out glasses”, both SD and DeepFloyd-IF fail to suppress the generation of negative target glasses. Our method successfully removes the ”glasses”. (Right) we use DetScore (see Sec. 4) to detect the ”glasses” from 1000 generated images. The DetScore of SD with prompt ”A face without glasses” is 0.122. See Appendix E for additional examples.

Methods

To surgically remove negative targets without breaking the rest of the image, the authors propose a two-step, training-free approach:

  1. Soft-weighted Regularization (SWR): The authors isolate the negative target embedding along with the [EOT] embeddings and stack them into a matrix. They perform Singular Value Decomposition (SVD) on this matrix to isolate the principal semantic components. Instead of completely zeroing out these values (which causes severe structural distortion), they apply a smooth mathematical decay function ($\hat{\sigma} = e^{-\sigma} * \sigma$). This shrinks the dominant singular values associated with the unwanted concept while preserving the broader context.
  2. Inference-time Text Embedding Optimization (ITO): During the early steps of the image generation process, the method dynamically fine-tunes the text embeddings using two attention-based losses:
  3. Negative target prompt suppression loss: Actively weakens the spatial cross-attention maps where the unwanted object tries to form.
  4. Positive target prompt preservation loss: Protects and strengthens the attention maps of the desired subjects (e.g., the man's face), ensuring the background and core structure remain stable.

Datasets

The authors evaluated their approach across several distinct tasks using both generated and real images:

  • COCO Validation Set: 100 randomly selected captions used to evaluate general object suppression.
  • Style Erasure Datasets: 50 prompts for Van Gogh style and 40 prompts for artist Tyler Edlin (sourced from the Erasing Concepts benchmark) to test artistic style suppression.
  • Unsplash & COCO Images: 100 real images paired with text prompts to evaluate real-world image editing performance.
  • GQA-Inpaint Dataset: A massive benchmark consisting of 18,883 unique source-target-prompt pairs specifically designed to evaluate object removal accuracy.

Key Insights and Ideas

  • The [EOT] Leak: The core "aha moment" is realizing that padding tokens carry significant, redundant semantic weight. Any attempt to edit or suppress text concepts must account for the trailing [EOT] tokens.
  • Soft Decay over Hard Thresholds: Completely erasing tokens or singular values ruins image fidelity. Soft-weighting via SVD allows the system to dim the concept of the negative target without destroying the structural integrity of the embedding space.
  • Attention as a Spatial Guide: By optimizing embeddings directly against cross-attention maps at inference time, the model can dynamically steer pixels away from generating the negative target in real time.

Key Results

  • Dramatic DetScore Reductions: When generating images for "a man without glasses," standard Stable Diffusion yields a DetScore (the probability of an object detector finding glasses) of 0.819. The authors' method plummets this score to 0.084, vastly outperforming standard negative prompting (0.140).
  • Outperforming Supervised Models: On the GQA-Inpaint object removal benchmark, this training-free method achieved a Top-1 CLIP Accuracy of 92.8%, beating Inst-Inpaint (80.5%), a specialized model trained explicitly on paired image data.
  • Versatile Generalization: The framework successfully suppresses content in both latent-space models (Stable Diffusion) and pixel-space models (DeepFloyd-IF). It can even be inverted to strengthen desired content or perform image restoration tasks like removing rain and cracks.

Limitations and Future Work

  • Inference Overhead: Because the method performs optimization iterations at test time, it adds roughly 35 seconds of computational overhead per image on a Quadro RTX 3090 GPU. This makes it less ideal for real-time applications without further engineering optimization.
  • Sensitivity to Prompt Length: The method is highly effective for concise prompts but struggles with exceptionally long, descriptive sentences. In lengthy prompts, information about the negative target diffuses into other adjacent word embeddings, making it harder to cleanly isolate within the [EOT] matrix.

Summary updated

BibTeX
@inproceedings{li2024get,
  author = {Senmao Li and Joost van de Weijer and Taihang Hu and Fahad Shahbaz Khan and Qibin Hou and Yaxing Wang and Jian Yang},
  title = {{Get What You Want, Not What You Don't: Image Content Suppression for Text-to-Image Diffusion Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=zpVPhvVKXk},
}
Figure