LAMS-Edit: Latent and Attention Mixing with Schedulers for Improved Content Preservation in Diffusion-Based Image and Style Editing
Wingwa Fu, Takayuki Okatani
TL;DR
LAMS-Edit addresses the persistent challenge of preserving content structure while applying edits in diffusion-based image editing by leveraging the intermediate states $\{\mathbf{z}_t^*\}$ and $\{\mathbf{A}_t^*\}$ from DDIM inversion. It blends inversion-derived signals with generation-time representations via schedulers, performing separate latent and attention mixing governed by decaying weights, and integrates with Prompt-to-Prompt for targeted edits. The framework also supports region-specific editing with SAM masks and enables style transfer through LoRA in a tuning-free manner. Across SD1-5 and Anything-V4, LAMS-Edit demonstrates improved fidelity-editability trade-offs, with ablations confirming the contributions of latent/attention mixing and the schedulers to preserving identity and structure during edits, and is capable of simultaneous content edits and style adaptation with practical masking and masking-aware constraints.
Abstract
Text-to-Image editing using diffusion models faces challenges in balancing content preservation with edit application and handling real-image editing. To address these, we propose LAMS-Edit, leveraging intermediate states from the inversion process--an essential step in real-image editing--during edited image generation. Specifically, latent representations and attention maps from both processes are combined at each step using weighted interpolation, controlled by a scheduler. This technique, Latent and Attention Mixing with Schedulers (LAMS), integrates with Prompt-to-Prompt (P2P) to form LAMS-Edit--an extensible framework that supports precise editing with region masks and enables style transfer via LoRA. Extensive experiments demonstrate that LAMS-Edit effectively balances content preservation and edit application.
