Analogist: Out-of-the-box Visual In-Context Learning with Image Diffusion Model
Abstract
Visual In-Context Learning (ICL) has emerged as a promising research area due to its capability to accomplish various tasks with limited example pairs through analogical reasoning. However, training-based visual ICL has limitations in its ability to generalize to unseen tasks and requires the collection of a diverse task dataset. On the other hand, existing methods in the inference-based visual ICL category solely rely on textual prompts, which fail to capture fine-grained contextual information from given examples and can be time-consuming when converting from images to text prompts. To address these challenges, we propose Analogist, a novel inference-based visual ICL approach that exploits both visual and textual prompting techniques using a text-to-image diffusion model pretrained for image inpainting. For visual prompting, we propose a self-attention cloning (SAC) method to guide the fine-grained structural-level analogy between image examples. For textual prompting, we leverage GPT-4V's visual reasoning capability to efficiently generate text prompts and introduce a cross-attention masking (CAM) operation to enhance the accuracy of semantic-level analogy guided by text prompts. Our method is out-of-the-box and does not require fine-tuning or optimization. It is also generic and flexible, enabling a wide range of visual tasks to be performed in an in-context manner. Extensive experiments demonstrate the superiority of our method over existing approaches, both qualitatively and quantitatively. Our project webpage is available at https://analogist2d.github.io.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
17 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Textualize Visual Prompt for Image Editing via Diffusion Bridge cites Language Models are Few-Shot Learners
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
- Splatent: Splatting Diffusion Latents for Novel View Synthesis cites Denoising Diffusion Probabilistic Models
- ImageRAG: Dynamic Image Retrieval for Reference-Guided Image Generation cites Language Models are Few-Shot Learners
- ImageRAG: Dynamic Image Retrieval for Reference-Guided Image Generation cites Learning Transferable Visual Models From Natural Language Supervision
- ImageRAG: Dynamic Image Retrieval for Reference-Guided Image Generation cites Denoising Diffusion Probabilistic Models
- ImageRAG: Dynamic Image Retrieval for Reference-Guided Image Generation cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Learning Transferable Visual Models From Natural Language Supervision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Learning Transferable Visual Models From Natural Language Supervision cites Language Models are Few-Shot Learners
- PairEdit: Learning Semantic Variations for Exemplar-based Image Editing cites Learning Transferable Visual Models From Natural Language Supervision
- PairEdit: Learning Semantic Variations for Exemplar-based Image Editing cites Denoising Diffusion Probabilistic Models
Cited by top-tier papers17
- ImageRAG: Dynamic Image Retrieval for Reference-Guided Image GenerationRotem Shalev-Arkushin, Rinon Gal, Amit Bermano, Ohad FriedICLR 2026 · 25 citations
- PairEdit: Learning Semantic Variations for Exemplar-based Image EditingHaoguang Lu, Jiacheng Chen, Zhenguo Yang, Aurele Tohokantche Gnanha et al.NeurIPS 2025 · 8 citations
- Omni-3DEdit: Generalized Versatile 3D Editing in One-PassLiyi Chen, Pengfei Wang, Guowen Zhang, Zhiyuan Ma et al.CVPR 2026 · 6 citations
- Textualize Visual Prompt for Image Editing via Diffusion BridgePengcheng Xu, Qingnan Fan, Fei Kou, Shuai Qin et al.AAAI 2025 · 4 citations
- Splatent: Splatting Diffusion Latents for Novel View SynthesisOr Hirschorn, Omer Sela, Inbar Huberman-Spiegelglas, Netalee Efrat Sela et al.CVPR 2026 · 2 citations
Builds on24
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
Related papers
- Stable Diffusion Models Are Secretly Good at Visual In-Context LearningTrevine Oorloff, Vishwanath Sindagi, Wele Gedara Chaminda Bandara, Ali Shafahi et al.ICCV 2025 · 11 citations
- In-Context Learning Unlocked for Diffusion ModelsZhendong Wang, Yifan Jiang, Yadong Lu, Yelong Shen et al.NeurIPS 2023 · 128 citations
- VisualCloze: A Universal Image Generation Framework via Visual in-Context LearningZhong-Yu Li, Ruoyi Du, Juncheng Yan, Le Zhuo et al.ICCV 2025 · 2 citations
- ConText: Driving In-context Learning for Text Removal and SegmentationFei Zhang, Pei Zhang, Baosong Yang, Fei Huang et al.ICML 2025
- Towards Global Optimal Visual In-Context Learning Prompt SelectionChengming Xu, Chen Liu, Yikai Wang, Yuan Yao et al.NeurIPS 2024 · 19 citations
