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 Diffusion models: how an AI image generator learned from pictures buried in noise

How AI image generators make a picture from your words

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

Denoising means removing noise. A trained diffusion model starts from a square of pure noise and removes a little of it at each step. Step by step, a picture appears that never existed before.

  1. 1 The diffusion model does the one thing it practiced: it guesses the noise, as if a picture lay underneath. Its guess covers nearly the whole square, all but a vague patch where some picture could be.the diffusionmodelits guessa vague patchleft out

    The diffusion model does the one thing it practiced: it guesses the noise, as if a picture lay underneath. Its guess covers nearly the whole square, all but a vague patch where some picture could be.

  2. 2 A helper program takes out only a little of that guess, not all of it. What is left still looks like noise, but it is no longer pure noise, so the next guess has a bit more to go on.a helper programwhat is left

    A helper program takes out only a little of that guess, not all of it. What is left still looks like noise, but it is no longer pure noise, so the next guess has a bit more to go on.

  3. 3 Guess, take a little out, guess again: each round is called a step. Large shapes settle first and details come last. Stable Diffusion 1.5 runs 50 steps, unless you pick another number.step 1step 20step 35step 50

    Guess, take a little out, guess again: each round is called a step. Large shapes settle first and details come last. Stable Diffusion 1.5 runs 50 steps, unless you pick another number.

  4. 4 After the last step, your fox sits in the snow. Nothing was ever under the noise: taking it away, step by step, made the picture up. This is called denoising.the first square:nothing under itNot bad, fora pile of noise.

    After the last step, your fox sits in the snow. Nothing was ever under the noise: taking it away, step by step, made the picture up. This is called denoising.

  5. 5 Strange, though: the diffusion model cannot read. Not one letter of your prompt reaches it. So how did this noise turn into a fox with a newspaper, and not a cat on a sofa?a fox readinga newspaperin the snow?Letters? I neversee a single one.

    Strange, though: the diffusion model cannot read. Not one letter of your prompt reaches it. So how did this noise turn into a fox with a newspaper, and not a cat on a sofa?

  6. Quick check

    A shortcut that does not work.Why not take out thewhole guess at once,and skip 49 steps?

    A shortcut that does not work.

    Show the answer

    You would get a blur. The first guess was made from pure noise, so all it leaves is a vague patch: small steps let each new guess build on a bit more picture.

  7. Go further

    The helper and the steps, as engineers name them.schedulerThe helper program: it decideshow much of each guesscomes out at each stepnumber of stepsA setting in many apps. Moresteps take longer. With nonechosen, the software of StableDiffusion 1.5 picks 50

    The helper and the steps, as engineers name them.

Next episode CLIP: how an AI image generator learned what your words look like

Share this comic

More comics