Skip to content
ModelListedExternal
Browse files

Transformer Autoregressive Flow

license: apache-2.0 language: en datasets: bitmind/AFHQ ILSVRC/imagenet-1k pipelinetag: unconditional-image-generation

KindOtherVersionRevision a1e5393

Model source

Kind
Other
File size
155 MB–3.10 GB
Version
vRevision a1e5393
Updated
Sep 15, 2026
Downloads
0
Source
Hugging Face

Source description


license: apache-2.0 language:

  • en datasets:
  • bitmind/AFHQ
  • ILSVRC/imagenet-1k pipeline_tag: unconditional-image-generation

Transformer AutoRegressive Flow Model

The TarFlow is proposed by [Zhai et al., 2024], which introduces stacks of autoregressive Transformer blocks (similar to MAF) into the building of affine coupling layers to do Non-Volume Preserving, combined with guidance and denoising, finally achieves state-of-the-art results across multiple benchmarks. Associated code can be found at https://github.com/apple/ml-tarflow.

It's sampling process is extremely slow, and we want to accelerate it in [Liu and Qin, 2025], code in https://github.com/encoreus/GS-Jacobi_for_TarFlow. In experiments, we find that the model parameters are not available in original paper, so we retrain TarFlow models and upload them.

As metioned in [Zhai et al., 2024], a TarFlow model can be denoted as P-Ch-T-K-pε, with patch size (P), model channel size (Ch), number of autoregressive flow blocks (T), the number of attention layers in each flow (K), the best input noise variance pε that yields the best sampling quality for generation tasks.

We trained five models:

  • AFHQ (256x256) conditional: afhq_model_8_768_8_8_0.07.pth

  • ImageNet (128x128) conditional: imagenet_model_4_1024_8_8_0.15.pth

  • ImageNet (64x64) unconditional: imagenet64_model_2_768_8_8_0.05.pth

  • ImageNet (64x64) conditional: imagenet_model_2_768_8_8_0.05.pth

  • ImageNet (64x64) conditioanl: imagenet_model_4_1024_8_8_0.05.pth

We also compute the stats for the true data distribution which can be used to calculate FID.

  • AFHQ (256x256) conditional: afhq_256_fid_stats.pth

  • ImageNet (128x128) conditional: imagenet_128_fid_stats.pth

  • ImageNet (64x64) unconditional: imagenet64_64_fid_stats.pth

  • ImageNet (64x64) conditional: imagenet_64_fid_stats.pth

The sampling traces maybe look like this:

image/png From top to bottom: Img128cond, Img64cond (patch4), Img64uncond, AFHQ. From left to right: noise, Block 7-0, denoised image.

[1] Zhai S, Zhang R, Nakkiran P, et al. Normalizing flows are capable generative models[J]. arXiv preprint arXiv:2412.06329, 2024.

[2] Liu, B. & Qin, Z. Accelerate TarFlow Sampling with GS-Jacobi Iteration. (2025), https://arxiv.org/abs/2505.12849

Sources

1 source
Hugging FacePrimaryVersion a1e539373f3b29f8ce85c3de9d96716dbcbf79fb
huggingface.co/encoreus/Transformer_Autoregressive_Flow/tree/a1e539373f3b29f8ce85c3de9d96716dbcbf79fb

Verified Sep 15

Download files

Model artifacts

9 artifacts

afhq_256_fid_stats.pth

pth · 155 MB · SHA-256 cd622baf46e2…10be · Hugging Face

Download file

afhq_model_8_768_8_8_0.07.pth

pth · 1.76 GB · SHA-256 961441bda8f0…5b74 · Hugging Face

Download file

imagenet_128_fid_stats.pth

pth · 155 MB · SHA-256 03dfe9da6611…7897 · Hugging Face

Download file

imagenet_64_fid_stats.pth

pth · 155 MB · SHA-256 438767858102…b3ca · Hugging Face

Download file

imagenet_model_2_768_8_8_0.05.pth

pth · 1.77 GB · SHA-256 a764a98f1c59…8de4 · Hugging Face

Download file

imagenet_model_4_1024_8_8_0.05.pth

pth · 3.05 GB · SHA-256 9e403885cc8e…a32e · Hugging Face

Download file

imagenet_model_4_1024_8_8_0.15.pth

pth · 3.10 GB · SHA-256 a5dbe34fc05a…01b0 · Hugging Face

Download file

imagenet64_64_fid_stats.pth

pth · 155 MB · SHA-256 90d04feadfc4…0fec · Hugging Face

Download file

imagenet64_model_2_768_8_8_0.05.pth

pth · 1.75 GB · SHA-256 6c83519190c7…1d76 · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: apache-2.0 language: - en datasets: - bitmind/AFHQ - ILSVRC/imagenet-1k pipeline_tag: unconditional-image-generation --- --- license: apache-2.0 language: - en datasets: - bitmind/AFHQ - ILSVRC/imagenet-1k pipeline_tag: unconditional-image-generation --- **Transformer AutoRegressive Flow Model** The TarFlow is proposed by [[Zhai et al., 2024]](http://arxiv.org/abs/2412.06329), which introduces stacks of autoregressive Transformer blocks (similar to MAF) into the building of affine coupling layers to do Non-Volume Preserving, combined with guidance and denoising, finally achieves state-of-the-art results across multiple benchmarks. Associated code can be found at https://github.com/apple/ml-tarflow. It's sampling process is extremely slow, and we want to accelerate it in [[Liu and Qin, 2025]](https://arxiv.org/abs/2505.12849), code in https://github.com/encoreus/GS-Jacobi_for_TarFlow. In experiments, we find that the model parameters are not available in original paper, so we retrain TarFlow models and upload them. As metioned in [[Zhai et al., 2024]](http://arxiv.org/abs/2412.06329), a TarFlow model can be denoted as P-Ch-T-K-pε, with patch size (P), model channel size (Ch), number of autoregressive flow blocks (T), the number of attention layers in each flow (K), the best input noise variance pε that yields the best sampling quality for generation tasks. We trained five models: - AFHQ (256x256) conditional: afhq_model_8_768_8_8_0.07.pth - ImageNet (128x128) conditional: imagenet_model_4_1024_8_8_0.15.pth - ImageNet (64x64) unconditional: imagenet64_model_2_768_8_8_0.05.pth - ImageNet (64x64) conditional: imagenet_model_2_768_8_8_0.05.pth - ImageNet (64x64) conditioanl: imagenet_model_4_1024_8_8_0.05.pth We also compute the stats for the true data distribution which can be used to calculate FID. - AFHQ (256x256) conditional: afhq_256_fid_stats.pth - ImageNet (128x128) conditional: imagenet_128_fid_stats.pth - ImageNet (64x64) unconditional: imagenet64_64_fid_stats.pth - ImageNet (64x64) conditional: imagenet_64_fid_stats.pth The sampling traces maybe look like this: ![image/png](https://cdn-uploads.huggingface.co/production/uploads/682459b20ee49a8c3822a525/bx0U7vnZSu9SFoV2gtERI.png) From top to bottom: Img128cond, Img64cond (patch4), Img64uncond, AFHQ. From left to right: noise, Block 7-0, denoised image. [1] Zhai S...

Source context: 0 downloads · 2 likes · Pipeline unconditional-image-generation · Repo encoreus/Transformer_Autoregressive_Flow