Papers › FiT: Flexible Vision Transformer for Diffusion Model

FiT: Flexible Vision Transformer for Diffusion Model

19 Feb 2024arXiv:2402.12376archive 2025-07-28

Zeyu Lu, Zidong Wang, Di Huang, Chengyue Wu, Xihui Liu, Wanli Ouyang, Lei Bai

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.12376")

Code

Syntology Ran 15 of 17 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · honoured contract; 4 ran · our draft was wrong; 10 ran with no contract checked.

By repository: official repository: 17 samples from 1 repository, 15 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

whlzy/fit officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
mindspore-lab/mindone mindsporenot reachable when probed 2026-09-17 — repositories for recent papers often appear after camera-ready report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 15 ran; 1 honoured the contract we drafted; 2 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
4ran · our draft was wrong
10ran
2unverified

Licence: 0 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from whlzy/fit. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

approx_standard_normal_cdf whlzy/fit/fit/scheduler/improved_diffusion/diffusion_utils.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · d6a68e210556f857 · report
continuous_gaussian_log_likelihood whlzy/fit/fit/scheduler/improved_diffusion/diffusion_utils.py official repository ran · our draft was wrong Apache-2.0 (permissive) · ab1c9568b4e13899 · report
create_norm whlzy/fit/fit/model/norms.py official repository ran Apache-2.0 (permissive) · 85ccfb32256956d8 · report
create_npz_from_sample_folder whlzy/fit/fit/utils/eval_utils.py official repository ran Apache-2.0 (permissive) · 7a6ba78116641182 · report
find_correction_factor whlzy/fit/fit/model/rope.py official repository ran fingerprinted Apache-2.0 (permissive) · 191c81a96b555436 · report
find_correction_range whlzy/fit/fit/model/rope.py official repository ran Apache-2.0 (permissive) · b4a38f39f9288869 · report
get_constant_schedule whlzy/fit/fit/utils/lr_scheduler.py official repository ran Apache-2.0 (permissive) · a8366f238618edad · report
get_constant_schedule_with_warmup whlzy/fit/fit/utils/lr_scheduler.py official repository ran Apache-2.0 (permissive) · 5e2efd2c5b6288c6 · report
get_obj_from_str whlzy/fit/fit/utils/utils.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 30d11b7b4428ab6e · report
get_parameter_dtype whlzy/fit/fit/model/utils.py official repository ran Apache-2.0 (permissive) · 1d8274f9142363e1 · report
get_piecewise_constant_schedule whlzy/fit/fit/utils/lr_scheduler.py official repository ran Apache-2.0 (permissive) · 9cc5235bd8b13556 · report
instantiate_from_config whlzy/fit/fit/utils/utils.py official repository ran Apache-2.0 (permissive) · 18d8fb19d766c90f · report
linear_ramp_mask whlzy/fit/fit/model/rope.py official repository ran Apache-2.0 (permissive) · 5034871c1d2783cf · report
modulate whlzy/fit/fit/model/utils.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 03310bba324ae4fb · report
normal_kl whlzy/fit/fit/scheduler/improved_diffusion/diffusion_utils.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · 8afbfc42c6ea0448 · report
default whlzy/fit/fit/utils/utils.py official repository unverified Apache-2.0 (permissive) · f573c816626189bc · report
none_or_str whlzy/fit/fit/utils/sit_eval_utils.py official repository unverified Apache-2.0 (permissive) · 2fc6fdb85f13dc41 · report

Tasks

Computational EfficiencyImage CroppingImage Generationmodel

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDiffusionDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSPEEDSoftmaxTransformerVision Transformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections