April 2026
Intermediate
395 pages
13h 22m
English
You can select from a wide range of text-to-image models, but keep in mind that these are quite resource intensive. If you don’t own a good GPU, we recommend using a rather small text-to-image model. For that reason, we recommend using amused/amused-256, available at https://huggingface.co/amused/amused-256.
The following code creates an image of 256 × 256 pixels. Running on a CPU, the creation process took half an hour. The model creates an image of a dog and stores that image in the current working folder. Listing 2.8 shows the code required to use this text-to-image model. Figure 2.6 shows the result.
import torchfrom diffusers import AmusedPipeline#%%pipe = AmusedPipeline.from_pretrained( "amused/amused-256", ...
Read now
Unlock full access