LooseRoPE: Content-aware Attention Manipulation for Semantic Harmonization
Etai Sella, Yoav Baron, Hadar Averbuch-Elor, Daniel Cohen-Or, Or Patashnik
TL;DR
LooseRoPE tackles prompt-free image editing by enabling content-aware, semantically harmonious edits through saliency-guided attention modulation. By relaxing RoPE with an inverse range factor $r(S(q))$ and adaptively scaling attention with $k(S(q))$, the method balances preserving the pasted object's identity with contextual harmonization; a Vision-Language Model guides parameter steering during inference. Built atop FLUX Kontext, the approach delivers seamless crop-and-paste results without textual prompts, validated on a 150-sample benchmark with both quantitative metrics (CLIP-IQA, LPIPS) and a user study demonstrating improved identity preservation and blending. The work highlights attention as a controllable, content-aware mechanism for image editing and outlines directions for future work, including video extension and deeper analysis of model attention dynamics.
Abstract
Recent diffusion-based image editing methods commonly rely on text or high-level instructions to guide the generation process, offering intuitive but coarse control. In contrast, we focus on explicit, prompt-free editing, where the user directly specifies the modification by cropping and pasting an object or sub-object into a chosen location within an image. This operation affords precise spatial and visual control, yet it introduces a fundamental challenge: preserving the identity of the pasted object while harmonizing it with its new context. We observe that attention maps in diffusion-based editing models inherently govern whether image regions are preserved or adapted for coherence. Building on this insight, we introduce LooseRoPE, a saliency-guided modulation of rotational positional encoding (RoPE) that loosens the positional constraints to continuously control the attention field of view. By relaxing RoPE in this manner, our method smoothly steers the model's focus between faithful preservation of the input image and coherent harmonization of the inserted object, enabling a balanced trade-off between identity retention and contextual blending. Our approach provides a flexible and intuitive framework for image editing, achieving seamless compositional results without textual descriptions or complex user input.
