SafeGuider: Robust and Practical Content Safety Control for Text-to-Image Models
On the map: LLM safety and security → Vision-language and text-to-image safety
Abstract (arXiv)
Text-to-image models have shown remarkable capabilities in generating high-quality images from natural language descriptions. However, these models are highly vulnerable to adversarial prompts, which can bypass safety measures and produce harmful content. Despite various defensive strategies, achieving robustness against attacks while maintaining practical utility in real-world applications remains a significant challenge. To address this issue, we first conduct an empirical study of the text encoder in the Stable Diffusion (SD) model, which is a widely used and representative text-to-image model. Our findings reveal that the [EOS] token acts as a semantic aggregator, exhibiting distinct distributional patterns between benign and adversarial prompts in its embedding space. Building on this insight, we introduce SafeGuider, a two-step framework designed for robust safety control without compromising generation quality. SafeGuider combines an embedding-level recognition model with a safety-aware feature erasure beam search algorithm. This integration enables the framework to maintain high-quality image generation for benign prompts while ensuring robust defense against both in-domain and out-of-domain attacks. SafeGuider demonstrates exceptional effectiveness in minimizing attack success rates, achieving a maximum rate of only 5.48% across various attack scenarios. Moreover, instead of refusing to generate or producing black images for unsafe prompts, SafeGuider generates safe and meaningful images, enhancing its practical utility. In addition, SafeGuider is not limited to the SD model and can be effectively applied to other text-to-image models, such as the Flux model, demonstrating its versatility and adaptability across different architectures. We hope that SafeGuider can shed some light on the practical deployment of secure text-to-image systems.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Vision-language and text-to-image safety, one of 12 directions in LLM safety and security. Builds on 27 of its 48 references that are in the map. First posted on arXiv 5 Oct 2025.
Builds on
27 of 48 references.
Closest ancestors · 7
Same direction, newest first
- 2024ART: Automatic Red-teaming for Text-to-Image Models to Protect Benign Users24 May
- 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models10 Apr
- 2024GuardT2I: Defending Text-to-Image Models from Adversarial Prompts3 Mar
- 2023Ring-A-Bell! How Reliable are Concept Removal Methods for Diffusion Models?16 Oct
- 2023Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Prompts12 Sep
- 2023SneakyPrompt: Jailbreaking Text-to-image Generative Models20 May
- 2022Red-Teaming the Stable Diffusion Safety Filter3 Oct
Other references · 20
- 2017Attention Is All You Needcited by 60,361
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2014Microsoft COCO: Common Objects in Contextcited by 17,608
- 2018The Unreasonable Effectiveness of Deep Features as a Perceptual Metriccited by 11,177
- 2020Denoising Diffusion Implicit Modelscited by 9,781
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 513
- 2023Directly Fine-Tuning Diffusion Models on Differentiable Rewardscited by 448
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 236
- 2023Stable Bias: Analyzing Societal Representations in Diffusion Modelscited by 226
- 2023Glaze: Protecting Artists from Style Mimicry by Text-to-Image Modelscited by 205
- 2023Unsafe Diffusion: On the Generation of Unsafe Images and Hateful Memes From Text-To-Image Modelscited by 175
- 2022Can Machines Help Us Answering Question 16 in Datasheets, and In Turn Reflecting on Inappropriate Content?cited by 155
8 more
- 2023Prompt Stealing Attacks Against Text-to-Image Generation Modelscited by 51
- 2023SurrogatePrompt: Bypassing the Safety Filter of Text-to-Image Models via Substitutioncited by 34
- 2021Exploring the Role of BERT Token Representations to Explain Sentence Probing Resultscited by 29
- 2024Moderator: Moderating Text-to-Image Diffusion Models through Fine-grained Context-based Policiescited by 15
- 2020Influence Patterns for Explaining Information Flow in BERTcited by 14
- 2024GenderCARE: A Comprehensive Framework for Assessing and Reducing Gender Bias in Large Language Modelscited by 9
- 2024Image-Perfect Imperfections: Safety, Bias, and Authenticity in the Shadow of Text-To-Image Model Evolutioncited by 7
- 2024Understanding Implosion in Text-to-Image Generative Modelscited by 6
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026TrajShield: Trajectory-Level Safety Mediation for Defending Text-to-Video Models Against Jailbreak Attackscited by 1
- 2026What Concepts Lie Within? Detecting and Suppressing Risky Content in Diffusion Transformerscited by 1
- 2026VLMShield: Efficient and Robust Defense of Vision-Language Models against Malicious Promptscited by 0
- 2026Babel: Jailbreaking Safety Attention via Obfuscation Distribution Optimized Samplingcited by 0
- 2026Robust and Generalizable Safety Steering for Text-to-Image Diffusion Transformerscited by 0
- 2026AEGIS: A Mechanism-Guided Defense against Visual Synonym Jailbreaks in Text-to-Image Modelscited by 0
- 2026AEGIS: A Mechanism-Guided Defense against Visual Synonym Jailbreaks in Text-to-Image Models7 Jul 2026
- 2026Robust and Generalizable Safety Steering for Text-to-Image Diffusion Transformers28 May 2026
- 2026Babel: Jailbreaking Safety Attention via Obfuscation Distribution Optimized Sampling18 May 2026
- 2026What Concepts Lie Within? Detecting and Suppressing Risky Content in Diffusion Transformers11 May 2026
- 2026TrajShield: Trajectory-Level Safety Mediation for Defending Text-to-Video Models Against Jailbreak Attacks3 May 2026
- 2026VLMShield: Efficient and Robust Defense of Vision-Language Models against Malicious Prompts7 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
- 2025SafeText: Safe Text-to-image Models via Aligning the Text Encoder
- 2025Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models
- 2026SafeCtrl: Region-Aware Safety Control for Text-to-Image Diffusion via Detect-Then-Suppress
- 2025Patronus: Safeguarding Text-to-Image Models against White-Box Adversaries
- 2026DTVI: Dual-Stage Textual and Visual Intervention for Safe Text-to-Image Generation
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models
- 2025Beyond the Safety Tax: Mitigating Unsafe Text-to-Image Generation via External Safety Rectification