How AI Makes Images

a from-scratch explainer

How AI Makes Images

From a pile of static to a brand-new apple: latent diffusion, every step shown.

Start with Chapter 1 โ†’

Hi โ€” I'm Sean Egan. This is the third of my explainer sites. The first, How LLMs Actually Work, takes a language model apart down to the bolts. The second, AI/ML from the Ground Up, maps the whole field. This one answers a different question, and the one people ask me most: when a machine makes a picture out of nothing, what is happening inside it?

The answer is simpler than most explanations let on. You take a real image and destroy it, slowly and deliberately, with random noise, until nothing is left but static. Then you teach a machine to walk that path backwards. Do it well enough and you can hand it pure static it has never seen and get back something new that never existed. We use an apple the whole way through, and every arrow in that apple โ†’ noise โ†’ apple diagram gets its own chapter.

Every step is shown. Where the video says "and it works out to," this site does the arithmetic in front of you, with the intermediate numbers on the page so you can check them with a calculator and land on the same digits I did.

What you need first

Arithmetic, and a willingness to look at an equation. That is the floor. Every symbol is defined the first time it appears, in the chapter where it appears, even if an earlier chapter already defined it.

Three ideas do get used a lot here, and this site explains each one where it is needed rather than assuming it. If you would rather meet them properly first, or you hit a chapter and want more ground under your feet, these are the pages that build them:

  • Numbers as directions. A list of numbers is also a point, and a point is also an arrow. Chapter 1 rebuilds this from scratch, and the longer version lives in Numbers That Point.
  • Learning by rolling downhill. How a model improves by nudging its numbers in the direction that lowers its error. Chapter 3 works one full update by hand; Rolling Downhill and Blame Flows Backward take their time with it.
  • Attention. Chapter 6 needs it to explain how a prompt steers the picture. Attention is the full treatment.

You do not need to read those first. Nothing here waits on them.

How this site works

Four parts, eight chapters. Part I builds the whole picture before any of the parts: an image as a point in space, and why adding noise is what makes generating one possible at all. Part II is the engine, a network trained to predict noise and the compression trick that makes running it affordable. Part III is the payoff: an apple assembled out of pure static, and then aimed with words. Part IV goes further, teaching a model one new thing with a very small file and extending the whole idea through time into video.

Every chapter has a narrated video that moves fast and stays visual, and then the written version, which skips nothing. Read the chapter for the math; watch the video for the shape of the idea. Either order works.