You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode An AI picture starts as a square of random dots

How AI image generators make a picture from your words

Diffusion models: how an AI image generator learned from pictures buried in noise

An AI image generator must learn before it can make any picture. In training, it gets real photos covered with random noise, again and again. This one strange exercise teaches it to make new pictures.

  1. 1 Go back to long before you typed. Miva, a researcher, sets a training program to work on the model, with a huge collection of real pictures.MivaTeach it withreal pictures!the trainingprogramreal pictures

    Go back to long before you typed. Miva, a researcher, sets a training program to work on the model, with a huge collection of real pictures.

  2. 2 The training program takes one real picture and pours noise on it, dots it picks at random. It keeps a copy of that noise, so it knows exactly what it added.And I keepa copy!its copyof the noise

    The training program takes one real picture and pours noise on it, dots it picks at random. It keeps a copy of that noise, so it knows exactly what it added.

  3. 3 The model gets the noisy picture, but neither the clean picture nor the copy. Its one exercise: guess which dots are the noise.the modelThese dots,I'd say.its guess

    The model gets the noisy picture, but neither the clean picture nor the copy. Its one exercise: guess which dots are the noise.

  4. 4 The training program lays the guess over its copy and spots where they differ. The model is made of millions of numbers called parameters, and the program turns each one a tiny bit, toward a better guess.the guessthe copyparametersA tiny turnfor each one.

    The training program lays the guess over its copy and spots where they differ. The model is made of millions of numbers called parameters, and the program turns each one a tiny bit, toward a better guess.

  5. 5 Then a new picture, with a little noise, or with so much that the picture almost disappears. A few thousand pictures at a time, for hundreds of thousands of rounds. Burying pictures in noise is called diffusion, and a model trained this way is a diffusion model.a little noisealmost lostagain and againa diffusion model

    Then a new picture, with a little noise, or with so much that the picture almost disappears. A few thousand pictures at a time, for hundreds of thousands of rounds. Burying pictures in noise is called diffusion, and a model trained this way is a diffusion model.

  6. 6 Then training is over. The parameters stop moving for good, and the diffusion model goes out into the world. Its first real job: the square your fox starts from.parameters,set for goodyour square

    Then training is over. The parameters stop moving for good, and the diffusion model goes out into the world. Its first real job: the square your fox starts from.

  7. Quick check

    A training program that forgot its copy.The training programforgot to keep its copyof the noise. Can itstill teach the model?

    A training program that forgot its copy.

    Show the answer

    No. Without the copy it cannot see where the guess is wrong, so it does not know which way to turn the parameters.

  8. Go further

    What engineers call the amount of noise and the size of the miss.noise levelHow much noise is poured.Stable Diffusion 1.5 learned1,000 levels, and eachexercise picks one at randomlossHow far the guess is fromthe copy, as one number.Each tiny turn of theparameters aims to shrink it

    What engineers call the amount of noise and the size of the miss.

Next episode Denoising: how an AI image generator makes up a picture out of pure noise

Share this comic

More comics