cs.CVApr 5, 2026

SafeCtrl: Region-Aware Safety Control for Text-to-Image Diffusion via Detect-Then-Suppress

Authors: Lingyun Zhang, Yu Xie, Zhongli Fang, Yu Liu, Ping Chen

Organizations: School of Computer Science and Technology, Fudan University, China · Institute of Big Data, Fudan University, China · Nanjing University of Information Science and Technology, China

Abstract

The widespread deployment of text-to-image diffusion models is significantly challenged by the generation of visually harmful content, such as sexually explicit content, violence, and horror imagery. Common safety interventions, ranging from input filtering to model concept erasure, often suffer from two critical limitations: (1) a severe trade-off between safety and context preservation, where removing unsafe concepts degrades the fidelity of the safe content, and (2) vulnerability to adversarial attacks, where safety mechanisms are easily bypassed. To address these challenges, we propose SafeCtrl, a Region-Aware safety control framework operating on a Detect-Then-Suppress paradigm. Unlike global safety interventions, SafeCtrl first employs an attention-guided Detect module to precisely localize specific risk regions. Subsequently, a localized Suppress module, optimized via image-level Direct Preference Optimization (DPO), neutralizes harmful semantics only within the detected areas, effectively transforming unsafe objects into safe alternatives while leaving the surrounding context intact. Extensive experiments across multiple risk categories demonstrate that SafeCtrl achieves a superior trade-off between safety and fidelity compared to state-of-the-art methods. Crucially, our approach exhibits improved resilience against adversarial prompt attacks, offering a precise and robust solution for responsible generation.

Figures & tables

Explore similar work

CardsList
  1. Disciplined Diffusion: Text-to-Image Diffusion Model against NSFW Generation

    May 1, 2026Chi Zhang, Changjia Zhu, Xiaowen Li +2Adversarial RobustnessSafe T2I Generation

  2. Introspective Attention Modulation for Safe Text-to-Image Generation

    Jul 16, 2026Basim Azam, Hossein Rahmani, Naveed AkhtarDiffusion TransformerT2I Generation

  3. Modular Energy Steering for Safe Text-to-Image Generation with Foundation Models

    Apr 2, 2026Yaoteng Tan, Zikui Cai, M. Salman AsifSafe T2I GenerationT2I Diffusion Models