Redirecting the Flow: Image Customization through Attention Distribution Shift

Jie Li, Suorong Yang, Jian Zhao, Furao ShenarXiv 2026

TL;DR

CustomShift is a tuning-free framework for subject-driven image customization that models reference images as a mathematical "distribution shift" within the attention mechanism. By decoupling feature alignment from generation guidance using a novel dual-branch architecture, it achieves a state-of-the-art balance between preserving subject identity and strictly following text prompts—all without requiring slow, expensive test-time fine-tuning.

What Problem Does This Paper Address?

Imagine wanting to generate an image of your favorite childhood stuffed animal riding a motorcycle or sitting in the snow. Standard text-to-image models excel at generating a generic "stuffed animal," but they cannot capture the unique, nuanced details of a specific real-world object from text alone. This task—generating novel scenes while preserving a specific subject's identity based on reference images—is called subject-driven image customization.

Existing approaches generally fall into three buckets, each with distinct drawbacks:

  1. Test-time tuning (e.g., DreamBooth): These methods fine-tune the model for each new subject. They are slow, computationally expensive, and prone to overfitting, which often destroys the model's ability to follow complex text instructions.
  2. Encoder-based methods (e.g., IP-Adapter): These use external image encoders to inject features. However, these features aren't dynamically aligned with the intermediate steps of the diffusion generation process.
  3. Token competition (e.g., OmniGen): These feed reference images, text prompts, and noisy latents into a single shared attention space. Because everything competes for attention simultaneously, it often leads to "identity drift" or background information leaking into the final output.

The authors of this paper introduce CustomShift to eliminate these trade-offs, providing a tuning-free method that cleanly separates subject alignment from text guidance.

Methods

The core innovation of CustomShift lies in how it mathematically formulates the integration of reference images. Instead of treating reference images as just another set of tokens to concatenate, the authors model them as a Conditional Attention Distribution Shift applied to the base text-to-image generative path.

Grounded in maximum entropy theory, they derive routing weights that smoothly transition the attention mechanism to incorporate image, prompt, and reference signals without resulting in a degenerate "hard assignment" (where the model might ignore the text entirely in favor of the image, or vice versa).

Figure 2: CustomShift uses a dual-branch structure. (1) The Reference-Alignment Branch leverages self-attention between reference images 𝑟𝑖and the subject name 𝑠to extract layer-wise, subject-aware features, which are then propagated in a unidirectional manner to the Cross-Guidance Branch, providing a robust foundation for stable and consistent customization. (2) Simultaneously, the Cross-Guidance Branch modulates the latent 𝑥𝑡and textual prompt 𝑝by injecting visual priors from reference images, effectively aligning semantic content with the subject identity encoded in 𝑅.

To implement this formulation, CustomShift introduces a dual-branch architecture built on Stable Diffusion 3’s Multimodal Diffusion Transformer (MM-DiT):

  • Reference-Alignment Branch: This branch processes the reference images alongside the subject's name (e.g., "backpack"). Crucially, it keeps the reference images completely free of time-dependent noise (setting timestep $t=0$). It uses self-attention to extract clean, layer-wise structural features that match the abstraction level of the main generation network.
  • Cross-Guidance Branch: This branch handles the actual generation. It takes the noisy latent image and the text prompt, then uses cross-attention to inject the clean, structured subject features propagated from the Reference-Alignment Branch.

Datasets

  • Training: The model is fine-tuned using lightweight Low-Rank Adaptation (LoRA) on the SynCD dataset, which contains over 90,000 groups of prompt-image pairs.
  • Evaluation: The authors benchmarked their approach against two widely accepted datasets:
  • DreamBooth benchmark: 30 subject categories with 5–6 reference images each.
  • Custom101 benchmark: A larger, more challenging dataset containing 101 subjects with 3–15 reference images each.

Key Insights and Ideas

  • The Danger of Synchronized Noise: Traditional token-competition models inject noise into reference images synchronously with the main image generation path. The authors demonstrate that at early diffusion steps (high noise), this completely obliterates the reference subject's structural details. By keeping reference images noise-free ($t=0$), CustomShift allows the model to establish accurate visual grounding from the very first step of generation.
  • Decoupling Prevents Interference: Forcing text prompts and reference images to compete in the same attention space weakens text controllability. Decoupling them ensures that the reference branch provides a clean, uncorrupted visual signal, allowing the generation branch to handle complex scene logic (like rendering reflections in mirrors or specific artistic styles) flawlessly.

Key Results

CustomShift achieves state-of-the-art quantitative performance across both benchmarks, evaluated using CLIP text similarity (for prompt adherence) alongside CLIP and DINO image similarity (for subject fidelity).

  • DreamBooth Benchmark: CustomShift achieved the highest overall average score of 0.7436, outperforming top baselines like DreamBooth (0.7201), OmniGen (0.7159), and SynCD (0.7170).
  • Custom101 Benchmark: It led with an average score of 0.7097.
  • Data Efficiency: Even in a strict 1-shot setting (using only a single reference image), CustomShift outperformed almost all multi-shot baselines, demonstrating remarkable robustness.

Qualitatively, CustomShift successfully handles difficult scenarios—such as placing a specific clock in the snow or adding sunglasses to a specific cat—where baseline models either lose the subject's identity or fail to modify the background correctly.

Limitations and Future Work

While CustomShift scales well, the authors note a fundamental trade-off between subject fidelity and computational overhead. Theoretically, the computational complexity of the attention operations grows quadratically ($O(n^2)$) with the number of reference tokens. In practice, as more reference images are added to improve detail, the inference time increases linearly. Future work will likely focus on optimizing token compression to maintain high fidelity while reducing computational costs for multi-image prompts.

Summary updated

Abstract

Subject-driven image customization aims to generate images that not only follow textual instructions but also preserve the identity of a given reference subject. Existing approaches, including test-time fine-tuning, encoder-based methods, and token competition in shared attention spaces, suffer from limited efficiency, misalignment between extracted reference features and the generative process, and interference from irrelevant information. To address these limitations, we formulate the customization task as a distribution shift induced by incorporating reference images into text-to-image generation, and derive a Conditional Attention Distribution Shift formulation grounded in maximum entropy theory. Building on this formulation, we propose CustomShift, a dual-branch architecture based on Stable Diffusion 3. The Reference-Alignment Branch leverages self-attention between reference images and subject names to achieve layer-wise alignment with latent representations, while the Cross-Guidance Branch integrates textual and reference cues to guide generation. Experiments on the DreamBooth and Custom101 benchmarks demonstrate that our method consistently outperforms state-of-the-art approaches, achieving a better balance between semantic fidelity and subject consistency.
BibTeX
@misc{li2026redirecting,
  author = {Jie Li and Suorong Yang and Jian Zhao and Furao Shen},
  title = {{Redirecting the Flow: Image Customization through Attention Distribution Shift}},
  year = {2026},
  eprint = {2606.16866},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.16866},
}

Loading related content...

Figure