Image Generation
Creating images from descriptions — the math behind it, surprisingly mundane.
You type "a fox reading a newspaper in a cozy library, watercolor style" — and seconds later, an image appears that never existed before. No camera, no paintbrush, no artist. How does a machine turn words into pictures?
In this article, you will learn the fundamental mechanism behind tools like Midjourney, DALL-E, and Stable Diffusion. You will understand how text becomes an image, how prompts control the result, and why every image is unique — or can be.
DALL-E Creates Images from Text
A landmark breakthrough in text-to-image generation and a meaningful advance in AI creativity. On January 5, 2021, OpenAI unveiled DALL-E — a system that generates coherent and often remarkably creative images from text descriptions. Text-to-image models had existed before (such as alignDRAW in 2015 or GAN-based approaches like StackGAN and AttnGAN), but DALL-E raised coherence and versatility to a new level. Based on a 12-billion-parameter version of GPT-3, DALL-E demonstrated that the boundary between language and visual understanding can be crossed. The system trained on 250 million image-text pairs from the internet and developed noteworthy capabilities in the process: it can anthropomorphize animals, plausibly combine unrelated concepts, and even render text within images. Mark Riedl of Georgia Tech commented that the results were 'remarkably more coherent' than any previous text-to-image system. DALL-E successfully extended GPT's language understanding into the visual domain and opened an entirely new dimension of AI creativity.
Text-to-Image — How Words Become Pictures
Diffusion Model
The Pipeline: From Text to Image
Example: The prompt "a cat wearing a top hat, oil painting style" produces dramatic lighting in Midjourney. DALL-E 3 renders the text literally. Stable Diffusion depends heavily on the loaded checkpoint. Same words, three different images — because each model learned different visual patterns.
An artist interprets the description, chooses technique, colors, and composition. Result after hours or days.
The model translates text into an embedding and refines noise in seconds. Every result is a new creation.
Stable Diffusion: Open-source image generation
The democratization of AI image generation through the first powerful open-source model. On August 22, 2022, Stability AI released Stable Diffusion and significantly transformed access to advanced text-to-image technology. As the first open-source model of its class, Stable Diffusion could generate photorealistic 512x512-pixel images on consumer GPUs – an important advancement in speed and accessibility. Based on Latent Diffusion Models (LDMs), the system iterates through 'de-noising' in latent spaces instead of direct pixel manipulation. With 860 million parameters in the U-Net and 123 million in the text encoder, it remained relatively lightweight despite high performance. The GitHub-available source code enabled an explosively growing community to develop countless variants and tools. Stable Diffusion broke the monopoly of proprietary systems and made high-quality AI image generation accessible to everyone.
Warning: Photorealism
Deep Dive: The Model Landscape
Misconception: AI images are always recognizable as artificial
Midjourney V5: Photorealistic AI Art
Photorealistic AI image generation reaches a new quality level, considerably transforming the creative industry. On March 15, 2023, Midjourney released Version 5 and achieved a quality leap that users described as 'uncanny' and 'too perfect.' The alpha version could for the first time generate photorealistic images that were barely distinguishable from real photographs. Particularly noteworthy: the chronic problem of malformed hands was considerably improved — V5 could correctly render five fingers in most cases. Julie Wieland, a graphic designer, compared the experience to 'finally getting glasses after ignoring poor vision for too long' — suddenly seeing everything in 4K quality [Source: Ars Technica, March 2023]. Improved prompt sensitivity enabled more precise creative control, while automatic upscaling scaled 1024x1024-pixel base images without additional GPU costs. V5 sparked intense debates about the future of human creativity.
Interactive: Diffusion from Three Perspectives
How does the diffusion process turn noise into an image? Switch between three analogies to discover different perspectives on the same mechanism.
What is a Tensor?
A tensor is the fundamental data structure in modern AI systems. Depending on the perspective, tensors can be understood in very different ways. Switch between three analogies to experience different perspectives.
Diffusion as Sculpting from Noise
Imagine a sculptor starting with a block of pure noise — random pixels with no structure. Step by step, material is chiseled away: first rough outlines emerge, then shapes, then fine details. The finished image was always hidden inside the noise — the diffusion process revealed it.
Stable Diffusion starts with a tensor of Gaussian noise [64, 64, 4] in latent space. Over 20–50 denoising steps, the U-Net progressively removes noise, guided by the text prompt. Each step is like a chisel strike: targeted, but removing only a small amount of material.
Tensor Dimensions Compared
| Rank | Mathematics | Sculpture | AI Example |
|---|
Prompt Craft — The Art of Description
Prompt
Three Layers of a Good Prompt
Word order matters: "A beautiful sunset over mountains" generates a fundamentally different image than "Mountains with a beautiful sunset" because the model weighs early words more heavily.
Misconception: Longer prompts always produce better images
Seed & Reproducibility — Why Every Image Is Unique
Seed
The Seed Experiment
Deep Dive: CFG Scale & Steps
Misconception: Every generation is completely random
Key Takeaways
Quiz: Image Generation
Checkpoint: Image Generation
- Using the sculptor analogy, explain what happens during denoising — and where the analogy reaches its limits.
- Why does it make a big difference whether the word "oil painting" appears at the very beginning or at the very end of a prompt?
- You find a generated image almost perfect but want to add just one small detail (e.g. a cloud). What do you need to do?