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 actually happening?

The answer is stranger and simpler than most explanations let on. You take a real image and destroy it โ€” slowly, 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 will 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 genuinely 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 โ€” 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 machinery: 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.

Part I

The Idea

One apple, turned into static and back again. This part builds the whole picture before any of the machinery.

    1The Big PictureImages as points, apples as a neighborhood, and why we add noise on purpose 2Destroying an AppleThe forward process: Gaussian noise, a schedule, and the shortcut to any step

Part IV

Going Further

Teaching the model one new thing cheaply, and extending the whole idea through time.

    7LoRAs and AdaptersTeaching a frozen model one new thing with a very small file 8Making It MoveVideo diffusion: the same idea, with time added as a dimension