Loading…
Glossary term
A model that generates images from written descriptions.
A text-to-image model turns a written description into a picture. Most use diffusion: they start from random noise and refine it step by step, guided by an encoding of the prompt.
Results depend on prompt wording, and models can struggle with text, hands or exact counts.
Generate an image with diffusers
from diffusers import AutoPipelineForText2Image
pipe = AutoPipelineForText2Image.from_pretrained("<model-id>")
image = pipe("a lighthouse at sunrise, watercolor").images[0]
image.save("lighthouse.png")It made image creation accessible to everyone, while raising questions about artists' work and fake images.