mlsanityData to 14 Oct 2026

In-Context Brush: Zero-shot Customized Subject Insertion with Context-Aware Latent Space Manipulation

arXiv 2505.20271 ↗First posted 26 May 2025cs.CV cs.AI cs.GRcited by 7

On the map: Diffusion models → 3D, point cloud and scene generation

Abstract (arXiv)

Recent advances in diffusion models have enhanced multimodal-guided visual generation, enabling customized subject insertion that seamlessly "brushes" user-specified objects into a given image guided by textual prompts. However, existing methods often struggle to insert customized subjects with high fidelity and align results with the user's intent through textual prompts. In this work, we propose "In-Context Brush", a zero-shot framework for customized subject insertion by reformulating the task within the paradigm of in-context learning. Without loss of generality, we formulate the object image and the textual prompts as cross-modal demonstrations, and the target image with the masked region as the query. The goal is to inpaint the target image with the subject aligning textual prompts without model tuning. Building upon a pretrained MMDiT-based inpainting network, we perform test-time enhancement via dual-level latent space manipulation: intra-head "latent feature shifting" within each attention head that dynamically shifts attention outputs to reflect the desired subject semantics and inter-head "attention reweighting" across different heads that amplifies prompt controllability through differential attention prioritization. Extensive experiments and applications demonstrate that our approach achieves superior identity preservation, text alignment, and image quality compared to existing state-of-the-art methods, without requiring dedicated training or additional data collection.

Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in 3D, point cloud and scene generation, one of 14 directions in Diffusion models. Builds on 47 of its 62 references that are in the map. First posted on arXiv 26 May 2025.

Builds on

47 of 62 references.

Closest ancestors · 2

Same direction, newest first

  1. 2025OmniPaint: Mastering Object-Oriented Editing via Disentangled Insertion-Removal Inpainting11 Mar
  2. 2024ObjectDrop: Bootstrapping Counterfactuals for Photorealistic Object Removal and Insertion27 Mar

Other references · 45

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
  4. 2023GPT-4 Technical Reportcited by 18,396
  5. 2014Microsoft COCO: Common Objects in Contextcited by 17,608
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  7. 2023Segment Anythingcited by 8,234
  8. 2022Scalable Diffusion Models with Transformerscited by 6,054
  9. 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,356
  10. 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,181
  11. 2023Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detectioncited by 3,332
  12. 2022DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generationcited by 3,300
33 more
  1. 2022Emergent Abilities of Large Language Modelscited by 2,512
  2. 2022Prompt-to-Prompt Image Editing with Cross Attention Controlcited by 2,431
  3. 2022An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversioncited by 2,245
  4. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  5. 2022A Survey on In-context Learningcited by 721
  6. 2022Paint by Example: Exemplar-based Image Editing with Diffusion Modelscited by 489
  7. 2023AnyDoor: Zero-shot Object-level Image Customizationcited by 412
  8. 2022Images Speak in Images: A Generalist Painter for In-Context Visual Learningcited by 318
  9. 2023Break-A-Scene: Extracting Multiple Concepts from a Single Imagecited by 231
  10. 2023Style Aligned Image Generation via Shared Attentioncited by 216
  11. 2023Interpreting CLIP's Image Representation via Text-Based Decompositioncited by 196
  12. 2023TF-ICON: Diffusion-Based Training-Free Cross-Domain Image Compositioncited by 182
  13. 2024In-Context LoRA for Diffusion Transformerscited by 158
  14. 2024Training-Free Consistent Text-to-Image Generationcited by 125
  15. 2023In-Context Learning Unlocked for Diffusion Modelscited by 104
  16. 2024Zero-shot Image Editing with Reference Imitationcited by 65
  17. 2024IMPRINT: Generative Object Compositing by Learning Identity-Preserving Representationcited by 64
  18. 2024TurboEdit: Text-Based Image Editing Using Few-Step Diffusion Modelscited by 64
  19. 2025Insert Anything: Image Insertion via In-Context Editing in DiTcited by 61
  20. 2023Custom-Edit: Text-Guided Image Editing with Customized Diffusion Modelscited by 54
  21. 2024Large-Scale Text-to-Image Model with Inpainting is a Zero-Shot Subject-Driven Image Generatorcited by 48
  22. 2023Photoswap: Personalized Subject Swapping in Imagescited by 47
  23. 2023DreamEdit: Subject-driven Image Editingcited by 37
  24. 2024FreeEdit: Mask-free Reference-based Image Editing with Multi-modal Instructioncited by 36
  25. 2024InstantSwap: Fast Customized Concept Swapping across Sharp Shape Differencescited by 34
  26. 2024Tuning-Free Image Customization with Image and Text Guidancecited by 25
  27. 2023Context Diffusion: In-Context Aware Image Generationcited by 21
  28. 2024PrimeComposer: Faster Progressively Combined Diffusion for Image Composition with Attention Steeringcited by 20
  29. 2024ObjectMate: A Recurrence Prior for Object Insertion and Subject-Driven Generationcited by 16
  30. 2024Can MLLMs Perform Text-to-Image In-Context Learning?cited by 13
  31. 2024SwapAnything: Enabling Arbitrary Object Swapping in Personalized Visual Editingcited by 13
  32. 2023Improving In-Context Learning in Diffusion Models with Visual Context-Modulated Promptscited by 10
  33. 2025IP-Prompter: Training-Free Theme-Specific Image Generation via Dynamic Visual Promptingcited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 7.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2023DreamInpainter: Text-Guided Subject-Driven Image Inpainting with Diffusion Models
  2. 2024InVi: Object Insertion In Videos Using Off-the-Shelf Diffusion Models
  3. 2023HD-Painter: High-Resolution and Prompt-Faithful Text-Guided Image Inpainting with Diffusion Models
  4. 2024Repositioning the Subject within Image
  5. 2024Coherent and Multi-modality Image Inpainting via Latent Space Optimization
  6. 2024Unleashing In-context Learning of Autoregressive Models for Few-shot Image Manipulation
  7. 2023Paste, Inpaint and Harmonize via Denoising: Subject-Driven Image Editing with Pre-Trained Diffusion Model
  8. 2023InFusion: Inject and Attention Fusion for Multi Concept Zero-Shot Text-based Video Editing