DALL-E and DALL-E 2 (2021 to 2022): Text Becomes Pictures

From an avocado armchair in a research blog post to a million-person waitlist in eighteen months

Contents

On 5 January 2021 OpenAI published a short research post that opened with a sentence anyone could picture: “an armchair in the shape of an avocado”. Underneath were rows of images of exactly that, green shells with a pit-coloured cushion, some more convincing than others. The model that drew them was called DALL-E, a name that mixes the painter Salvador Dalí with Pixar’s robot WALL-E. Few people outside machine learning noticed at first, and nobody could use it. Eighteen months later, in July 2022, the second version opened to a waitlist of a million people, and by the end of that summer the idea of typing a sentence and getting a picture had become an everyday thing.

This post follows the two models as separate designs, because they share a name and almost nothing else. The first treats pictures as a language. The second treats them as noise to be cleaned up. The shift between them is the same shift that took the whole field from GANs to diffusion.

DALL-E (January 2021): pictures as a second language

The first DALL-E was an application of an idea that had just proved itself on text. GPT-3 had shown that a big transformer trained to predict the next token could do remarkable things. The DALL-E team, led by Aditya Ramesh, asked whether the same recipe worked if some of the tokens were pieces of an image.

The paper, “Zero-Shot Text-to-Image Generation”, reached arXiv on 24 February 2021, with Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen and Ilya Sutskever as co-authors. Its design is deliberately plain: a transformer that “autoregressively models the text and image tokens as a single stream of data”. Several steps make that possible.

Turning pixels into tokens. A 256 by 256 image has far too many pixels to treat as a sequence. A first, separate network, a discrete variational autoencoder, compresses each image into a 32 by 32 grid of tokens, each chosen from a vocabulary of 8,192 learned “image words”. That cuts a picture to 1,024 tokens while keeping its overall look, with some loss of fine detail, which is why DALL-E 1 images look slightly soft.

One long sentence. The caption, up to 256 text tokens, is placed first, followed by the 1,024 image tokens. The transformer, which has 12 billion parameters, is trained to predict each token from all those before it. Because the caption comes first, every image token is generated knowing the whole caption. At generation time you supply a caption and the model writes out the image tokens one at a time, like finishing a sentence. The decoder half of the autoencoder turns the tokens back into pixels. The training data was roughly 250 million text and image pairs from the internet.

Choosing the best of many. DALL-E 1 was inconsistent, so OpenAI sampled many candidates for each caption and used CLIP, released the same day, to rerank them by how well they matched the text. The pictures in the blog post were this best-of-many selection. That is an honest design choice and also a reason to read the showcase with some care: the gallery shows the model’s good days.

The results were striking for the time. The model could combine concepts it had never seen together, such as the avocado chair or a “snail made of a harp”, and it could render a described object in different styles or from different viewpoints. It also showed rough, unreliable handling of attributes: ask for a red block on a blue block and sometimes the colours swap. The model was never released. OpenAI offered a demo page and a paper, and the community answered with open reimplementations. The best known, DALL-E Mini by Boris Dayma and colleagues (later renamed Craiyon), went viral in mid-2022 and let anyone make wobbly, meme-ready images from a prompt. Its crude output made the case that people wanted this.

DALL-E 2 (April 2022): a different machine

The sequel, announced in April 2022, threw out the token-stream design. The paper, “Hierarchical Text-Conditional Image Generation with CLIP Latents” by Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu and Mark Chen, appeared on arXiv on 13 April 2022. It proposes a two-stage system, which the authors informally call unCLIP, because it runs CLIP backwards.

A painted-style portrait of a girl in a blue headscarf and gold earring against a dark background.
A DALL-E 2 variation image in the manner of a Dutch Golden Age portrait, released into the public domain on Wikimedia Commons. Photo: DALL-E 2 variation 2 by Webbnet, DALL·E 2, Public domain, via Wikimedia Commons.

Recall that CLIP maps images and text into one shared space, so a caption and a matching photograph land close together. DALL-E 2 uses that space as the hinge of the whole design.

DALL-E 2 (unCLIP): text to a CLIP image embedding, then embedding to pixelsCaptionCLIP textPriorImageembeddingDiffusiondecoderTwo upsampling diffusion models then take the decoder output up to 1024x1024.
The unCLIP pipeline. The prior and the decoder are separate models, joined by a CLIP embedding.
  1. The prior. Given the caption’s CLIP text embedding, a model called the prior predicts a CLIP image embedding, the point in the shared space where a picture of this caption might live. The authors tried an autoregressive prior and a diffusion prior and found the diffusion version computationally more efficient and better in quality.
  2. The decoder. A diffusion model takes that image embedding and generates a picture, starting from noise and gradually removing it. It is built on OpenAI’s earlier GLIDE work, with the embedding added as extra guidance. Two further diffusion models upsample the result from 64 by 64 to 256 by 256 and then to 1024 by 1024 pixels.

Splitting the problem this way has a useful consequence. The CLIP embedding captures what an image means (the objects, the style, the mood) and discards the exact pixels. The decoder can therefore produce many different images from one embedding, all faithful to its meaning but varying in the details. That is how DALL-E 2 offers “variations”: encode a picture, then decode it several times. It also allows blending two images by interpolating between their embeddings, and editing with text by moving an embedding in the direction of a caption.

