Skip to content
Preprint

DiSCO: Defending text-to-image generation through distribution-guided contrastive prompt optimization

Aug 2026 · 0 citations · 32 references
Computer Science

TL;DR

DiSCO is proposed, a zero-shot, strictly black-box defense that operates entirely at the prompt level as a plug-and-play module, requiring no model retraining, fine-tuning, or access to model internals, and can be readily applied to any text-to-image system without necessitating any changes to the model itself.

Abstract

As text-to-image generative models advance, they raise critical safety concerns, particularly the generation of Not-Safe-For-Work (NSFW) content such as violence and nudity, further exacerbated by red-teaming adversarial attacks. Existing defenses predominantly operate under white-box assumptions, relying on text encoder optimization, weight editing, or inference-time intervention, and fundamentally cannot scale to proprietary models. Black-box alternatives based on LLM prompt rewriting offer broader applicability, yet fail in a critical regime we identify as the \textit{benign adversarial} problem: prompts that are linguistically safe but still trigger harmful generation due to the model's learned data distribution. We propose DiSCO, a zero-shot, strictly black-box defense that operates entirely at the prompt level as a plug-and-play module, requiring no model retraining, fine-tuning, or access to model internals. DiSCO performs distribution-guided suffix expansion via beam search, optimized through contrastive scoring over safe and unsafe image pools generated by the target model itself, with iterative adaptive feedback until safe content is produced. We demonstrate that DiSCO consistently enhances the safety of both undefended and defended models on the I2P benchmark under multiple red-teaming attacks, achieving 37.7% and 25.13% ASR reduction, respectively, while maintaining semantic fidelity and improving image coherence. As a black-box, architecture-agnostic module, DiSCO can be readily applied to any text-to-image system without necessitating any changes to the model itself.

View source

Similar papers

Jul 2026

Dynamic Defense Profiling Enables Cognitive Jailbreak of Text-to-Image Models

This paper proposes MIND, a cognitive jailbreak framework that reframes adversarial prompt generation as a belief-state inference problem over latent defense mechanisms and actively models the target system's latent defense mechanisms by interpreting multi-modal feedback as high-density signals.

Dongdong Yang, Deyue Zhang, Zhao Liu et al. · 0 citations
Preprint Aug 2026

TEA: Text Encoder Alignment for Robust Concept Erasure in Text-to-Image Models

A lightweight Text Encoder Alignment framework that fine-tunes only the text encoder while keeping the generative backbone fully frozen, and achieves state-of-the-art erasure robustness against black-box and white-box adversarial attacks on Stable Diffusion v1.4, while preserving generation quality on benign prompts.

Alireza Dehghanpour Farashah, Zhuan Shi, Negar Rostamzadeh et al. · 0 citations
Preprint Aug 2026

Test-Time Scaling for Safe Text-Guided Image Generation via Intermediate Clean Estimates

A scalable and flexible solution for safe generative deployment that allows weight-preserving detection, keeps non-violating inference latency nearly unchanged as the maximum budget increases, and offers flexibility in safety performance via test-time scaling.

Jinya Sakurai, Shueicheng Yan, Xun Xu · 0 citations
Jul 2026

Introspective Attention Modulation for Safe Text-to-Image Generation

The results reveal that attention-space regulation offers a considerably more promising path to safer diffusion transformer based image generation than the existing concept erasing mechanism.

Basim Azam, Hossein Rahmani, Naveed Akhtar · 0 citations
Jul 2026

GhostPrompt: Cross-Image Adversarial Prompt for Vision-Language Models

Vision-Language Models (VLMs) are known to be vulnerable to adversarial attacks, where subtle perturbations to images or texts induce erroneous outputs. However, most text-based attacks are adapted from language-model-centric methods, in which the visual input is fixed during optimization, resulting in adversarial prom...

Li Zeng, Ze-Yu Ye, Meng Xie et al. · 0 citations
2026

Patronus: Safeguarding Text-to-Image Models Against Adversarial Fine-Tuning

Text-to-image (T2I) models can be exploited to produce unsafe images. Existing safety measures, e.g., content moderation or model alignment, can be weakened by adversaries who attempt to restore unsafe generation through model fine-tuning. This paper presents Patronus, a defensive framework that improves T2I models’ re...

Xin-Feng Li, Sheng-Yuan Pang, Jialin Wu et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.