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
- Draw Things
- DiffusionBee
git error with sd_xl
When running this line from the model card:
!pip install git+https://github.com/huggingface/diffusers.git@sd_xl
I get this error
Cloning https://github.com/huggingface/diffusers.git (to revision sd_xl) to /tmp/pip-req-build-c05e4jxj
Running command git clone --filter=blob:none --quiet https://github.com/huggingface/diffusers.git /tmp/pip-req-build-c05e4jxj
WARNING: Did not find branch or tag 'sd_xl', assuming revision or ref.
Running command git checkout -q sd_xl
error: pathspec 'sd_xl' did not match any file(s) known to git
error: subprocess-exited-with-error
× git checkout -q sd_xl did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× git checkout -q sd_xl did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
pip install -U git+https://github.com/huggingface/diffusers@main
that fixed it, running now, thanks!