The practical gains over the first model were large. The images were four times the linear resolution, 1024 by 1024 against 256 by 256. They were sharper, followed captions more closely and handled lighting and photographic style much better. The system added inpainting (rubbing out part of a picture and describing what should replace it) and outpainting (extending a picture past its edges), which turned it from a novelty into something editors could use. In the paper’s own human evaluations, annotators preferred DALL-E 2 to the earlier GLIDE model for both caption fidelity and photorealism.

The paper also lists failures, and they are instructive. The system struggled to bind attributes to objects (a blue cube on a red cube, or the reverse), rendered text as convincing gibberish, and handled complex scenes with many details poorly. The authors link the first problem to a design cost: CLIP’s embedding keeps the gist and may lose which colour belongs to which thing, and the decoder only sees the gist.

April to July: a research preview, then a beta

For the first months DALL-E 2 was a research preview with an invitation system and strict rules, including a content policy that barred violence, adult content and political imagery. OpenAI had filtered training data to remove explicit material and blocked prompts and outputs in sensitive categories. It also limited what could be done with realistic faces, a restriction that loosened later.

On 20 July 2022 OpenAI announced that DALL-E was available in beta and that it would invite one million people from its waitlist over the following weeks. Users received 50 free credits in their first month and 15 free credits each month after that, with each credit buying one prompt (returning four images) or one edit or variation (returning three). Extra credits could be bought in batches. OpenAI also said that users would have full rights to commercially use the images they made, including reprinting, selling and merchandising, a notable change from the initial preview. The waitlist ended altogether at the end of September 2022.

DateEvent
5 Jan 2021DALL-E and CLIP announced; no public access
24 Feb 2021DALL-E paper on arXiv
Apr 2022DALL-E 2 announced; paper on 13 April
20 Jul 2022Beta begins, one million waitlist invitations

For a hands-on look at what prompting the system was like, see the site’s older piece on using DALL-E 2 for images.

The summer it stopped being a lab project

The timing is why DALL-E 2 matters historically. Within a few weeks of one another in mid-2022, three different things happened. DALL-E 2 went to a million people. Midjourney opened its beta to the public through Discord. And in August Stability AI released Stable Diffusion with open weights, built on latent diffusion, which ran on a consumer graphics card.

DALL-E 2 itself lost the lead quickly. It was a closed hosted service in a field where an open model could be fine-tuned, extended and run locally, and where Midjourney won on aesthetics. The open community produced custom styles, add-ons and workflows that OpenAI’s service could not match, a story told in the open-weights movement post. OpenAI’s response, DALL-E 3, arrived in late 2023 and was integrated into ChatGPT, using a language model to expand and clarify prompts, which addressed much of the prompt-following weakness. That chapter falls outside this post.

The case against the headlines

A few cautions apply to the DALL-E story as it is usually told.

First, the leap from DALL-E 1 to DALL-E 2 owed much to a different approach, diffusion, and little to the first model’s design. The “transformer for images” route was not abandoned entirely, since later systems revisited it, but the high-profile image generators of 2022 were diffusion models. A reader who takes DALL-E 1 as the ancestor of DALL-E 2 will misjudge the lineage; the real ancestors of the second are CLIP and GLIDE.

Second, the showcase images are selections. Anyone who has watched people use these tools knows the ratio of keepers to rejects, and OpenAI’s own first model relied on automatic reranking of many candidates.

Third, the training data was scraped from the internet and not disclosed in detail. The question of whose pictures taught these models to draw, and whether the artists whose styles they imitate consented, became a major dispute within months and remains in the courts and the policy debates. That argument is not resolved by the quality of the pictures.

What to take from it

The takeaway is about interfaces more than architecture. DALL-E 1 showed that a sentence could specify an image. DALL-E 2 made the output good enough to use, wrapped it in a product with edit tools and a licence, and handed it to a million people, which gave the technique a public. Everything that followed, including the open models you can run at home, built on the demand that those eighteen months created.

This post is written from the published papers and OpenAI’s announcements. For the models I have run, see the posts on Stable Diffusion at home and the SDXL and fine-tune ecosystem.

Sources: Ramesh et al., Zero-Shot Text-to-Image Generation (arXiv 2102.12092) · Ramesh et al., Hierarchical Text-Conditional Image Generation with CLIP Latents (arXiv 2204.06125) · OpenAI, DALL-E: Creating images from text (Jan 2021) · OpenAI, DALL-E now available in beta (Jul 2022) · NPR, DALL-E beta coverage (20 Jul 2022)

Smarc
Written by Smarc

Founder and editor of Aside House. A lifelong tinkerer who self-hosts far more than is sensible, hardens Linux boxes for fun, and prods the latest AI tools to see what they can really do. The how-to guides here are the notes Smarc wishes had existed the first time round.

Smarc is the editor of Aside House. The homelab, the hardware and the opinions are real; the guides are drafted with AI assistance. Infrastructure details are genericised on purpose.