LOCATEdit: Graph Laplacian Optimized Cross Attention for Localized Text-Guided Image Editing

Achint Soni, Meet Soni, Sirisha Rambhatla

TL;DR

This paper introduces LOCATEdit, a novel method for text-guided image editing that significantly improves localization and spatial consistency. By refining cross-attention maps using a graph Laplacian approach, LOCATEdit ensures edits are precise and adhere to the original image structure, outperforming existing methods on the PIE-Bench dataset.

What Problem Does This Paper Address?

Text-guided image editing, a powerful tool for manipulating images with natural language prompts, often struggles with precision. Existing methods frequently rely on cross-attention maps derived from diffusion models to identify target regions. However, these maps, driven by semantic relevance, can lead to unintended edits spilling into other areas, causing object identity loss and background distortions. This lack of spatial consistency and precise localization limits the practical application of these editing techniques. The paper aims to bridge this gap by developing a method that can perform localized edits while preserving the overall image integrity.

Methods

LOCATEdit builds upon existing dual-branch editing paradigms, which use separate branches for the source and target images. The core innovation lies in refining the cross-attention maps to enforce spatial consistency. This is achieved through a CASA (Cross and Self-Attention) Graph construction.

Here's a breakdown of the key techniques:

  • CASA Graph Construction: Initial cross-attention maps are upsampled to create a patch-level adjacency graph. The edges of this graph are weighted based on self-attention maps, capturing patch-to-patch relationships. This graph represents the image structure and semantic relevance.
  • Graph Laplacian Regularization: The CASA graph is then optimized using graph Laplacian regularization. This process penalizes abrupt differences in attention between strongly connected patches, effectively smoothing out isolated high responses that can lead to over-editing. This ensures that edits are confined to spatially coherent regions.
  • Selective Embedding Interpolation: To further enhance precision and prevent unintended global changes, the authors introduce a selective pruning operator. This operator thresholds the difference between source and target text embeddings, retaining only dominant semantic shifts and minimizing spurious variations. This refined embedding is then used with an IP-Adapter for guidance.
  • Dual-Branch Editing with Mask Integration: The optimized attention maps are used to create a final spatial mask. This mask is then employed to replace the target branch's latent representation at each denoising step, ensuring that non-editable regions of the source image remain unchanged.

Datasets

The paper evaluates LOCATEdit on the PIE-Bench dataset. This benchmark is specifically designed for prompt-based image editing and includes 700 images across ten editing tasks, each with source prompts, target prompts, blend words, and ground truth editing masks. The authors note that PIE-Bench is currently the only established benchmark for this task.

Key Insights and Ideas

  • The limitations of semantic relevance: The paper highlights that relying solely on semantic relevance from cross-attention maps is insufficient for precise image editing, as it can lead to unintended spatial distortions.
  • The power of graph-based regularization: By modeling attention maps as graphs and applying Laplacian regularization, the authors demonstrate a robust way to enforce spatial consistency and confine edits to desired regions.
  • The importance of disentanglement: The selective pruning of text embeddings is crucial for disentangling semantic changes from background preservation, preventing minor variations from causing significant alterations.
  • Combining structural and semantic guidance: LOCATEdit effectively combines structural information (from self-attention and graph Laplacian) with semantic guidance (from text prompts and IP-Adapter) for superior editing performance.

Key Results

LOCATEdit demonstrates strong performance across various metrics:

  • Structure Consistency: Achieves superior spatial consistency compared to baselines.
  • Background Preservation: Effectively preserves the original image structure, outperforming other methods in metrics like PSNR, LPIPS, MSE, and SSIM.
  • CLIP Similarity: Shows strong alignment with the target prompt, indicating faithful semantic editing.
  • Qualitative Comparisons: Visual results (as seen in Figure 1 and Table 1) showcase LOCATEdit's ability to perform localized edits while maintaining overall image fidelity and avoiding artifacts. The paper states that LOCATEdit consistently yields superior spatial consistency and semantic alignment compared to state-of-the-art text-guided image editing methods.

Limitations and Future Work

  • Limitations: The paper acknowledges that while individual components of LOCATEdit perform well, combining them can lead to slightly worse structure and background metrics compared to some individual components. However, this combination still results in superior CLIP similarity. The authors also note that a high value for the parameter 'a' can lead to superior CLIP similarity but degrades other metrics due to creating a "hard threshold" and abrupt transitions.
  • Future Work: The authors suggest extending the framework to non-symmetric regularization and more complex editing scenarios to further enhance controllable image generation.

Summary updated

BibTeX
@inproceedings{soni2025locatedit,
  author = {Achint Soni and Meet Soni and Sirisha Rambhatla},
  title = {{LOCATEdit: Graph Laplacian Optimized Cross Attention for Localized Text-Guided Image Editing}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure