[Paper Review] InstructEdit: Improving Automatic Masks for Diffusion-based Image Editing With User Instructions
InstructEdit extends DiffEdit by using a language processor and Grounded Segment Anything to generate high-quality masks guided by user instructions, enabling fine-grained, multi-object image edits with improved editing accuracy.
Recent works have explored text-guided image editing using diffusion models and generated edited images based on text prompts. However, the models struggle to accurately locate the regions to be edited and faithfully perform precise edits. In this work, we propose a framework termed InstructEdit that can do fine-grained editing based on user instructions. Our proposed framework has three components: language processor, segmenter, and image editor. The first component, the language processor, processes the user instruction using a large language model. The goal of this processing is to parse the user instruction and output prompts for the segmenter and captions for the image editor. We adopt ChatGPT and optionally BLIP2 for this step. The second component, the segmenter, uses the segmentation prompt provided by the language processor. We employ a state-of-the-art segmentation framework Grounded Segment Anything to automatically generate a high-quality mask based on the segmentation prompt. The third component, the image editor, uses the captions from the language processor and the masks from the segmenter to compute the edited image. We adopt Stable Diffusion and the mask-guided generation from DiffEdit for this purpose. Experiments show that our method outperforms previous editing methods in fine-grained editing applications where the input image contains a complex object or multiple objects. We improve the mask quality over DiffEdit and thus improve the quality of edited images. We also show that our framework can accept multiple forms of user instructions as input. We provide the code at https://github.com/QianWangX/InstructEdit.
Motivation & Objective
- Enable fine-grained image editing from user instructions without manual masks.
- Improve object localization and editing accuracy in multi-object images.
- Leverage pre-trained language, segmentation, and diffusion models to automate the pipeline.
Proposed method
- Parse user instructions with a large language model to produce segmentation prompts and input/edited captions.
- Generate high-quality masks using Grounded Segment Anything (Grounded SAM) based on the segmentation prompts.
- Edit the image by combining the mask with a diffusion-based editor (Stable Diffusion with mask-guided DDIM) using the input and edited captions.
- Use DDIM inversion to encode the input image into a noise tensor and control the strength of editing via encoding ratio r.
- Optionally incorporate BLIP2 to describe the image and improve prompts when instructions are unclear.
- Evaluate editing quality with LPIPS, CLIP score, and CLIP directional similarity, plus user studies.
Experimental results
Research questions
- RQ1Can user instructions be effectively parsed to drive segmentation and editing prompts without manual masks?
- RQ2Does grounding-based masking (Grounded SAM) improve fine-grained edits in multi-object images compared to mask-free baselines?
- RQ3How does the instruction-driven editing perform across single-object and multi-object scenarios in terms of semantic preservation and instruction adherence.
Key findings
- InstructEdit achieves better semantic preservation and instruction alignment than baselines in quantitative metrics.
- InstructEdit improves mask quality over DiffEdit, leading to higher image editing fidelity in complex scenes.
- Through Grounded SAM, the method locates and edits targeted objects or regions with reduced overshooting or mislocalization.
- BLIP2-assisted prompts improve editing quality when user descriptions are ambiguous or incomplete.
- User studies show strong preference for InstructEdit over baseline methods in 10 tested edits.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.