Abstract
BARET (Balanced Attention Based Real Image Editing) is a novel framework designed for complex, non-rigid image editing—such as altering an animal's posture or species—using only an input image and a target text prompt. Unlike traditional methods that require extensive fine-tuning or manual captions, BARET optimizes target text embeddings to achieve high-fidelity results in just 16 seconds. By introducing a Target-Text Inversion Schedule (TTIS) and a Balanced Attention Module (BAM), the framework effectively manages the tradeoff between image fidelity and editability.
Introduction
While diffusion models have revolutionized text-to-image generation, editing real-world images remains a significant challenge. Existing techniques often struggle with "non-rigid" edits that require structural changes, such as changing a standing dog to a sitting one. Furthermore, many state-of-the-art methods suffer from high computational overhead, requiring 10–20 minutes of fine-tuning per image, or necessitate detailed manual captions. BARET addresses these issues by providing a concise, intuitive workflow that handles complex structural changes quickly and without additional user input like masks.
Methodology
The BARET framework is built upon three core technical innovations that streamline the editing process while maintaining structural integrity.
Target-Text Inversion Schedule (TTIS)
Traditional inversion methods often start with a "null" text prompt and optimize it to reconstruct the original image. BARET deviates from this by fine-tuning the target text embedding directly. Since the target text is semantically closer to the desired outcome, the optimization converges significantly faster—averaging just 16 seconds on an NVIDIA A100.
Progressive Transition Scheme
To bridge the gap between the original image and the edited version, BARET employs a linear interpolation schedule. The model transitions from the fine-tuned "reconstruction" embedding to the original "target" text embedding. This allows for the gradual introduction of new structural information while remaining anchored to the original image's features.
Balanced Attention Module (BAM)
The Balanced Attention Module is the primary mechanism for maintaining layout during the diffusion process. BAM replaces standard attention maps by combining self-attention maps (which preserve layout and structure) from the reconstruction process with cross-attention maps (which carry semantic meaning) from the transition process. This "balances" the soul of the original image with the instructions of the new text prompt.
Experimental Results
BARET was evaluated using the TEdBench benchmark, consisting of 100 pairs of real images and textual descriptions, and compared against baselines such as SDEdit, Imagic, and MasaCtrl.
Performance Metrics
- Efficiency: BARET completes the inversion stage in 16 seconds, a massive improvement over methods like SINE or Imagic, which can take over 20 minutes.
- User Preference: In a study of 100 editing tasks, BARET achieved a mean score of 3.77/5, significantly outperforming Null-text inversion (2.93).
- Alignment and Fidelity: The model achieved the highest CLIPScore (0.729), indicating superior alignment with target text, while maintaining high image fidelity (1-LPIPS of 0.764).
Qualitative Success
The framework excels in "extreme" editing scenarios where previous methods often fail. It successfully performs tasks like changing a standing animal's posture or altering its species while preserving the background and overall composition.
Conclusion and Future Work
BARET offers a fast and effective solution for non-rigid real image editing. While highly effective, the method is sensitive to hyperparameters like the interpolation weight ($\omega$), typically optimized between 0.6 and 0.8. Future research may extend BARET’s principles to personalized portrait editing and object addition, further expanding the capabilities of text-driven image manipulation.
Summary updated