AsymmetricAutoencoderKL
A heavier, mask-aware decoder for StableDiffusion's autoencoder that keeps unedited image regions intact.
Diffusion and generative · 369 operations Checked
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
- 194.3M
- Operations
- 369
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2023
- Cited by
- 64 (as of 22 November 2026)
- Authors
- Zixin Zhu, Xuelu Feng, Dongdong Chen and others
- Source
- diffusers 0.38.0
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m116
- Graph hash
- de4ec97edd75f44c5b4428097ed260f399b47dcb74849c9a3793c5ee0c04b734
- Skeleton hash
- c56b8058648d4e8f5a6dee5ddc0a14e22b7d417d1c30c7105e5a68a0fa93b9ba
- Architecture hash
- 9d47f4927ec61cfda4110e183ce48a6e557524ceae5b3aa0906e4d294fe9701d
- Diagram SHA-256
- c8575362e90df5397b81aaeedfc70883888dda4493a06d6dc5b402e06d1e72ca
- 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
Asymmetric VQGAN is a replacement autoencoder for StableDiffusion's latent space, built to stop the distortion that creeps into regions an edit was never meant to touch. The authors trace the problem to quantization error in the vanilla VQGAN that StableDiffusion uses to move the diffusion process into a low-dimensional latent space. The traced member here is the KL-regularised flavour of the idea, which the paper treats as a VAEGAN with the same purpose and the same information-loss problem.
The fix comes in two simple designs, both confined to the decoder. First, the decoder grows a conditional branch that takes task-specific priors, such as the unmasked part of the image in inpainting, alongside the encoder's latent. The quantized latent goes down the main path while the masked image enters through the conditional branch, and the two blend before the decoder produces its output. The paper tried both addition and concatenation for that blend and settled on addition. Second, the decoder is made much heavier than the encoder, which buys more detailed recovery while only slightly raising total inference cost. The imbalance is cheap because the real bottleneck of StableDiffusion is the iterative diffusion process, not the autoencoder.
Training is deliberately light: the encoder and codebook keep their original weights and only the new decoder is trained. To keep the decoder from simply copying the conditional input, training alternates random masks with a mask filled entirely with ones, forcing it to rely on the latent codes. That same trick lets the model run without any prior at all, so plain text-to-image generation still works. In the ImageNet inpainting ablation, both the base and the larger model improve FID by roughly 2.00 and LPIPS by about 50% over the original decoder. The official repository offers three pretrained decoders: a base decoder, a large 1.5x decoder and a large 2x decoder. In the paper's terms, the 2x version doubles the decoder's width and multiplies its depth by 2.5.
Key idea. A decoder-only redesign of StableDiffusion's autoencoder: a conditional branch feeds task-specific priors into the decoder, and the decoder is made much heavier than the encoder. Only the new decoder is retrained, with the vanilla VQGAN encoder and StableDiffusion left unchanged.
- Asymmetric VQGAN
- AsymmetricAutoencoderKL
- asymmetric VAE
- asymmetric autoencoder
- StableDiffusion VAE
- Stable Diffusion autoencoder
- inpainting decoder
- KL autoencoder
- diffusers
- image inpainting
- local editing
- VQGAN
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{zhu2023designingbetterasymmetricvqgan,
title={Designing a Better Asymmetric VQGAN for StableDiffusion},
author={Zixin Zhu and Xuelu Feng and Dongdong Chen and Jianmin Bao and Le Wang and Yinpeng Chen and Lu Yuan and Gang Hua},
year={2023},
eprint={2306.04632},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2306.04632},
}