Training-Free Safe Text Embedding Guidance for Text-to-Image Diffusion Models
Byeonghu Na, Mina Kang, Jiseok Kwak, Minsang Park, Jiwoo Shin, SeJoon Jun, Gayoung Lee, Jin-Hwa Kim, Il-Chul Moon
Abstract
Text-to-image models have recently made significant advances in generating realistic and semantically coherent images, driven by advanced diffusion models and large-scale web-crawled datasets. However, these datasets often contain inappropriate or biased content, raising concerns about the generation of harmful outputs when provided with malicious text prompts. We propose Safe Text embedding Guidance (STG), a training-free approach to improve the safety of diffusion models by guiding the text embeddings during sampling. STG adjusts the text embeddings based on a safety function evaluated on the expected final denoised image, allowing the model to generate safer outputs without additional training. Theoretically, we show that STG aligns the underlying model distribution with safety constraints, thereby achieving safer outputs while minimally affecting generation quality. Experiments on various safety scenarios, including nudity, violence, and artist-style removal, show that STG consistently outperforms both training-based and training-free baselines in removing unsafe content while preserving the core semantic intent of input prompts. Our code is available at https://github.com/aailab-kaist/STG.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 6aa30e84-4aeb-46e7-b815-4ebe7af9f65dCited by top-tier papers2
- SafeRoPE: Risk-specific Head-wise Embedding Rotation for Safe Generation in Rectified Flow TransformersXiang Yang, Feifei Li, Mi Zhang, Geng Hong et al.CVPR 2026 · 2 citations
- Inference Time Concept Removal Guidance for Text-to-Image Diffusion ModelsYoonseok Choi, Chaeyoung Oh, Hyunjun Choi, Seokin Seo et al.ICML 2026
Builds on28
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- Diffusion Models Beat GANs on Image SynthesisPrafulla Dhariwal, Alexander Quinn NicholNeurIPS 2021 · 13,211 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- Denoising Diffusion Implicit ModelsJiaming Song, Chenlin Meng, Stefano ErmonICLR 2021 · 11,743 citations
Related papers
- SafeCFG: Controlling Harmful Features with Dynamic Safe Guidance for Safe GenerationJiadong Pan, Liang Li, Hongcheng Gao, Zheng-Jun Zha et al.ACM MM 2025
- SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image ModelsXinfeng Li, Yuchen Yang, Jiangyi Deng, Chen Yan et al.CCS 2024 · 8 citations
- Training-Free Safe Denoisers for Safe Use of Diffusion ModelsMingyu Kim, Dongjun Kim, Amman Yusuf, Stefano Ermon et al.NeurIPS 2025 · 21 citations
- PurifyGen: A Risk-Discrimination and Semantic-Purification Model for Safe Text-to-Image GenerationZongsheng Cao, Yangfan He, Anran Liu, Jun Xie et al.ACM MM 2025 · 3 citations
- SafeGuider: Robust and Practical Content Safety Control for Text-to-Image ModelsPeigui Qi, Kunsheng Tang, Wenbo Zhou, Weiming Zhang et al.CCS 2025
