Instructions to use stabilityai/stable-diffusion-xl-base-0.9 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use stabilityai/stable-diffusion-xl-base-0.9 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-0.9", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Discrepancy between number of transformer layers in config and paper
I noticed that the config.json for the SDXL UNET contains the following: https://huggingface.co/stabilityai/stable-diffusion-xl-base-0.9/blob/main/unet/config.json#L59, which indicates there is 1 transformer block at the highest resolution mapping.
However, when reading the SDXL paper, they make a bit point to mention that the actual transformer blocks are [0, 2, 10], and they have omitted any blocks at the highest level.
Am I missing something? If not, which one is correct?
Since there is no Transformer layer in DownBlock2D, the first term is ignored.
https://huggingface.co/stabilityai/stable-diffusion-xl-base-0.9/blob/025709258a55cc924dc47efd88959f18ae79830e/unet/config.json#L27