A transformer-based text-to-image model generates images by treating visual patches as a sequence and predicting them from text tokens. Unlike diffusion models, it generates patches sequentially from the top-left toward the bottom-right. section 1.7 section 1.2
The generation pipeline connects text and image representations through three main stages:
- Encode each training image with VQGAN as a sequence of discrete image tokens. section 1.2.2
- Process captions with the BART encoder and decoder to produce text tokens. section 1.2.2
- Train the BART decoder to predict text tokens matching the image tokens, then pass predicted tokens through the VQGAN decoder. section 1.2.2
Sequentially generating a prompted image
For “panda with a top hat reading a book,” the transformer predicts the first image patch from the prompt, then predicts each subsequent patch using the prompt and previously generated patches until all 256 patches are complete. section 1.2
Figure 1.3 How the min-DALL-E model generates an image based on the prompt “panda with a top hat reading a book.” The top-left subplot shows the output when 32 image patches are generated. The second subplot in the top row shows the output when 64 patches are generated. The remaining images show the outputs for 96, 128, . . ., and 256 patches.
Trace the panda image as its patch sequence grows through 32, 64, 96, 128, and up to 256 generated patches. section 1.2
Figure 1.5 How DALL-E mini is trained to generate an image based on a text prompt
Inspect the paired training and inference paths linking captions, BART, image tokens, and VQGAN reconstruction. section 1.2.2
