# AI Diffusion Model Visualization

How diffusion models turn noise into pictures

By DUSK

Topic: Computing, AI &amp; Electronics

[Open the interactive Jig](https://ask.jig.com/j/fB1Q4RuV9xuc)

## Transcript

### 1. From static to a picture · 从噪点到图画

This bench shows how an AI diffusion model makes a picture\. It starts from pure random static and cleans away a little at a time until an image appears\. The pictures here are drawn to illustrate each stage\. Drag empty space to turn the bench\.

扩散模型从纯随机噪点开始，每次去掉一点噪声，直到出现一幅图画。这里的图片是示意图。拖动空白处可以旋转视角。

### 2. Adding noise · 加噪

To learn, the model first watches real pictures being ruined\. Training adds a little random noise again and again, 1,000 times, until only static is left\. Slide to add noise and watch the shapes vanish\.

训练时，模型把真实图片一点点加噪，重复1000次，直到只剩噪点。拖动滑块加噪，看看形状如何消失。

### 3. Latent space · 潜空间

Working on every pixel is slow, so Stable Diffusion first squeezes a picture into a small code\. 512×512×3 = 786,432 numbers become a 64×64×4 latent of 16,384 numbers, 48 times fewer\. The four green layers are that code; the decoder turns it back into pixels at the end\.

为了更快，模型先把图片压缩成“潜空间”编码：786,432个数变成64×64×4＝16,384个数，少了48倍。四层绿色图层就是这个编码，最后由解码器还原成像素。

### 4. The network predicts noise · 网络预测噪声

The U\-Net, a network with about 860 million adjustable numbers, looks at the noisy latent and guesses which part is noise\. It predicts the static, not the picture\. A scheduler subtracts part of that guess, and the latent becomes a little cleaner\.

U\-Net网络约有8\.6亿个参数。它观察带噪的潜空间，预测其中的噪声，而不是直接画图。调度器减去一部分预测的噪声，图像就更清晰一点。

### 5. Words become numbers · 文字变成数字

A text encoder turns your prompt into numbers: 77 tokens, each described by 768 numbers\. Inside the U\-Net, cross\-attention layers read those numbers at every step and steer each guess toward your words\.

文本编码器把提示词变成数字：77个词元，每个用768个数描述。U\-Net里的交叉注意力层在每一步读取这些数字，把去噪引向提示词。

### 6. How strongly to follow · 引导强度

Each step the network guesses twice: once with your prompt and once with an empty one\. Guidance pushes the result away from the plain guess and toward your words\. Stable Diffusion's default is 7\.5; slide low for a vague picture or high for a harsh one\.

每一步网络猜两次：有提示和无提示。引导强度把结果推向提示词。默认值是7\.5；太低图像模糊，太高颜色过于浓烈。

### 7. The timeline · 时间轴

Image makers today need only about 20 to 50 steps, not 1,000\. Scrub the timeline or tap a frame on the rail\. Big shapes and colours settle first; fine edges arrive last\.

如今生成一张图只需约20到50步。拖动时间轴，或点击轨道上的画框：先出现大形状和颜色，细节最后出现。

### 8. Same noise, new words · 同样的噪声，不同的提示

Pick another prompt\. The run starts again from the very same static, so the layout often stays alike while the picture follows the new words\. With the same noise, prompt and settings, you get the same picture every time\.

换一个提示词。从同样的噪声重新开始，构图往往相似，内容却跟随新提示。噪声、提示和设置都相同，就会得到同样的图。

### 9. Learned, not copied · 学来的，不是复制的

A diffusion model does not search a library of stored pictures\. It learned patterns from many training images and builds a new one by removing noise step by step\. Static, a few words and many small guesses add up to an image\.

扩散模型不是在图库里搜索图片。它从大量训练图像中学到规律，再一步步去噪生成新图。噪点、几句话和许多小小的猜测，合成了一幅图。
