AI vẽ một bức tranh từ nhiễu như thế nào?
Diffusion (model ảnh khử nhiễu) · Cơ bản · 5 phút · training, sampling
Model diffusion vẽ bằng cách bắt đầu từ nhiễu ngẫu nhiên và mỗi bước bỏ đi một chút nhiễu mà nó đoán ra. Nó học bằng cách thêm nhiễu vào ảnh thật rồi đoán lại nhiễu đó; prompt quyết định bức ảnh nào hiện ra.
1 Đoán trước
2 Xem
From noise to a picture
1 / 4step 0 · 100 % picture step 200 · 81 % picture step 500 · 28 % picture step 1000 · 0.6 % picture training: noise added over 1,000 steps · picture illustrative · mix and schedule: DDPM (Ho et al., 2020)
Training: take a picture and add noise, a little per step, until nothing of it is left.
Khi huấn luyện, nhiễu được thêm vào ảnh cho tới khi không còn gì; model học cách đoán nhiễu đó, còn lúc vẽ thì chạy đúng việc ấy theo chiều ngược lại, từ nhiễu thuần tuý, do prompt dẫn đường.
Khi huấn luyện, model thấy ảnh với đủ mọi mức nhiễu và chỉ học một kỹ năng: đoán nhiễu. Vẽ là chạy ngược kỹ năng đó. Stable Diffusion làm việc trên một phiên bản nén nhỏ của bức ảnh, gọi là latent (một mã gọn đại diện cho ảnh), rồi cuối cùng mới đổi nó thành điểm ảnh.
4 Bạn là model
Bạn là bộ khử nhiễu. Bốn lần, chọn bức ảnh tiếp theo, ít nhiễu hơn, hợp với prompt “a sun over a field” (mặt trời trên cánh đồng).
prompt: “a sun over a field” · same starting noise every time
now: step 1000 options mixed with DDPM’s schedule from the same noise · pictures illustrative
You are the denoiser: pick the next, less noisy picture that fits the prompt.5 Kiểm tra
Seed (con số chọn ra nhiễu ban đầu) quyết định bức ảnh bắt đầu từ đâu. API của Stability gọi nó là “the seed used as random noise for this generation” (seed dùng làm nhiễu ngẫu nhiên cho lần tạo này). Cùng prompt và seed, cùng bức ảnh; seed mới, ảnh mới. Không phải model ảnh nào cũng công bố cách hoạt động, nên ta chỉ gọi là diffusion khi chính hãng nói vậy.
7 Nói lại bằng lời bạn
8 Nhiệm vụ · 5 phút
Với 25 credit miễn phí của Stability AI, gọi Stable Diffusion 3.5 Medium (3,5 credit một ảnh) ba lần cùng một prompt: seed 42, lại seed 42, rồi seed 7. Hai ảnh seed 42 giống hệt nhau; seed 7 bắt đầu từ nhiễu khác và cho ra ảnh khác.
Ba câu nhanh
Rút ngẫu nhiên từ bộ câu hỏi của bài; lần sau sẽ khác.
Xong chưa?
Đọc thêm
Nguồn
- https://arxiv.org/abs/2006.11239 (Ho, Jain, Abbeel; v1 2020-06-19; checked 2026-10-21): forward process adds Gaussian noise over T = 1000 steps, β linear 1e-4 → 0.02; x_t = √ᾱ_t·x₀ + √(1−ᾱ_t)·ε; network trained to predict ε. The shares 81 %, 28 %, 0.6 % (steps 200, 500, 1000) are √ᾱ_t of that schedule (arithmetic)
- https://arxiv.org/abs/2112.10752 (Rombach et al.; v1 2021-12-20, v2 2022-04-13; checked 2026-10-21): diffusion “in the latent space of powerful pretrained autoencoders”; cross-attention layers for conditioning inputs such as text
- https://docs.stability.ai/api-reference/generate/stable-diffusion-35 (checked 2026-10-21): SD3.5 Large Turbo “a distilled version… in just 4 steps”; seed “The seed used as random noise for this generation”; cfg_scale “how strictly the diffusion process adheres to the prompt text”; SD 3.5 Medium 3.5 credits per generation; 1-megapixel output
- https://docs.stability.ai/pricing (checked 2026-10-21): “Get started with 25 free credits.”; 1 credit = $0.01
- https://huggingface.co/black-forest-labs/FLUX.1-schnell (checked 2026-10-21): “12 billion parameter rectified flow transformer”; “high-quality images in only 1 to 4 steps”
- The 16×16 pictures, the noise (seed 7) and the sun/house options are illustrative, mixed with DDPM’s schedule; the “guessed noise” frame is the exact noise, labelled as a perfect guess
Đăng Oct 21, 2026 · cập nhật Oct 21, 2026