КАДР

How AI generates pictures: diffusion in plain words

Alen founder of KADR Updated 2026-10-01 7 min read

AI generates an image not by drawing but by removing noise. It takes a frame of random dots and over a few dozen steps gradually removes what is unnecessary, revealing the picture like a photo in developer. The text of your prompt works as a hint about where exactly to steer that cleanup. This approach is called diffusion, and understanding its mechanics explains all of the models' behaviour: why they mix up fingers, why they love averaged beauty and why the same description gives different results. Let us go through it without formulas.

The main idea: the picture emerges from noise

Intuition suggests that AI draws a picture like an artist: line by line, object by object. That is wrong.

In fact the model works the other way round. It starts with a frame of pure random noise, like the static on an old TV, and gradually removes what is unnecessary until a meaningful image appears.

The closest real-world analogy is developing photographic film. You put the sheet into developer: first it is murky, then outlines appear, then details, and at the end a finished photograph. The model does the same thing, only with mathematics instead of chemistry, and it can point its «developer» at any image you describe in words.

This process is called diffusion, and it was inspired by physics: by how a drop of ink spreads in water. The model was taught to run that spreading in reverse, gathering the drop back together.

How it was taught

For the model to be able to remove noise, it was first taught to add it.

You take a huge set of real pictures. Noise is mixed into each one step by step: a little, then more, then more again, until nothing but static is left of the image. At each step the model remembers what the frame looked like before and after the noise was added.

Having repeated this on hundreds of millions of images, the model learns the reverse operation: given a noisy frame, predict what it looked like slightly cleaner. And if it can do one step of cleanup, then by repeating it many times it can go all the way from pure noise to a finished picture.

The key point: the model does not memorise pictures. It memorises patterns, how images are usually structured. That is why it can create things that were not in its training: it has never seen a cat in a spacesuit, but it has seen both cats and spacesuits and knows what each looks like.

Where your text comes in

So far we have described how the model makes some picture out of noise. But you need a specific one. This is where the prompt comes in.

Your text is first turned into numbers. This is done by a separate component, the text encoder, trained to link words with images. It has seen millions of «picture and its caption» pairs, so it knows that the word «sunset» corresponds to certain colours and shapes.

These numbers become a hint at every cleanup step. Roughly speaking, at each step the model asks itself: «in which direction should I remove noise so the result looks more like what the text describes?»

This leads to an important practical conclusion: the model understands meaning rather than looking for exact words. It does not matter whether you wrote «car» or «automobile». What matters is the concept. So a detailed, meaningful description works better than a list of keywords.

Why one description gives different pictures

You have surely noticed: you press generate twice with the same prompt and get two different images.

The reason is the starting noise. Each generation starts from its own random frame of static. Different noise at the input leads to a different picture at the output, even if the text is the same.

This is controlled by the seed parameter, the number from which the starting noise is generated. The same seed plus the same prompt give an identical result. Change the seed and you get a variation. This is exactly how professionals lock in a good shot or create a series of similar ones: they play with the seed while keeping the prompt unchanged.

Latent space: why it is fast

A full-size picture is millions of pixels. Running noise through all of them at each of dozens of steps would be monstrously expensive.

So modern models work not with pixels but with a compressed representation of the image, called latent space. It is like working with a sketch instead of a detailed painting: the essence is kept, but there are many times fewer details, so computing is faster.

The whole diffusion process takes place in this compressed form. Only at the very end, when the picture has «developed», does a separate component expand it back into a full-size image with all its pixels.

That is why generation takes seconds, not hours. And that is why there are different resolutions: it can be expanded to different sizes, and the bigger, the more expensive.

Now it is clear why the model mixes up fingers

The famous bad hands problem is explained precisely by how diffusion works.

The model does not know a human has five fingers. It has no concept of anatomy, a skeleton or a three-dimensional body. It has seen millions of flat pictures and remembered statistical patterns: how pixels usually look next to other pixels.

With hands these patterns are especially treacherous:

  • Fingers look alike. The model sees a group of elongated pink shapes and adds one more «just in case».
  • Fingers overlap each other. In a photo some fingers are hidden behind others. Reconstructing them, the model may «draw in» extra ones.
  • A hand takes thousands of shapes. A face is almost always frontal and symmetrical, while a hand can be in any position. The variety throws off the statistics.
  • The model assembles the picture in parts and does not keep an overall count. It may add a finger on one side, forgetting how many there already are on the other.

The good news: new models do noticeably better than old ones. The more detailed the model and the more high-quality images of hands it was trained on, the less often it makes mistakes. But the problem has not gone away completely and is unlikely to while models remain statistical rather than understanding anatomy.

A detailed breakdown of artefacts and how to fix them is in a separate article: why AI draws bad hands.

Why the model loves averaged beauty

Another consequence of the mechanics. The model is trained to predict the most likely result. And the most likely is the average across the training data.

So without a specific prompt it pulls towards a generically pretty picture: symmetrical faces, smooth skin, pleasant light. Not because it has taste, but because there were the most images like that in training.

Hence a practical conclusion that links theory with practice: to get something specific rather than average, you need to pull the model away from the median with a precise description. That is exactly what the article on how to write prompts is about.

In short

AI does not draw a picture; it develops it out of random noise, removing what is unnecessary step by step. The prompt text steers this cleanup. All of this happens in a compressed latent space for speed, and at the end it is expanded into a full-size image.

Everything else follows from these mechanics: different pictures from one prompt (different starting noise), bad fingers (no understanding of anatomy), a love of averaged beauty (the model predicts the most likely outcome). Understand the mechanics and you understand how to talk to the model.

Frequently asked questions

How does AI create an image?
It starts not with a blank page but with a frame of random noise, and over a few dozen steps it gradually removes what is unnecessary, revealing the picture. The text of the prompt steers this cleanup, hinting at what exactly should appear. The method is called diffusion.
What is a diffusion model in simple terms?
It is a model that was taught to turn noise into a meaningful picture. During training it was shown images with noise gradually added to them, and it learned what the reverse process looks like. Now it can assemble an image from pure noise, following a text description.
Why does AI draw people with extra fingers?
Because it does not know a human has five fingers. It does not understand anatomy; it only repeats statistical patterns from millions of pictures. Fingers look alike, often overlap each other and change shape depending on the gesture, so the model easily gets their number wrong.
Why does the same description give different pictures?
Because each generation starts from its own random noise. Different starting noise leads to a different result, even if the prompt text is the same. The seed parameter is responsible for reproducibility: fix it and you get the same shot.
What is latent space?
It is a compressed internal representation of an image that the model works with instead of millions of individual pixels. Working in it is many times faster and cheaper in computation. At the very end the finished result is expanded from this compressed form back into a full-size picture.
How does the model understand the prompt text?
The text is turned into a set of numbers by a special text encoder trained to link words and images. These numbers become a hint for the noise-removal process. So what matters is not individual words but meaning: the model understands concepts rather than looking for exact matches.

See diffusion in action

KADR brings together different image generation models, from fast ones to flagships. You can see with your own eyes how different architectures handle one prompt. Pay in rubles, the generation price is shown before you start.

Open KADR
Alen
Founder of KADR. 5 years in automation, more than 50 projects. I connect generation models directly through their APIs, so I write about what I work with every day.