Date: dynamic attention-based toxicity elimination mechanism for safe image generation
摘要
Text-to-Image generation models excel at producing high-quality images aligned with textual prompts but are prone to generating inappropriate or harmful content due to uncurated training datasets. To address this, we propose a novel method that dynamically regulates the influence of harmful tokens while preserving the contextual coherence of the input prompt. Our approach leverages a fine-grained token-level modulation mechanism within the attention framework, enabling safe generation without additional model training. It can be seamlessly integrated as a plug-in module into existing safety filters. Extensive experiments on diverse benchmark datasets demonstrate that when used alongside existing safety mechanisms, our method significantly enhances the removal of harmful concepts while maintaining semantic alignment and image quality. This study highlights a practical and generalizable strategy for improving the safety of text-to-image generation models.