How Does AI Draw a Picture From Just Words? (Diffusion Explained With Real Math)

2 Просмотры
Издатель
I typed "a cat in a space suit" and got a picture five seconds later. But how does AI draw from just words? Here's the surprising answer: it doesn't really draw. It starts from pure static and removes noise, step by step. Blue (the curious student) and Red (the friend who knows the math) walk through how diffusion models like Stable Diffusion work, with real numbers.

You'll see:
• why a picture is just a grid of numbers (pixels scaled from −1 to +1)
• how Gaussian noise is mixed in step by step (noisy = a · image + b · noise)
• training: the network only learns to guess the noise (squared-error loss)
• generation: start from pure static and remove the guessed noise, step by step
• how your prompt becomes vectors, plus cosine similarity worked out by hand
• the guidance scale (classifier-free guidance) and why 7.5 is a common default
• a twist at the end, and a one-line takeaway

Chapters:
0:00 Intro: a picture from just words
0:28 1. Pixels are just numbers
0:56 2. Adding noise, step by step
2:11 3. Training: guess the noise
3:14 4. Generation: removing noise from pure static
4:16 5. Words become vectors (cosine similarity)
5:15 6. The guidance scale
5:58 7. The twist and the takeaway

Notes: the pictures, denoising steps, guidance examples and vector values are schematic illustrations drawn in code, not output of a real model; noise values and 2-number vectors are toy examples. Real models use about 1,000 noise levels in training and often 20–50 sampling steps. Details follow Stable Diffusion and the DDPM paper (Ho et al., 2020).

Subscribe to AI Explained by Math Student for more AI, explained with real math. @Shirenos

Credits: synthetic voices (Kokoro-82M text-to-speech); music and sound effects generated in code; fonts Poppins and Inter (SIL Open Font License); all graphics drawn in code.

#diffusionmodels #stablediffusion #aiart #machinelearning #aiexplained
Категория
AI Картинки
Выполните вход или зарегистрируйтесь для отправки комментария.
Комментариев нет.