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 Khan, Qibin Hou, Yaxing Wang, jian Yang

Introduction

Text-to-image diffusion models have revolutionized digital content creation, yet they frequently struggle with linguistic negation. A common failure mode, known as the "negative target" problem, occurs when a model generates an object explicitly excluded by the prompt—for example, producing a man with spectacles when prompted for "a man without glasses." This phenomenon stems from the underlying training of models like Stable Diffusion, which learn strong semantic associations between concepts (e.g., "man" and "glasses") but fail to grasp the logical nuances of exclusion.

Existing solutions, such as negative prompts or model fine-tuning, are often inadequate. Negative prompts frequently alter the global style or composition of the image, while fine-tuning is computationally expensive and impractical for diverse, real-time requests. This research introduces a novel, two-step method to suppress unwanted content by manipulating text embeddings and attention maps directly, without requiring model retraining.

Methodology

The proposed approach addresses content suppression through two synergistic techniques: Soft-weighted Regularization (SWR) and Inference-time Text Embedding Optimization (ITO).

Soft-weighted Regularization (SWR)

A critical insight of this research is the role of the "End of Text" ([EOT]) padding tokens within the CLIP text encoder. These tokens are not merely placeholders; they contain a redundant, low-rank representation of the entire prompt's semantic content. Consequently, simply removing or zeroing out a specific word (like "glasses") is ineffective because the concept has already "leaked" into the trailing [EOT] tokens.

To combat this, the authors employ Singular Value Decomposition (SVD). By constructing a matrix comprising the negative target’s embedding and the [EOT] embeddings, the researchers can isolate the primary singular values that correspond to the unwanted semantic information. A decay function is then applied to these values, acting as a surgical strike to scrub the forbidden concept from the embedding space while preserving the rest of the prompt's integrity.

Inference-time Text Embedding Optimization (ITO)

While SWR significantly reduces the presence of the unwanted concept, residual "ghosts" may still persist in the generation process. To ensure complete suppression, the authors introduce an optimization loop during inference. This process utilizes two distinct loss functions:

  1. Negative Target Suppression Loss: This specifically weakens the cross-attention maps associated with the unwanted word, effectively instructing the model to ignore that concept during pixel synthesis.
  2. Positive Target Preservation Loss: This ensures that the suppression of the negative target does not inadvertently degrade the rest of the image. It maintains the structural and semantic fidelity of the positive elements (e.g., ensuring the "man" remains recognizable while his "glasses" are removed).

Experimental Results

The effectiveness of the SWR+ITO framework was evaluated across several benchmarks, including the COCO validation set, GQA-Inpaint, and various artistic style datasets.

Quantitative Performance

On the GQA-Inpaint dataset—a large-scale benchmark for object removal—the proposed method achieved a CLIP Accuracy of 92.8%. This significantly outperforms standard Stable Diffusion and even specialized editing models like Inst-Inpaint, which reached only 80.5%.

To further validate the suppression, the authors utilized "DetScore," a metric employing an object detector to verify the absence of forbidden items. In tests involving the prompt "a man without glasses," standard Stable Diffusion exhibited a failure rate (DetScore) of 0.819. The proposed method reduced this failure rate to 0.084, demonstrating a nearly tenfold improvement in suppression reliability.

Versatility and Applications

Beyond simple object exclusion, the method proves versatile in several domains:

  • Image Restoration: Successfully removing artifacts like rain or cracks from generated or real images.
  • Subject Replacement: By combining suppression with subject-strengthening techniques, the model can perform complex edits, such as changing a "toothbrush" to a "pen" without altering the surrounding context.
  • Style Suppression: Effectively removing specific artistic influences (e.g., Van Gogh's brushstrokes) from a generated output.

Limitations and Conclusion

The primary trade-off for this precision is computational speed. The optimization loop required during inference adds approximately 30 to 35 seconds of overhead on a high-end GPU (such as the Quadro RTX 3090). Additionally, the method's efficacy may decrease with extremely long or abstract prompts where the negative information is diffused across a larger embedding space.

Despite these challenges, this research provides a powerful new mechanism for controlling diffusion models. By leveraging the latent redundancy in [EOT] tokens and optimizing attention maps, the authors have moved closer to a generation process that truly understands what the user wants—and, more importantly, what they do not.

Summary updated

BibTeX
@inproceedings{li2024get,
  author = {Senmao Li and Joost van de Weijer and taihang Hu and Fahad 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