The success of diffusion-based inpainting models has enabled high-quality, prompt-guided image manipulation, but has also introduced significant risks of malicious misuse. Existing adversarial defenses, which primarily focus on inducing image-level in...
The success of diffusion-based inpainting models has enabled high-quality, prompt-guided image manipulation, but has also introduced significant risks of malicious misuse. Existing adversarial defenses, which primarily focus on inducing image-level inconsistencies, suffer from a critical and fundamental vulnerability. They are easily bypassed when a user amplifies the prompt's influence by increasing the Classifier-Free Guidance (CFG) scale. In this paper, we address this core limitation by proposing a novel, prompt-generalized defense mechanism that targets the text-image alignment process directly. Instead of targeting image features, we disrupt the cross-attention mechanism. Our key idea is to identify and target the Beginning-of-Sequence (BOS) token, which is universally present in all prompts yet carries no semantic information. We introduce a novel objective function that optimizes imperceptible perturbation. This perturbation forces the model to ignore all meaningful semantic tokens in a malicious prompt and divert its attention exclusively to the uninformative BOS token, effectively neutralizing the prompt's guidance. Extensive experiments on the EditBench dataset demonstrate that our method achieves state-of-the-art performance in suppressing malicious generation. Most importantly, it is the only method that remains robust against high CFG scales, resolving the critical failure point of prior work. Attention map visualizations empirically confirm that our mechanism successfully diverts attention as intended. Finally, our approach is also 2-7 times faster and more efficient about memory than existing methods, making it a robust and practical solution for protecting images against unauthorized manipulation.