All models

vqgan_net2net_transformer

A GPT-style transformer that generates images as sequences of VQGAN codebook indices, here conditioned on coordinates.

Diffusion and generative · 774 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (11 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
304.9M
Operations
774
Framework
PyTorch
Recurrent
No
Published
CVPR 2021
Cited by
2,505 (as of 22 October 2026)
Authors
Patrick Esser, Robin Rombach, Björn Ommer
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m11201
Graph hash
92faf0d773d745df18f9389f4569c5b810651a8ff142a9913b40534e8b2fd940
Skeleton hash
a6196764f1c6e45a965e5e5476fbb2e982604da357244abc5b0c4886e0bb3c10
Architecture hash
2880328cb6b5b81a910fb51e30476051a6efc79c6986969b79bdbbf04b8b2876
Diagram SHA-256
5bd979aa701c506954a768352e3c694656d7f30b06b09057deb9d0807c7e2d51
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This is the autoregressive transformer half of Taming Transformers, a two-stage image generator: a convolutional VQGAN first compresses images into a grid of discrete codes, and this transformer learns how those codes are composed. The paper's argument is that transformers lack the local inductive bias of CNNs, which makes them expressive but too costly for long sequences such as high-resolution images. Letting a CNN learn the vocabulary of image parts and a transformer model their arrangement keeps the strengths of both.

Generation becomes next-index prediction: given the codebook indices so far, the transformer predicts a distribution over the next one. Conditioning information with spatial extent is turned into its own index sequence and simply prepended to the image codes.

The paper usually uses a codebook of 1024 entries and sequences of 16 by 16 codes, the longest that fit a GPT2-medium architecture on a 12GB GPU. To reach megapixel images, the transformer samples in a sliding-window manner. For unconditional synthesis on aligned data it can condition on image coordinates instead, as this model does.

Key idea. Taming Transformers pairs a convolutional VQGAN codebook of image parts with an autoregressive transformer over its codes to synthesize high-resolution images.

  • VQGAN Transformer
  • Taming Transformers
  • Net2NetTransformer
  • VQGAN
  • image synthesis
  • autoregressive image generation
  • high-resolution image synthesis
  • codebook
  • conditional image generation

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{esser2021tamingtransformershighresolutionimage,
      title={Taming Transformers for High-Resolution Image Synthesis}, 
      author={Patrick Esser and Robin Rombach and Björn Ommer},
      year={2021},
      eprint={2012.09841},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2012.09841}, 
}