Favicon of Stable Diffusion XL

Stable Diffusion XL

An image generation model you can run locally, with text-to-image and image-to-image support, MIT-licensed Python code and separately licensed weights.

Screenshot of Stable Diffusion XL website

Stable Diffusion XL is an image generation model for creators and developers who want to generate images on their own hardware or servers. It supports text-to-image generation and image-to-image sampling, so you can start with a written prompt or an existing image.

The model family includes SDXL-base and SDXL-refiner. Stability AI's Python code provides a Streamlit demo for both generation modes, alongside training examples for developers who want to build or adapt diffusion models. The code uses PyTorch, with modular components that let developers change parts of the model and training setup.

Licensing has two separate parts. The repository's code is open source under the MIT License, while the SDXL weights use the CreativeML Open RAIL++-M license. The code license doesn't replace the terms attached to the model weights.

Self-hosting lets you run the models in your own environment and control your data. Stability AI also offers hosted applications and media generation APIs, which run as managed services rather than on your machine.

Images generated through the supplied code contain an invisible watermark. The repository includes a detection script for that watermark.

Similar to Stable Diffusion XL