ZONE: Zero-Shot Instruction-Guided Local Editing

Shanglin Li, Bohan Zeng, Yutang Feng, Sicheng Gao, Xiuhui Liu, Jiaming Liu, Lin Li, Xu Tang, Yao Hu, Jianzhuang Liu, Baochang Zhang · DOI

Abstract

Recent advances in vision-language models like Stable Diffusion have shown remarkable power in creative image synthesis and editing. However, most existing text-to-image editing methods encounter two obstacles: First, the text prompt needs to be carefully crafted to achieve good results, which is not intuitive or user-friendly. Second, they are in-sensitive to local edits and can irreversibly affect non-edited regions, leaving obvious editing traces. To tackle these problems, we propose a Zero-shot instructiON-guided local image Editing approach, termed ZONE. We first convert the editing intent from the user-provided instruction (e.g., “make his tie blue”) into specific image editing regions through InstructPix2Pix. We then propose a Region-IoU scheme for precise image layer extraction from an off-the-shelf segment model. We further develop an edge smoother based on FFT for seamless blending between the layer and the image. Our method allows for arbitrary manipulation of a specific region with a single instruction while preserving the rest. Extensive experiments demonstrate that our ZONE achieves remarkable local editing results and user-friendliness, outperforming state-of-the-art methods.

Introduction

While large-scale diffusion models have made image editing more accessible, two major hurdles remain for "local" editing—where the goal is to modify only a specific part of an image without altering the surrounding context.

First, many current models suffer from non-intuitive prompting. They are often "description-guided," requiring users to write complex captions or provide manual segmentation masks to specify what to change. Second, even "instruction-guided" models like InstructPix2Pix (IP2P) frequently encounter the over-edit problem. These models often suffer from global leakage; for instance, if a user asks to change a person's shirt, the model might subtly alter the background, the person's face, or the lighting of the entire scene, leading to a loss of original detail.

ZONE (Zero-shot instructiON-guided local image Editing) addresses these gaps by enabling precise local editing using only intuitive natural language instructions, requiring no extra training or manual masking.

Methodology

ZONE utilizes a three-stage pipeline to isolate and execute edits precisely:

  1. Instruction-Guided Localization: The researchers identified that instruction-guided models are "edit-aware." By analyzing cross-attention maps during the denoising process and subtracting the final attention map from the initial one, ZONE can automatically identify a rough region of interest where the edit is occurring.
  2. Mask Refinement (Region-IoU + SAM): To convert the rough attention-based mask into a precise one, ZONE leverages the Segment Anything Model (SAM). To handle SAM's tendency to produce multiple segments, the authors introduced a Region-IoU (rIoU) scheme that automatically selects the segment with the best overlap with the initial attention mask.
  3. Layer Blending (FFT-based Edge Smoother): To avoid jagged edges or "ghosting" when re-integrating the edited layer, ZONE employs a Fast Fourier Transform (FFT) based edge smoother. By operating in the frequency domain, it blends the low-frequency components of the edited layer and the original background for a photorealistic transition.
The ZONE framework supports various editing actions (Add, Change, Remove) while maintaining a reversible, layer-based workflow.

Key Insights

  • Edit-Aware Discovery: Instruction-guided models implicitly "know" where they are editing. This allows for mask extraction without user-provided segmentation.
  • Layer-Based Philosophy: Rather than forcing a diffusion model to keep a background stable, ZONE extracts the change as a discrete layer. This guarantees that 100% of the non-edited pixels remain identical to the original.
  • Frequency-Domain Blending: Using FFT for edge smoothing preserves textures and lighting transitions at edit boundaries better than standard spatial-domain alpha blending.

Results and Evaluation

ZONE was compared against five state-of-the-art baselines, including Text2LIVE and InstructPix2Pix.

Comparisons of ZONE against state-of-the-art methods for the instruction 'Make his tie blue.' Note how ZONE's difference map shows zero change outside the target area.

Quantitatively, ZONE achieved significantly lower L1, L2, and LPIPS scores, indicating superior preservation of the original image. For example, its L1 distance was 0.0146, compared to 0.0919 for MagicBrush. Qualitatively, visual comparisons show that while other models often change the color of the sky or ground textures when asked to modify a small object, ZONE keeps the environment perfectly intact. In human evaluations, ZONE achieved a 69.4% Success Rate, outperforming InstructPix2Pix (59.8%) and Text2LIVE (33.0%).

Conclusion

ZONE provides a robust framework for zero-shot local image editing that prioritizes both user intuition and pixel-perfect preservation of non-edited regions. While currently focused on "add," "remove," and "change" actions, future work may expand the system to handle spatial manipulations like resizing or rotating objects within a scene.

Summary updated

BibTeX
@misc{li2023zone,
  author = {Shanglin Li and Bohan Zeng and Yutang Feng and Sicheng Gao and Xiuhui Liu and Jiaming Liu and Lin Li and Xu Tang and Yao Hu and Jianzhuang Liu and Baochang Zhang},
  title = {{ZONE: Zero-Shot Instruction-Guided Local Editing}},
  year = {2023},
  eprint = {2312.16794},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.16794},
}
Figure