DeContext as Defense: Safe Image Editing in Diffusion Transformers
On the map: Diffusion models → Robustness, privacy and adversarial aspects
Abstract (arXiv)
In-context diffusion models allow users to modify images with remarkable ease and realism. However, the same power raises serious privacy concerns: personal images can be easily manipulated for identity impersonation, misinformation, or other malicious uses, all without the owner's consent. While prior work has explored input perturbations to protect against misuse in personalized text-to-image generation, the robustness of modern, large-scale in-context DiT-based models remains largely unexamined. In this paper, we propose DeContext, a new method to safeguard input images from unauthorized in-context editing. Our key insight is that contextual information from the source image propagates to the output primarily through multimodal attention layers. By injecting small, targeted perturbations that weaken these cross-attention pathways, DeContext breaks this flow, effectively decouples the link between input and output. This simple defense is both efficient and robust. We further show that early denoising steps and specific transformer blocks dominate context propagation, which allows us to concentrate perturbations where they matter most. Experiments on Flux Kontext and Step1X-Edit show that DeContext consistently blocks unwanted image edits while preserving visual quality. These results highlight the effectiveness of attention-based perturbations as a powerful defense against image manipulation. Code is available at https://github.com/LinghuiiShen/DeContext.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Robustness, privacy and adversarial aspects, one of 14 directions in Diffusion models. Builds on 46 of its 61 references that are in the map. First posted on arXiv 18 Dec 2025.
Builds on
46 of 61 references.
Closest ancestors · 7
Same direction, newest first
- 2024Edit Away and My Face Will not Stay: Personal Biometric Defense against Malicious Generative Editing25 Nov
- 2024Privacy Protection in Personalized Diffusion Models via Targeted Cross-Attention Adversarial Attack25 Nov
- 2024Disrupting Diffusion: Token-Level Attention Erasure Attack against Diffusion-based Customization31 May
- 2024Perturbing Attention Gives You More Bang for the Buck: Subtle Imaging Perturbations That Efficiently Fool Customized Diffusion Models23 Apr
- 2023MetaCloak: Preventing Unauthorized Subject-driven Text-to-image Diffusion-based Synthesis via Meta-learning22 Nov
- 2023Raising the Cost of Malicious AI-Powered Image Editing13 Feb
- 2023Adversarial Example Does Good: Preventing Painting Imitation from Diffusion Models via Adversarial Examples9 Feb
Other references · 39
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
- 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,539
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
- 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understandingcited by 6,322
- 2022Scalable Diffusion Models with Transformerscited by 5,931
- 2023Adding Conditional Control to Text-to-Image Diffusion Modelscited by 5,466
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,290
- 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,094
- 2021GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Modelscited by 3,595
- 2022DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generationcited by 3,286
- 2022Prompt-to-Prompt Image Editing with Cross Attention Controlcited by 2,409
27 more
- 2021CLIPScore: A Reference-free Evaluation Metric for Image Captioningcited by 2,388
- 2022An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversioncited by 2,231
- 2023T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Modelscited by 1,339
- 2022eDiff-I: Text-to-Image Diffusion Models with an Ensemble of Expert Denoiserscited by 921
- 2022Plug-and-Play Diffusion Features for Text-Driven Image-to-Image Translationcited by 897
- 2023MasaCtrl: Tuning-Free Mutual Self-Attention Control for Consistent Image Synthesis and Editingcited by 722
- 2023Attend-and-Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Modelscited by 696
- 2021CogView: Mastering Text-to-Image Generation via Transformerscited by 691
- 2023MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generationcited by 529
- 2022All are Worth Words: A ViT Backbone for Diffusion Modelscited by 498
- 2022Paint by Example: Exemplar-based Image Editing with Diffusion Modelscited by 489
- 2025Step1X-Edit: A Practical Framework for General Image Editingcited by 417
- 2023AnyDoor: Zero-shot Object-level Image Customizationcited by 411
- 2023Analyzing and Improving the Training Dynamics of Diffusion Modelscited by 396
- 2022What the DAAM: Interpreting Stable Diffusion Using Cross Attentioncited by 233
- 2023Glaze: Protecting Artists from Style Mimicry by Text-to-Image Modelscited by 200
- 2023UniControl: A Unified Diffusion Model for Controllable Visual Generation In the Wildcited by 197
- 2021Unlearnable Examples: Making Personal Data Unexploitablecited by 188
- 2024InstantStyle: Free Lunch towards Style-Preserving in Text-to-Image Generationcited by 166
- 2019RetinaFace: Single-stage Dense Face Localisation in the Wildcited by 164
- 2024Implicit Style-Content Separation using B-LoRAcited by 135
- 2020SER-FIQ: Unsupervised Estimation of Face Image Quality Based on Stochastic Embedding Robustnesscited by 111
- 2024Latent Guard: a Safety Framework for Text-to-image Generationcited by 68
- 2025OminiControl2: Efficient Conditioning for Diffusion Transformerscited by 56
- 2023Robust Identity Perceptual Watermark Against Deepfake Face Swappingcited by 17
- 2024AlignGuard: Scalable Safety Alignment for Text-to-Image Generationcited by 17
- 2025Minimalist Concept Erasure in Generative Modelscited by 13
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026Immune2V: Image Immunization Against Dual-Stream Image-to-Video Generationcited by 3
- 2026BadWorld: Adversarial Attacks on World Modelscited by 3
- 2026Adversarial Attacks for Good: A Survey of Proactive Protection across the Visual Content Lifecyclecited by 0
- 2026NullEdit: Stealthy Image Protection via VLM Condition Redirectioncited by 0
- 2026Representation Learning in Diffusion and Flow-based Model: An Application Aspectcited by 0
- 2026A Survey on Adversarial Attacks and Defenses for Diffusion Models Across Multiple Modalitiescited by 0
- 2026A Survey on Adversarial Attacks and Defenses for Diffusion Models Across Multiple Modalities28 Aug 2026
- 2026Representation Learning in Diffusion and Flow-based Model: An Application Aspect25 Aug 2026
- 2026NullEdit: Stealthy Image Protection via VLM Condition Redirection11 Aug 2026
- 2026Adversarial Attacks for Good: A Survey of Proactive Protection across the Visual Content Lifecycle5 Aug 2026
- 2026BadWorld: Adversarial Attacks on World Models15 Jun 2026
- 2026Immune2V: Image Immunization Against Dual-Stream Image-to-Video Generation12 Apr 2026
Similar, not cited
Close in wording, no citation either way
- 2023EditShield: Protecting Unauthorized Image Editing by Instruction-guided Diffusion Models
- 2025Latent Diffusion Unlearning: Protecting Against Unauthorized Personalization Through Trajectory Shifted Perturbations
- 2025Anti-Diffusion: Preventing Abuse of Modifications of Diffusion-Based Models
- 2025Is Perturbation-Based Image Protection Disruptive to Image Editing?
- 2026Purify Once, Edit Freely: Breaking Image Protections under Model Mismatch
- 2024DiffusionGuard: A Robust Defense Against Malicious Diffusion-based Image Editing
- 2025Structure Disruption: Subverting Malicious Diffusion-Based Inpainting via Self-Attention Query Perturbation
- 2025EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing