Focus on Your Instruction: Fine-grained and Multi-instruction Image Editing by Attention Modulation

Q. Guo, Tianwei Lin
2/14/2026

No official code found. Best implementation: guoqincode/Focus-on-Your-Instruction (117 stars, Apache-2.0, last commit 2024-03-22).

Abstract

Recently, diffusion-based methods, like InstructPix2Pix (IP2P), have achieved effective instruction-based image editing, requiring only natural language instructions from the user. However, these methods often inadvertently alter unintended areas and struggle with multi-instruction editing, resulting in compromised outcomes. To address these issues, we introduce the Focus on Your Instruction (FoI), a method designed to ensure precise and harmonious editing across multiple instructions without extra training or test-time optimization. In the FoI, we primarily emphasize two aspects: (1) precisely extracting regions of interest for each instruction and (2) guiding the denoising process to concentrate within these regions of interest. For the first objective, we identify the implicit grounding capability of IP2P from the cross-attention between instruction and image, then develop an effective mask extraction method. For the second objective, we introduce a cross attention modulation module for rough isolation of target editing regions and unrelated regions. Additionally, we introduce a mask-guided disentangle sampling strategy to further ensure clear region isolation. Experimental results demonstrate that FoI surpasses existing methods in both quantitative and qualitative evaluations, especially excelling in multi-instruction editing task. The code is available at https://github.com/guoqincode/Focus-on-Your-Instruction.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[CVPR 2024] Focus on Your Instruction: Fine-grained and Multi-instruction Image Editing by Attention Modulation

1178PythonDec 13, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{guo2026focus,
  title  = {Focus on Your Instruction: Fine-grained and Multi-instruction Image Editing by Attention Modulation},
  author = {Q. Guo and Tianwei Lin},
  year   = {2026},
  eprint = {2312.10113},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2312.10113},
  journal = {CVPR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.10113.svg)](https://codeofpaper.com/paper/2312.10113)

Discussion