Prompt & Done · DENOISE
Watch an AI image come out of static, on your own computer
The free setup from the reel: Stable Diffusion XL running locally with Hugging Face diffusers, saving the picture after every one of its 30 clean-up steps, so you can see the static turn into an image.
Tested 7 Nov 2026 on an Apple M5 Max (64 GB): ~10.5 s per 768x1344 image, 30 steps, after a one-time model download (~7 GB for the fp16 weights).
1 What you need
An Apple-silicon Mac with 16 GB+ memory, or a PC with an NVIDIA GPU (8 GB+ VRAM), and Python 3.10+. It runs fully offline after the download and costs nothing.
2 Install (one time)
python3 -m venv sdxl && source sdxl/bin/activate
pip install torch diffusers transformers accelerate safetensors pillow3 Generate and save every step
Save as steps.py and run python steps.py. Change the prompt or the seed; a new seed = new starting static = a different picture. On NVIDIA, replace "mps" with "cuda".
import torch, os
from diffusers import StableDiffusionXLPipeline
pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0",
torch_dtype=torch.float16, variant="fp16", use_safetensors=True).to("mps")
pipe.vae.to(torch.float32) # decode in fp32 (fp16 VAE can give black images)
os.makedirs("steps", exist_ok=True)
def save(lat, path):
with torch.no_grad():
x = pipe.vae.decode(lat.float() / pipe.vae.config.scaling_factor).sample
x = ((x[0].clamp(-1, 1) + 1) * 127.5).byte().permute(1, 2, 0).cpu().numpy()
from PIL import Image; Image.fromarray(x).save(path)
def each_step(p, i, t, kw): # called after every denoising step
sigma = float(p.scheduler.sigmas[i + 1])
save(kw["latents"] / (sigma ** 2 + 1) ** 0.5, f"steps/step{i+1:02d}.png")
return kw
g = torch.Generator("cpu").manual_seed(7)
pipe("a red fox standing in a snowy pine forest at golden hour, cinematic wildlife photograph",
width=768, height=1344, num_inference_steps=30, guidance_scale=7.0,
generator=g, callback_on_step_end=each_step)Open the steps folder: step01 is static, around step15 the shape appears, step30 is the finished image. Turn them into a clip with ffmpeg -framerate 12 -i steps/step%02d.png steps.mp4.
4 How it works, in three lines
Training: millions of images get noise added at random strengths and the network learns to predict that noise. Generating: start from pure random noise (set by the seed) and remove a little at a time. Your prompt is turned into numbers by two text encoders, and every step is steered toward them.
Hugging Face: SDXL base 1.0 (license CreativeML Open RAIL++-M) · diffusers: pipeline callbacks · DDPM paper