Shotcraft
How generation works

The VAE: a learned codec between pixels and latents

The encoder and decoder that translate pixels into latents and back again.

Commonly believed, and wrong: the VAE is part of the diffusion model.

A variational autoencoder is a codec that was trained rather than designed. Like ProRes or H.264 it comes in two halves: an encoder that takes pixels and emits a much smaller representation, and a decoder that expands that representation back into pixels. Unlike ProRes, nobody hand-wrote its transform. It was learned, using the encoder and decoder formulation from Auto-Encoding Variational Bayes, in which the encoder produces a distribution over the compressed code rather than one fixed code. In a text-to-image or text-to-video pipeline the diffusion model never touches pixels. The encoder runs during training, turning source footage into latents. At generation time only the decoder runs, once, at the end, on the finished latent. That division of labour explains a whole class of artifact. If a shot is soft in sensible places but fine texture buzzes, if gradients carry a faint regular grid, if skin has a plasticky sheen, the problem is decode rather than denoise. Upsampling layers are known to produce checkerboard patterning, documented in detail by Odena, Dumoulin and Olah. Rerolling the prompt will not remove a decoder artifact, because the same decoder produces it every time. Video codecs of this kind also compress the third axis. CogVideoX built a 3D VAE that compresses along time as well as space, replacing the older practice of applying an image VAE frame by frame, which leaves motion between consecutive frames unsmooth. CV-VAE makes a related argument and adds a compatibility constraint so a video codec can share an existing image model's latent space. LTX-Video goes further and hands its decoder the final denoising step, producing clean pixels directly rather than paying for a separate upsampling module. So the decoder is not a passive last stop. It partly decides how detail, grain and motion land.

Why it matters on a production

Telling a decode artifact from a denoise artifact saves revision cycles. Buzzing texture, faint grid patterning in gradients and waxy skin return identically on every seed, so rerolling burns generations for nothing; the real fixes are a different model or a finishing pass. It also frames the deliverable. Generated footage arrives through a lossy learned codec, already baked at one resolution with one grain structure, so it holds less latitude than a log file off a camera. Say that to the colorist before the grade is scheduled rather than during it.

What people get wrong

Each of these is a belief worth dropping, followed by what is actually happening.

Terms this introduces

encoder
The half of the autoencoder that turns pixels into a latent, used during training and for image-to-video conditioning.
decoder
The half that turns a finished latent back into pixels, run once at the end of generation.
3D VAE
A video autoencoder that compresses along time as well as height and width.
reconstruction artifact
A defect introduced by decoding rather than by the diffusion process, so it repeats across seeds.
checkerboard artifact
Regular grid patterning produced by certain upsampling layers in a decoder.

Where this shows up in the directory

Models whose own documentation names this. It is evidence the vendor considers it relevant, not a judgement that the model is good or bad at it.

Further reading

Next

Sources