Abstract
Text-to-image diffusion models often struggle to capture fine-grained or nuanced semantic edits through language alone. We present PairEdit, a framework designed for exemplar-based image editing that learns semantic variations from a single or few "before-and-after" image pairs. By explicitly modeling the semantic difference (delta) and employing a novel content-preserving noise schedule, PairEdit achieves high-fidelity edits while maintaining the original subject's identity. Our method outperforms existing baselines in both perceptual metrics and human preference studies.
Introduction
While text-to-image models have revolutionized content creation, they face a "vocabulary bottleneck" when users require specific, nuanced modifications—such as a particular style of "chubbiness" or unique fantasy features like "elf ears." Describing these precisely in text is often impossible. Exemplar-based editing offers a solution by allowing users to provide visual examples of the desired change. However, existing methods often suffer from "identity drift," where the edited subject loses their original characteristics. PairEdit addresses this by disentangling the semantic edit from the subject's identity.
Methods
PairEdit is built upon the Flux rectified flow transformer and introduces three primary technical innovations:
- Guidance-based Semantic Variation: Instead of training the model to simply replicate a target image, PairEdit models the direction of change. It calculates a guidance vector based on the difference between predicted noise for the source and target ($\epsilon_{target} - \epsilon_{source}$), allowing for precise control over the "delta" of the edit.
- Content-Preserving Noise Schedule: Traditional diffusion processes often destroy structural information at high noise levels. PairEdit utilizes a modified schedule ($x_t = x_0 + t\beta\epsilon$) that ensures the underlying layout remains recognizable throughout training, acting as a structural anchor for identity preservation.
- Disentangled LoRAs: The framework simultaneously trains two Low-Rank Adaptation (LoRA) modules. The Content LoRA focuses on reconstructing the original source, while the Semantic LoRA captures the variation. This separation prevents the edit from overwriting the subject's unique features.
Results
We evaluated PairEdit against state-of-the-art baselines including VISII and Analogist.
Qualitative Performance: PairEdit excels at complex, fine-grained edits. For instance, it can successfully apply "dragon eyes" or "elf ears" without altering the fundamental facial structure of the subject, a task where baseline models frequently fail.
Quantitative Metrics: Using the LPIPS metric to measure perceptual similarity, PairEdit demonstrated superior identity preservation. In a "Glasses" edit task, PairEdit achieved an LPIPS score of 0.0911, significantly better than the next best baseline (SDEdit at 0.1370).
User Preference: In a study involving 24 participants and 720 responses, PairEdit was preferred over competing methods by a margin of 93.8% to 98.7%.
Conclusion
PairEdit demonstrates that visual exemplars can bypass the limitations of text-based editing for nuanced image manipulation. By focusing on semantic "deltas" and preserving structural anchors, the system maintains high identity fidelity. Future work will explore extending this framework to unpaired datasets, potentially allowing the model to learn styles or concepts from general collections of images without explicit "before-and-after" pairs.
Summary updated