Abstract
Text-conditioned image editing has recently attracted considerable interest. However, most methods are currently limited to one of the following: specific editing types (e.g., object overlay, style transfer), synthetically generated images, or requiring multiple input images of a common object. In this paper we demonstrate, for the very first time, the ability to apply complex (e.g., non-rigid) text-based semantic edits to a single real image. For example, we can change the posture and composition of one or multiple objects inside an image, while preserving its original characteristics. Our method can make a standing dog sit down, cause a bird to spread its wings, etc. – each within its single high-resolution user-provided natural image. Contrary to previous work, our proposed method requires only a single input image and a target text (the desired edit). It operates on real images, and does not require any additional inputs (such as image masks or additional views of the object). Our method, called Imagic, leverages a pre-trained text-to-image diffusion model for this task. It produces a text embedding that aligns with both the input image and the target text, while fine-tuning the diffusion model to capture the image-specific appearance. We demonstrate the quality and versatility of Imagic on numerous inputs from various domains, showcasing a plethora of high quality complex semantic image edits, all within a single unified framework. To better assess performance, we introduce TEdBench, a highly challenging image editing benchmark. We conduct a user study, whose findings show that human raters prefer Imagic to previous leading editing methods on TEdBench.
Introduction
While text-to-image diffusion models have become incredibly powerful at generating images from scratch, editing existing real photos remains a significant challenge. Previous state-of-the-art methods typically suffered from limited scope (handling only simple style or color changes), high data requirements (needing multiple images of the same subject), or constraints to synthetic/masked environments.
Imagic addresses these gaps by providing a system that takes a single real image and one text prompt to produce high-fidelity, non-rigid transformations. For instance, it can take a photo of a standing dog and realistically render it in a sitting position while maintaining the dog's specific breed and markings.
Methodology
The Imagic pipeline operates in three distinct stages, leveraging a pre-trained diffusion model:
- Text Embedding Optimization: The process starts with a target text prompt. The system optimizes the text embedding to find a representation that, when passed through the frozen diffusion model, produces an image as close as possible to the original input.
- Model Fine-Tuning: To ensure the model captures the exact details of the input image (e.g., specific fur patterns), the weights of the diffusion model are fine-tuned for a few iterations using the optimized embedding.
- Linear Interpolation: The edit is achieved by linearly interpolating between the optimized embedding (the original state) and the target text embedding (the desired edit). Moving along this vector allows the model to blend the original subject's identity with the new semantic meaning.
Results and Evaluation
The researchers introduced TEdBench (Textual Editing Benchmark), consisting of 100 pairs of high-resolution real images and challenging target prompts. In a large-scale user study on this benchmark, human raters preferred Imagic over previous leading methods (such as SDEdit and Text2LIVE) more than 70% of the time.
Imagic demonstrates impressive versatility across domains, including animals, people, food, and landscapes. It successfully maintains high-frequency details in the background and the specific "personality" of the subject being edited, a feat often difficult for GAN-based approaches.
Discussion and Limitations
Despite its success, Imagic faces computational challenges; the requirement to optimize and fine-tune for every image makes it slower than real-time alternatives. Additionally, the model can occasionally experience "extrinsic drift," where unintended changes occur to the camera angle or zoom during the editing process. Future work aims to automate hyperparameter selection and accelerate the per-image optimization cycle.
Summary updated