Test-Time Conditioning with Representation-Aligned Visual Features

Nicolas Sereyjol-Garros, Ellington Kirby, Victor Letzelter, Victor Besnier, Nermin Samet · DOI

Abstract: While representation alignment with self-supervised models has been shown to improve diffusion model training, its potential for enhancing inference-time conditioning remains largely unexplored. We introduce Representation-Aligned Guidance (REPA-G), a framework that leverages these aligned representations, with rich semantic properties, to enable test-time conditioning from features in generation. By optimizing a similarity objective (the potential) at inference, we steer the denoising process toward a conditioned representation extracted from a pre-trained feature extractor. Our method provides versatile control at multiple scales, ranging from fine-grained texture matching via single patches to broad semantic guidance using global image feature tokens. We further extend this to multi-concept composition, allowing for the faithful combination of distinct concepts. REPA-G operates entirely at inference time, offering a flexible and precise alternative to often ambiguous text prompts or coarse class labels. We theoretically justify how this guidance enables sampling from the potential-induced tilted distribution. Quantitative results on ImageNet and COCO demonstrate that our approach achieves high-quality, diverse generations. Code is available at https://github.com/valeoai/REPA-G.

1. Introduction

Generative models have achieved remarkable realism, yet precise controllability remains a significant hurdle. Standard text-to-image models often struggle with ambiguity; describing a specific texture or a complex spatial layout through text frequently leads to a frustrating cycle of prompt engineering. While existing solutions like ControlNet or IP-Adapter offer better control, they typically require expensive, task-specific retraining.

In this work, we introduce REPA-G (Representation-Aligned Guidance), a training-free framework that enables precise image generation control using visual features. By leveraging diffusion models already aligned with self-supervised teachers (such as DINOv2), we demonstrate how to steer the denoising process at inference time to match specific textures, shapes, or global concepts with unprecedented accuracy.

2. Methodology: Representation-Aligned Guidance

REPA-G operates on models trained with a representation alignment loss (e.g., REPA or REPA-E). Because these models are trained to "see" the world similarly to a self-supervised model like DINOv2, their internal feature space is semantically structured. At inference time, REPA-G adds a guidance term to the score function—the direction the model moves to remove noise. This term optimizes a "potential" function, which is a similarity objective between the model's current internal features and a target feature extracted from a reference image.

REPA-G vs. Standard Conditioning: Comparison of class-based and text-based conditioning against REPA-G's feature-based guidance.

The framework introduces two primary alignment mechanisms:

  1. Independent Patch Alignment (IPA): This method uses a weight matrix to define spatial constraints. It allows for reconstructing a reference image's layout and texture (Full Feature Map), guiding specific regions (Masked Feats), or influencing the global "vibe" of an image without enforcing a rigid layout (Average Concept).
  2. Selective Patch Alignment (SPA): A more flexible approach utilizing a "soft-maximum" mechanism. SPA allows the model to automatically localize a concept from a reference image and place it naturally within the new generation, bypassing the need for rigid spatial grids.

3. Key Insights: The Power of Alignment

A core finding of this research is that standard diffusion models (like SiT) often possess "messy" internal feature spaces where clusters do not represent clear semantic concepts. However, once aligned with a teacher like DINOv2, the feature space becomes "well-conditioned." In this state, small changes in the feature vector lead to predictable, semantic changes in the generated image.

Feature Space Alignment: Comparison between standard SiT features and DINOv2-aligned features, showing improved semantic clustering.

Visual features provide a significantly "denser" signal than text. REPA-G achieves higher fidelity to target concepts than even highly detailed text prompts, which often lack the precision required for unique textures or complex compositions. Mathematically, this guidance mechanism is equivalent to sampling from a "potential-induced tilted distribution," effectively nudging the model toward the desired visual outcome while maintaining the realism of the underlying data distribution.

4. Experimental Results

The researchers evaluated REPA-G using ImageNet (1.2M images) and COCO (123K images) benchmarks.

  • Quantitative Performance: On ImageNet, REPA-G combined with an aligned model (REPA-E) achieved an FID of 1.42 for full feature map conditioning, a massive improvement over the baseline SiT FID of 45.02. This indicates a significant leap in the quality and accuracy of conditioned samples.
  • Zero-Shot Generalization: On the COCO dataset, which the model was not specifically trained on, REPA-G significantly outperformed text-to-image baselines in both image quality and adherence to the conditioning signal.
  • Compositional Control: Qualitative results demonstrate successful "concept-blending," such as placing the features of a specific tiger into a water background, outperforming standard class-conditional baselines that struggle with such specific combinations.

5. Discussion and Limitations

While REPA-G offers a powerful new tool for controllable generation, some limitations remain. The guidance scale ($\lambda$) currently requires manual tuning to balance conditioning strength against overall image quality. Additionally, the model can be sensitive to viewpoints; it may struggle if the reference image and the generated scene have vastly different perspectives. Finally, because the method requires backpropagating gradients through transformer blocks at each denoising step, there is a slight reduction in inference throughput (from 0.53 to 0.39 images per second).

Future work will explore integrating REPA-G with other conditioning methods, such as text, to create even more versatile and intuitive generative tools.

Summary updated

Abstract

While representation alignment with self-supervised models has been shown to improve diffusion model training, its potential for enhancing inference-time conditioning remains largely unexplored. We introduce Representation-Aligned Guidance (REPA-G), a framework that leverages these aligned representations, with rich semantic properties, to enable test-time conditioning from features in generation. By optimizing a similarity objective (the potential) at inference, we steer the denoising process toward a conditioned representation extracted from a pre-trained feature extractor. Our method provides versatile control at multiple scales, ranging from fine-grained texture matching via single patches to broad semantic guidance using global image feature tokens. We further extend this to multi-concept composition, allowing for the faithful combination of distinct concepts. REPA-G operates entirely at inference time, offering a flexible and precise alternative to often ambiguous text prompts or coarse class labels. We theoretically justify how this guidance enables sampling from the potential-induced tilted distribution. Quantitative results on ImageNet and COCO demonstrate that our approach achieves high-quality, diverse generations. Code is available at https://github.com/valeoai/REPA-G.
BibTeX
@misc{sereyjolgarros2026test,
  author = {Nicolas Sereyjol-Garros and Ellington Kirby and Victor Letzelter and Victor Besnier and Nermin Samet},
  title = {{Test-Time Conditioning with Representation-Aligned Visual Features}},
  year = {2026},
  eprint = {2602.03753},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.03753},
}

Loading related content...

Figure