NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Training-free Diffusion Model Adaptation for Variable-Sized Text-to-Image Synthesis

Zhiyu Jin, Xuli Shen, Bin Li, Xiangyang Xue

Introduction

Text-to-image (T2I) diffusion models, such as Stable Diffusion, have revolutionized creative workflows by generating high-quality imagery from natural language. However, these models are typically constrained by the fixed resolution of their training data (e.g., 512x512 pixels). When users attempt to generate images at non-standard resolutions or aspect ratios, the models often fail. Small images frequently feature "incomplete" objects—such as a car without wheels—while large images suffer from "hallucinations," where the model repeats elements to fill space, resulting in disordered scenes like a person with four arms or a sky with multiple suns.

This paper introduces a simple, training-free method to adapt these models to any resolution. By mathematically linking the number of image tokens to "attention entropy," the authors propose a dynamic scaling factor that prevents these common artifacts without requiring expensive fine-tuning or complex post-processing.

The Problem: Entropy and Resolution

The researchers identify the root cause of resolution-based degradation within the attention mechanism, which acts as the "brain" of the transformer blocks in diffusion models. They discovered that the model's failure at different resolutions is a mathematical shift in how information is aggregated:

  • Information Scarcity (Low Resolution): At lower resolutions, attention entropy drops. Tokens focus too narrowly on isolated bits of information, failing to capture the "big picture" necessary to form a complete object.
  • Information Redundancy (High Resolution): At higher resolutions, entropy spikes. Tokens aggregate too much global information, leading to a redundancy where the model perceives a need to place the same object multiple times to fill the excess spatial information.

Methodology: Dynamic Scaling

To solve this, the authors focus on the scaling factor ($\lambda$) used in the softmax operation of the attention layers. In standard models, $\lambda$ is usually fixed at $1/\sqrt{d}$ (where $d$ is the feature dimension).

The authors replace this with a dynamic scaling factor: $$\lambda \approx \sqrt{\frac{\log_T N}{d}}$$ Where $T$ is the number of tokens used during training and $N$ is the number of tokens at inference time. This adjustment effectively "normalizes" the entropy, ensuring the model perceives spatial information at the new resolution similarly to how it did during its original training. Because this is a simple mathematical replacement, it can be implemented in a few lines of code and requires zero additional training or extra GPU memory.

Experimental Results

The researchers evaluated their method using Stable Diffusion and Latent Diffusion architectures on large-scale datasets, including LAION-400M and LAION-5B. The results showed significant improvements across both quantitative and qualitative benchmarks:

  • FID Scores: For Stable Diffusion at 224x224 resolution, the Fréchet Inception Distance (FID)—a measure of image quality and diversity—improved dramatically from 74.6 to 41.9.
  • Text Alignment: CLIP scores improved across all tested resolutions, indicating that the model follows text prompts more accurately when attention entropy is stabilized.
  • Human Preference: In user studies, annotators consistently rated the adapted model higher for consistency and coherence, noting the absence of the "messy" or "repetitive" patterns found in the baseline models.

Conclusion and Future Work

This entropy-based approach provides a highly efficient, "plug-and-play" solution for variable-sized image synthesis. While the method works exceptionally well for moderate resolution changes, the authors note that there is likely a threshold where internal representations break down regardless of scaling. Future work may involve developing better quantitative benchmarks for "spatial logic" and extending this entropy-based normalization to other tasks like inpainting or compositional scene generation.

Summary updated

BibTeX
@inproceedings{jin2023training,
  author = {Zhiyu Jin and Xuli Shen and Bin Li and Xiangyang Xue},
  title = {{Training-free Diffusion Model Adaptation for Variable-Sized Text-to-Image Synthesis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=4ULTSBBY4U},
}
Figure