Diffusers
Hugging Face’s Python library for diffusion models.
- Stars
- 34.7K
- Forks
- 7.4K
- Open issues
- 1.5K
- Last commit
- 2026-10-14
Live from the GitHub API · updated 2026-10-15
What is Diffusers?
Diffusers is the reference library for running and training diffusion models in Python. Pipelines for Stable Diffusion, FLUX, SD3, video models and audio models load with a single call, with interchangeable schedulers, LoRA loading and memory optimizations such as CPU offload and quantization.
Key features
- Ready-made pipelines for most open image and video models
- Swappable schedulers and LoRA adapters
- Memory optimizations (offloading, quantization, attention slicing)
- Training scripts for DreamBooth, LoRA and ControlNet
System requirements
- Platforms
- Windows · macOS · Linux
- GPU
- NVIDIA recommended; MPS and CPU supported
- Python
- 3.9+
How to install Diffusers
Summarized from the project’s README. Projects change quickly — check the GitHub page for the latest instructions.
pip
- 1Install the library with PyTorch.
pip install --upgrade diffusers transformers accelerate torch - 2Generate an image in Python.
from diffusers import DiffusionPipeline import torch pipe = DiffusionPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16 ).to("cuda") image = pipe("an astronaut riding a horse on mars").images[0] image.save("astronaut.png")
Strengths
- Cleanest API for developers
- Supports nearly every open model
Limitations
- Code-only — no UI
- Requires Python knowledge
Diffusers alternatives compared
| Software | Stars | License | Platforms | VRAM |
|---|---|---|---|---|
| Diffusers Hugging Face’s Python library for diffusion models. | 34.7K | Apache-2.0 | — | |
| ComfyUI Node-based interface for diffusion models — images, video and audio. | 137.6K | GPL-3.0 | 4 GB minimum for SD1.5; 12 GB+ recommended for FLUX and video models | |
| FLUX (reference code) Official inference code for Black Forest Labs’ FLUX models. | 26K | Apache-2.0 | 16–24 GB for full precision; less with quantized variants elsewhere | |
| Stability AI Generative Models Stability AI’s reference code for SDXL and Stable Video Diffusion. | 27.3K | MIT | 16 GB+ (more for video) | |
| Stable Diffusion WebUI (AUTOMATIC1111) The classic browser UI for Stable Diffusion with a massive extension ecosystem. | 165.1K | AGPL-3.0 | 4 GB minimum (with --medvram/--lowvram), 8 GB+ recommended | |
| Stable Diffusion WebUI Forge A faster, leaner fork of the A1111 WebUI with FLUX support. | 13.1K | AGPL-3.0 | 6 GB+ (FLUX NF4/GGUF variants run on 6–8 GB) |
Related models
FAQ
Is Diffusers free?
Yes — Diffusers is open-source software released under the Apache-2.0 license. Check the license (and any model weight licenses) before commercial use.
Does Diffusers run on Windows, Mac and Linux?
Diffusers supports: Windows, macOS, Linux.
What hardware do I need for Diffusers?
NVIDIA recommended; MPS and CPU supported
How do I install Diffusers?
1. Install the library with PyTorch. 2. Generate an image in Python.
What are the best Diffusers alternatives?
Popular alternatives include ComfyUI, FLUX (reference code), Stability AI Generative Models, Stable Diffusion WebUI (AUTOMATIC1111). See the comparison table on this page.
Can I use Diffusers online without installing it?
If you just want results, AiLoft runs top image models such as GPT Image 2.5 and Nano Banana Pro in the browser — no GPU or setup required.
Skip the install — generate images in your browser
No GPU, drivers or Python needed. Use GPT Image 2.5 and Nano Banana Pro online and compare them side by side.