SafeText: Safe Text-to-image Models via Aligning the Text Encoder
Not on the map. Why?
Abstract (arXiv)
Text-to-image models can generate harmful images when presented with unsafe prompts, posing significant safety and societal risks. Alignment methods aim to modify these models to ensure they generate only non-harmful images, even when exposed to unsafe prompts. A typical text-to-image model comprises two main components: 1) a text encoder and 2) a diffusion module. Existing alignment methods mainly focus on modifying the diffusion module to prevent harmful image generation. However, this often significantly impacts the model's behavior for safe prompts, causing substantial quality degradation of generated images. In this work, we propose SafeText, a novel alignment method that fine-tunes the text encoder rather than the diffusion module. By adjusting the text encoder, SafeText significantly alters the embedding vectors for unsafe prompts, while minimally affecting those for safe prompts. As a result, the diffusion module generates non-harmful images for unsafe prompts while preserving the quality of images for safe prompts. We evaluate SafeText on multiple datasets of safe and unsafe prompts, including those generated through jailbreak attacks. Our results show that SafeText effectively prevents harmful image generation with minor impact on the images for safe prompts, and SafeText outperforms six existing alignment methods. We will publish our code and data after paper acceptance.
Key facts. Cited by 7 papers in the map (data through 13 Oct 2026). Builds on 20 of its 30 references that are in the map. First posted on arXiv 28 Feb 2025.
Builds on
20 of 30 references.
References · 20
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,777
- 2014Microsoft COCO: Common Objects in Contextcited by 17,550
- 2018The Unreasonable Effectiveness of Deep Features as a Perceptual Metriccited by 11,082
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,379
- 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understandingcited by 6,339
- 2023BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Modelscited by 6,103
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,323
- 2022DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generationcited by 3,294
- 2023Latent Consistency Models: Synthesizing High-Resolution Images with Few-Step Inferencecited by 837
- 2021CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classificationcited by 806
- 2023Erasing Concepts from Diffusion Modelscited by 535
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 509
8 more
- 2024MACE: Mass Concept Erasure in Diffusion Modelscited by 303
- 2023Ring-A-Bell! How Reliable are Concept Removal Methods for Diffusion Models?cited by 248
- 2023MMA-Diffusion: MultiModal Attack on Diffusion Modelscited by 193
- 2023SneakyPrompt: Jailbreaking Text-to-image Generative Modelscited by 187
- 2023Unsafe Diffusion: On the Generation of Unsafe Images and Hateful Memes From Text-To-Image Modelscited by 174
- 2024Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Modelscited by 168
- 2023A Pilot Study of Query-Free Adversarial Attack against Stable Diffusioncited by 76
- 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Modelscited by 65
Built on by
Citing papers per year: 2025: 6; 2026: 1.
7 papers.
- 2025Set You Straight: Auto-Steering Denoising Trajectories to Sidestep Unwanted Conceptscited by 62
- 2025Erasing Concepts, Steering Generations: A Comprehensive Survey of Concept Suppressioncited by 10
- 2025Erased or Dormant? Rethinking Concept Erasure Through Reversibilitycited by 9
- 2025Red-Teaming Text-to-Image Systems by Rule-based Preference Modelingcited by 8
- 2025Responsible Diffusion: A Comprehensive Survey on Safety, Ethics, and Trust in Diffusion Modelscited by 3
- 2025PromptSafe: Gated Prompt Tuning for Safe Text-to-Image Generationcited by 2
- 2026ShieldCLIP: Selective Safety Alignment for Harmful Content Mitigation in Multimodal Foundation Modelscited by 0
- 2026ShieldCLIP: Selective Safety Alignment for Harmful Content Mitigation in Multimodal Foundation Models30 Sep 2026
- 2025Responsible Diffusion: A Comprehensive Survey on Safety, Ethics, and Trust in Diffusion Models25 Sep 2025
- 2025PromptSafe: Gated Prompt Tuning for Safe Text-to-Image Generation2 Aug 2025
- 2025Red-Teaming Text-to-Image Systems by Rule-based Preference Modeling27 May 2025
- 2025Erasing Concepts, Steering Generations: A Comprehensive Survey of Concept Suppression26 May 2025
- 2025Erased or Dormant? Rethinking Concept Erasure Through Reversibility22 May 2025
- 2025Set You Straight: Auto-Steering Denoising Trajectories to Sidestep Unwanted Concepts17 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2025SafeGuider: Robust and Practical Content Safety Control for Text-to-Image Models
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
- 2025Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models
- 2024Multimodal Pragmatic Jailbreak on Text-to-image Models
- 2024AlignGuard: Scalable Safety Alignment for Text-to-Image Generation
- 2025The Path to Reconciling Quality and Safety in Text-to-Image Generation: Dataset, Method, and Evaluation
- 2025Beautiful Images, Toxic Words: Understanding and Addressing Offensive Text in Generated Images