Mind the RefGAP: Correcting Reference Attention in Diffusion-Based Visual Editing

Yanan Wang, Shengcai Liao, Guangyi Liu, Xiaodan Liang
9/28/2026
cs.CV

No confident code implementation found for this paper.

Abstract

Reference-guided diffusion editors struggle to faithfully reproduce user-provided references. We identify a potential bottleneck in diffusion editors: many methods provide limited reference-attention allocation. For example, in LoomVideo, edit-region queries assign less than 1% of their attention mass to the reference. We introduce RefGAP, a training-free correction that determines logit-offset magnitudes online at each layer from the reference-attention mass measured during the forward pass. Positive offsets to reference logits strengthen reference usage by edit-region queries, while negative offsets for keep-region queries limit reference-induced changes outside the edit. Two global coefficients control the correction; they are selected once on validation data from four development diffusion editors and held fixed. Across seven diffusion-based image/video editors, RefGAP improves identity fidelity in head swapping and face swapping. RefGAP achieves a fidelity-preservation trade-off comparable to separately tuned constant edit-side biases, without per-approach strength sweeps. Additional experiments on virtual try-on and background replacement evaluate transfer beyond identity editing.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2026mind,
  title  = {Mind the RefGAP: Correcting Reference Attention in Diffusion-Based Visual Editing},
  author = {Yanan Wang and Shengcai Liao and Guangyi Liu and Xiaodan Liang},
  year   = {2026},
  eprint = {2609.35708},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.35708v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.35708.svg)](https://codeofpaper.com/paper/2609.35708)

Discussion