All models

vqgan_gumbel_vq_autoencoder

A VQGAN image autoencoder whose 8192-entry codebook is trained with Gumbel quantization at f=8.

Diffusion and generative · 405 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 (10 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
69M
Operations
405
Framework
PyTorch
Recurrent
No
Published
CVPR 2021
Cited by
4,727 (as of 23 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
m11200
Graph hash
6bfe46cf31ca6c8b99a05db18a387734f6c783387d8ab5f9394cecd76a8e5aaf
Skeleton hash
bb0ef4d2dee448a81875db33b25046a3b782dd94b50a46f4492cda79d5fcd189
Architecture hash
c94766c7bdc0858734dce1cca1384345d0675fe487137cf5bedae9ad0b7086a8
Diagram SHA-256
57124ffb952690765cb557fc251c074da5f372f1f23158fa1865d0ab90386349
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 model is the VQGAN image autoencoder from the Taming Transformers repository, in the version trained with Gumbel quantization and 8x spatial compression (f=8). A convolutional encoder and decoder learn together to represent an image with codes from a learned, discrete codebook, so a picture becomes a small grid of code indices that the decoder turns back into pixels. In the paper, this is the first of two stages: CNNs learn a vocabulary of image constituents, and a transformer then models how they compose in high-resolution images.

The paper presents VQGAN as a variant of the original VQVAE that adds a discriminator and a perceptual loss to keep perceptual quality high at stronger compression. The discriminator is patch-based and is trained to tell real images from reconstructions.

The released Gumbel checkpoint has an 8192-entry codebook trained on OpenImages, and the repository lists reconstruction FIDs of 3.24 against the training split and 1.49 against the validation split. The same table gives 33.88 and 32.01 for the DALL-E dVAE, which also uses f=8 and 8192 Gumbel-quantized codes.

Key idea. Taming Transformers showed that pairing a CNN-learned codebook of image parts with a transformer that models their composition can synthesize high-resolution images.

  • VQGAN
  • Gumbel VQGAN
  • GumbelVQ
  • vqgan_gumbel_f8
  • Taming Transformers
  • image tokenizer
  • vector quantization
  • Gumbel quantization
  • image autoencoder

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}, 
}