LayerVerse: Finding the Sweet Spot for KV-Injection in Training-Free Image Editing
Abstract
For image editing with Multimodal Diffusion Transformers(MM-DiT), training-free methods face a critical trade-off: precise back-ground preservation limits editability, while high prompt fidelity de-grades the original scene and object structure. We argue that this tensionstems from suboptimal Key-Value (KV) injection strategies. Global KV-injection rigidly over-preserves the source, whereas strictly masked injec-tion acts as localized inpainting, destroying the edited object’s structuralidentity. We introduce LayerVerse, an optimization framework that re-solves this fundamental dilemma of layer selection for KV-injection byassigning specific layers to two distinct roles: Masked Injection to pre-cisely protect the background, and Global Injection to anchor the editedobject’s structure. Formulating optimal layer allocation as a combina-torial problem, we model the editing error based on pairwise layer in-teractions and solve it globally via Mixed-Integer Linear Programming(MILP). Supported by lightweight, single-step automatic masking, Lay-erVerse seamlessly integrates into training-free, inversion-based editors,achieving highly competitive results on the PIE-Bench benchmark.