FiT: Flexible Vision Transformer for Diffusion Model

Zeyu Lu, Zidong Wang, Di Huang, Chengyue Wu, Xihui Liu +2 more
2/12/2026

No official code found. Best implementation: whlzy/FiT (434 stars, Apache-2.0, last commit 2024-11-10).

Abstract

Nature is infinitely resolution-free. In the context of this reality, existing diffusion models, such as Diffusion Transformers, often face challenges when processing image resolutions outside of their trained domain. To overcome this limitation, we present the Flexible Vision Transformer (FiT), a transformer architecture specifically designed for generating images with unrestricted resolutions and aspect ratios. Unlike traditional methods that perceive images as static-resolution grids, FiT conceptualizes images as sequences of dynamically-sized tokens. This perspective enables a flexible training strategy that effortlessly adapts to diverse aspect ratios during both training and inference phases, thus promoting resolution generalization and eliminating biases induced by image cropping. Enhanced by a meticulously adjusted network structure and the integration of training-free extrapolation techniques, FiT exhibits remarkable flexibility in resolution extrapolation generation. Comprehensive experiments demonstrate the exceptional performance of FiT across a broad range of resolutions, showcasing its effectiveness both within and beyond its training resolution distribution. Repository available at https://github.com/whlzy/FiT.

View on arXivView PDF

Code Implementations(1)

whlzy/FiTCommunity72%
Apache-2.0

[ICML 2024 Spotlight] FiT: Flexible Vision Transformer for Diffusion Model

43413Shell, PythonFeb 19, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{lu2026fit,
  title  = {FiT: Flexible Vision Transformer for Diffusion Model},
  author = {Zeyu Lu and Zidong Wang and Di Huang and Chengyue Wu and Xihui Liu and Wanli Ouyang and Lei Bai},
  year   = {2026},
  eprint = {2402.12376},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2402.12376},
  journal = {ICML 2024 2024}
}

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/2402.12376.svg)](https://codeofpaper.com/paper/2402.12376)

Discussion