<Tip>  
Read the [How does Stable Diffusion work?](https://huggingface.co/blog/stable_diffusion#how-does-stable-diffusion-work) blog post to learn more about how a latent diffusion model works.  
</Tip>  
You can generate images from a prompt in 🤗 Diffusers in two steps:  
1. Load a checkpoint into the [`AutoPipelineForText2Image`] class, which automatically detects the appropriate pipeline class to use based on the checkpoint:  
```py
from diffusers import AutoPipelineForText2Image
import torch