SAFE: A Plug-and-Play Framework for Prompt Optimization in Text-to-Image Safety

Jisu Shin, Sol Lee, Sungrae Hong, A Young Kim, Mun Yong Yi


Abstract
With recent advances in diffusion models, text-to-image (T2I) generation has achieved remarkable progress, producing high-quality images from simple text prompts. However, as these models have become more expressive, concerns regarding the generation of unsafe or inappropriate content have grown. To address this issue, we propose the Safety-Adjustable Framework for Ethics (Safe), a novel training-free, plug-and-play prompt optimization framework. Leveraging the reasoning capabilities of large language models (LLMs), Safe optimizes prompts to meet concept-specific safety requirements while preserving their original semantics. The framework operates in three stages: (1) generating an image from the original prompt using a pretrained T2I model, (2) analyzing the generated image with a vision-language model (VLM), and (3) conducting DAG-based reasoning over both the prompt and the image description to produce refined prompt. In addition, Safe uses a search module to incorporate external knowledge such as cultural norms and legal constraints, enabling adaptation to diverse user contexts. Extensive experiments demonstrate that Safe effectively complements existing safety methods and achieves strong performance in user-centric safety alignment.
Anthology ID:
2026.emnlp-main.2069
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
47109–47130
Language:
URL:
https://aclanthology.org/2026.emnlp-main.2069/
DOI:
Bibkey:
Cite (ACL):
Jisu Shin, Sol Lee, Sungrae Hong, A Young Kim, and Mun Yong Yi. 2026. SAFE: A Plug-and-Play Framework for Prompt Optimization in Text-to-Image Safety. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 47109–47130, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
SAFE: A Plug-and-Play Framework for Prompt Optimization in Text-to-Image Safety (Shin et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.2069.pdf