liveBook · Manning

Text-to-image model

As explained in Deep Learning with R, Third Edition

A text-to-image model is a generative model that produces images corresponding to textual descriptions.

A text-to-image model generates an image matching a written description. Diffusion models begin with pure noise and repeatedly denoise it while using a text representation to guide the result. section 17.1.1 section 17.4

Figure 17.2 Language-guided image generation
figure

Follow the mapping from natural-language prompts into a visual latent space, then back into generated images. section 17.1.1

A typical system combines a pretrained text encoder with a diffusion model trained on prompt–image pairs. The denoiser receives both noisy images and text embeddings, allowing an unseen prompt to guide generation from pure noise. section 17.3

Generating an image with Stable Diffusion

In R with KerasHub, create a TextToImage task from the stable_diffusion_3_medium preset and generate an image from “A NASA astronaut riding an origami elephant in New York City.” Negative prompts can steer away from features such as blue color, while num_steps controls the diffusion process. section 17.3 section 17.3

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains latent spaces, text conditioning, denoising inputs, and pretrained use, but does not train a capable model from scratch.
Examples
Demonstrates generated flowers, an astronaut riding an origami elephant, negative prompts, and varying diffusion-step counts.
What it assumes
Assumes basic familiarity with diffusion denoising and text encoders while introducing prompt conditioning through a high-level generation task.
What you can do after
Operate/configure a pretrained Stable Diffusion model to generate and steer images with prompts, negative prompts, and diffusion steps.
How it connects
Connects diffusion models with text encoders, text embeddings, latent spaces, VAEs, GANs, and Stable Diffusion.

Also explained in

Compare how 6 books explain text-to-image model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.