Skip to main content

Classic design · Staff

High-resolution image synthesis

Classic interview design. Key points: VQ-VAE/VQGAN, latent compression, and super-resolution.

17 min read · Content reviewed on October 23, 2026

Short answer

Classic interview design. Key points: VQ-VAE/VQGAN, latent compression, and super-resolution. Generating high-resolution images is the subject of the book Generative AI System Design Interview: chapter 8 has exactly this title. This case treats it as a problem of machine learning system design.

01 · CONTEXT

Why high resolution is a cost problem

Generating high-resolution images is the subject of the book Generative AI System Design Interview: chapter 8 has exactly this title. This case treats it as a problem of machine learning system design.

Two open research papers show where the cost appears. Transformers are expressive but computationally infeasible for long sequences, such as high-resolution images. Diffusion models that operate directly in pixel space, meanwhile, often consume hundreds of GPU days in optimization, and inference is expensive because it requires sequential evaluations.

02 · LATENT COMPRESSION

Three ways to generate without touching the pixels

VQ-VAE is the basis of discrete compression: the encoder emits discrete codes, not continuous ones, and the prior is learned instead of fixed. With an autoregressive prior over these representations, the model generates high-quality images.

The Taming Transformers paper combines CNNs, which learn a vocabulary of image constituents, with transformers, which model the composition of those constituents in high-resolution images.

Latent diffusion models apply diffusion in the latent space of pretrained autoencoders, which significantly reduces computational requirements compared to pixel-space diffusion. That is the argument of cost at scale for working in latent space.

AbordagemCompressionGenerator
VQ-VAEEncoder that emits discrete codesLearned autoregressive prior
Taming TransformersCNNs learn a vocabulary of image constituentsTransformer models the composition of the constituents
Latent diffusionPretrained autoencoder defines the latent spaceDiffusion model applied in that space

03 · SERVING

From request to final image

The diagram below shows an asynchronous service that generates in latent space, decodes, and refines the image in a cascade.

  1. In the diagram, the client calls the API gateway, which puts the request on the job queue.

    Architecture diagram: High-resolution image: generation service
    CLClient
    NWAPI gateway
    QJob queue
    CPLatent generation worker
    CPAutoencoder decoder
    CPSuper-resolution refiner
    DBImage storage
    EDGCDN
  2. The generation worker operates in the latent space of a pretrained autoencoder, instead of operating directly in pixel space.

    Architecture diagram: High-resolution image: generation service
    CLClient
    NWAPI gateway
    QJob queue
    CPLatent generation worker
    CPAutoencoder decoder
    CPSuper-resolution refiner
    DBImage storage
    EDGCDN
  3. In the diagram, the autoencoder's decoder receives the worker's output and passes it to the refiner.

    Architecture diagram: High-resolution image: generation service
    CLClient
    NWAPI gateway
    QJob queue
    CPLatent generation worker
    CPAutoencoder decoder
    CPSuper-resolution refiner
    DBImage storage
    EDGCDN
  4. Generative models can be chained with super-resolution models; this cascade is what the refiner represents in this diagram.

    Architecture diagram: High-resolution image: generation service
    CLClient
    NWAPI gateway
    QJob queue
    CPLatent generation worker
    CPAutoencoder decoder
    CPSuper-resolution refinernew
    DBImage storage
    EDGCDN
  5. A diffusion-based refiner, such as SR3, starts from pure Gaussian noise and refines the output iteratively, with a U-Net trained to remove noise at several levels.

    Architecture diagram: High-resolution image: generation service
    CLClient
    NWAPI gateway
    QJob queue
    CPLatent generation worker
    CPAutoencoder decoder
    CPSuper-resolution refiner
    DBImage storage
    EDGCDN
  6. In the diagram, the final image goes to storage and is delivered to the client through the CDN.

    Architecture diagram: High-resolution image: generation service
    CLClient
    NWAPI gateway
    QJob queue
    CPLatent generation worker
    CPAutoencoder decoder
    CPSuper-resolution refiner
    DBImage storage
    EDGCDN

04 · TRAINING

Training in two stages

The diagram below separates the autoencoder's training, which defines the latent space, from the generator's training, which operates in that space.

  1. In the diagram, the image dataset feeds the autoencoder training.

    Architecture diagram: High-resolution image: training pipeline
    DBImage dataset
    CPAutoencoder training
    DBLatent representations
    CPLatent generator training
    DBCheckpoints
    CPSample evaluation
    NWTraining metrics
  2. In a discrete version, as in VQ-VAE, the encoder emits discrete codes, not continuous ones, and the prior is learned.

    Architecture diagram: High-resolution image: training pipeline
    DBImage dataset
    CPAutoencoder training
    DBLatent representations
    CPLatent generator training
    DBCheckpoints
    CPSample evaluation
    NWTraining metrics
  3. In the diagram, the latent representations are kept in storage and serve as input for the generator training.

    Architecture diagram: High-resolution image: training pipeline
    DBImage dataset
    CPAutoencoder training
    DBLatent representations
    CPLatent generator training
    DBCheckpoints
    CPSample evaluation
    NWTraining metrics
  4. In the Taming Transformers paper the generator is a transformer that models the composition of the image's constituents; in latent diffusion, the generator is a diffusion model applied in latent space.

    Architecture diagram: High-resolution image: training pipeline
    DBImage dataset
    CPAutoencoder training
    DBLatent representations
    CPLatent generator training
    DBCheckpoints
    CPSample evaluation
    NWTraining metrics
  5. Operating in latent space significantly reduces computational requirements, compared to pixel-space diffusion.

    Architecture diagram: High-resolution image: training pipeline
    DBImage dataset
    CPAutoencoder training
    DBLatent representations
    CPLatent generator training
    DBCheckpoints
    CPSample evaluation
    NWTraining metrics
  6. In the diagram, the checkpoints feed sample evaluation, whose measurements go on to the training metrics.

    Architecture diagram: High-resolution image: training pipeline
    DBImage dataset
    CPAutoencoder training
    DBLatent representations
    CPLatent generator training
    DBCheckpoints
    CPSample evaluationnew
    NWTraining metrics

05 · DECISIONS

Pixels or latent, and how to condition

Operating spaceReported cost
Pixel-space diffusionOften consumes hundreds of GPU days in optimization, and inference is expensive because of sequential evaluations
Latent diffusionSignificantly reduces computational requirements compared to pixel-space diffusion

To control the result, cross-attention layers make diffusion a flexible generator for general conditioning inputs, such as text or bounding boxes.

Frequently asked questions

What is High-resolution image synthesis?

Classic interview design. Key points: VQ-VAE/VQGAN, latent compression, and super-resolution.

What does the High-resolution image synthesis design cover?

It is organized in these sections: Why high resolution is a cost problem, Three ways to generate without touching the pixels, From request to final image, Training in two stages, and Pixels or latent, and how to condition.

How long is High-resolution image synthesis and what level is it?

It takes about 17 minutes to read and is rated Staff level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.