Making Things with AILesson 3 of 84

Module 1 · How the picture gets made

The small space the picture is built in

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 3 of 9 in this chapter

This chapter’s goalTrace one generated image from random noise to a saved file (naming the latent space, the text encoder, the denoising loop, the guidance term, the sampler and the seed) and say, with the published evidence, what a diffusion model does and does not retain from its training set.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Where the denoising actually happens1024 by 1024 by 3: the picture3,145,728 numbers. Thirty passes of a large networkover that many is why the first systems needed adata centre.The autoencoder’s encoderEight times smaller in each direction, and fourchannels instead of three.128 by 128 by 4: the latent grid65,536 numbers, forty-eight times fewer. One cellstands for an eight-by-eight block of the finalpicture.Every step, every mask, every conditioning mapAll of it happens here. Composition, colour and theshape of a face are decided at this resolution.The decoder, once, at the endSmall text, thin wires and distant faces were neverrepresented finely enough to survive the trip back.Push a photograph through the encoder and straight back out with no diffusion at all. What returns isthe best possible output of that model: no prompt, fine-tune or sampler beats it, because everythingleaves through this door.
Push a photograph through the encoder and straight back out with no diffusion at all. What returns is the best possible output of that model: no prompt, fine-tune or sampler beats it, because everything leaves through this door.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

A 512-pixel image is not built at 512 pixels

Running the denoising loop directly on pixels was tried, and it was ruinous. A 512 by 512 colour image is 786,432 numbers. Thirty passes of a large network over that many numbers, for every image, is why the first generation of these systems needed a data centre.

The fix that made image generation ordinary was to do the work somewhere smaller. Before the diffusion model ever sees your request, a separate network called a variational autoencoder (the VAE) has been trained to squash images into a compact grid and to restore them afterwards. In the widely used Stable Diffusion family, the squash factor is eight in each direction, with four channels instead of three:

Text
image   512 x 512 x 3  =  786,432 numbers
latent   64 x  64 x 4  =   16,384 numbers   (48x fewer)

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Yetunde, your AI tutor

How to cite: Addaly (2026) ‘The small space the picture is built in’, in Making Things with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/making-things-with-ai/the-latent-space (Accessed: 29 November 2026).