Emu Edit: Precise Image Editing via Recognition and Generation Tasks

Shelly Sheynin, Adam Polyak, Uriel Singer, Yuval Kirstain, Amit Zohar, Oron Ashual, Devi Parikh, Yaniv Taigman

Abstract

Instruction-based image editing remains a significant challenge in computer vision, often plagued by poor instruction compliance and low visual fidelity. We present Emu Edit, a multi-task latent diffusion model trained on a massive 10-million-sample dataset across 16 diverse tasks. By incorporating computer vision "recognition" tasks—such as detection and segmentation—into the training regime, Emu Edit achieves unprecedented precision. The model utilizes learned task embeddings to resolve instruction ambiguity and supports few-shot adaptation to novel editing capabilities.

Introduction

The goal of instruction-based image editing is to allow users to modify images using natural language (e.g., "add a graduation cap to the mouse"). However, current state-of-the-art models like InstructPix2Pix often struggle with two primary issues: failing to accurately interpret complex instructions and "over-editing," where unintended parts of the image are altered.

Emu Edit demonstrates precise editing and recognition capabilities across various domains.

Emu Edit addresses these limitations by framing image editing as a multi-task learning problem, leveraging a diverse set of operations to improve the model's underlying understanding of image content and spatial relationships.

Methodology

Emu Edit is built upon the Emu foundation model and introduces several architectural innovations designed to enhance control and fidelity.

Multi-Task Formulation and Recognition

The model is trained on 16 distinct tasks, ranging from local additions and removals to global style changes. Crucially, it includes "recognition" tasks like object detection and segmentation. The authors posit that understanding "what" and "where" an object is (recognition) is a prerequisite for precise modification (generation). Training on these vision tasks significantly improves the model's ability to localize edits.

The model performs recognition tasks, such as marking drinks, to improve its spatial awareness for editing.

Learned Task Embeddings

To handle ambiguous instructions, Emu Edit learns a unique embedding vector for each task. At inference, a fine-tuned Flan-T5 model predicts the intended task from the user's prompt, selecting the appropriate embedding to steer the diffusion process via cross-attention. This acts as a "steering wheel," guiding the model toward the correct operation (e.g., distinguishing between a texture change and an object addition).

Grounded Precise Editing

Training data is generated using a pipeline where Large Language Models (LLMs) identify regions for modification. Mask-based attention control is then applied to ensure that edits remain localized and seamless, preserving the identity of the original image while applying the requested change.

Datasets and Benchmarking

The research introduces two significant data contributions:

  1. Emu Edit Training Set: A synthetic dataset of 10 million examples covering 16 tasks, providing the scale and diversity necessary for robust multi-task learning.
  2. Emu Edit Benchmark: A rigorous evaluation suite using authentic images and human-verified instructions across seven categories, offering a more realistic assessment than previous synthetic benchmarks.

Results

Emu Edit sets a new state-of-the-art in instruction-based editing. It outperforms existing baselines on automatic metrics (CLIP, DINO) and is overwhelmingly preferred by human raters. In side-by-side evaluations, it achieved a 77.33% preference for text alignment and 76.71% for image faithfulness compared to InstructPix2Pix. Furthermore, the model demonstrates impressive few-shot capabilities, matching expert performance on new tasks with as few as 100 examples through task inversion.

Conclusion

By integrating recognition tasks into the generative pipeline and leveraging massive multi-task scaling, Emu Edit provides a significant leap forward in precise image editing. While challenges remain in complex spatial reasoning and extremely high-detail domains, the model's ability to follow instructions faithfully while preserving image integrity marks a major milestone for user-friendly creative tools.

Summary updated

BibTeX
@inproceedings{sheynin2023emu,
  author = {Shelly Sheynin and Adam Polyak and Uriel Singer and Yuval Kirstain and Amit Zohar and Oron Ashual and Devi Parikh and Yaniv Taigman},
  title = {{Emu Edit: Precise Image Editing via Recognition and Generation Tasks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure