diffusers 0.35.2


pip install diffusers

  Latest version

Released: Oct 15, 2025

Project Links

Meta
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/diffusers/graphs/contributors)
Requires Python: >=3.8.0

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers
  • Education
  • Science/Research

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Topic
  • Scientific/Engineering :: Artificial Intelligence

Programming Language
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10



GitHub GitHub release GitHub release Contributor Covenant X account

๐Ÿค— Diffusers is the go-to library for state-of-the-art pretrained diffusion models for generating images, audio, and even 3D structures of molecules. Whether you're looking for a simple inference solution or training your own diffusion models, ๐Ÿค— Diffusers is a modular toolbox that supports both. Our library is designed with a focus on usability over performance, simple over easy, and customizability over abstractions.

๐Ÿค— Diffusers offers three core components:

  • State-of-the-art diffusion pipelines that can be run in inference with just a few lines of code.
  • Interchangeable noise schedulers for different diffusion speeds and output quality.
  • Pretrained models that can be used as building blocks, and combined with schedulers, for creating your own end-to-end diffusion systems.

Installation

We recommend installing ๐Ÿค— Diffusers in a virtual environment from PyPI or Conda. For more details about installing PyTorch and Flax, please refer to their official documentation.

PyTorch

With pip (official package):

pip install --upgrade diffusers[torch]

With conda (maintained by the community):

conda install -c conda-forge diffusers

Flax

With pip (official package):

pip install --upgrade diffusers[flax]

Apple Silicon (M1/M2) support

Please refer to the How to use Stable Diffusion in Apple Silicon guide.

Quickstart

Generating outputs is super easy with ๐Ÿค— Diffusers. To generate an image from text, use the from_pretrained method to load any pretrained diffusion model (browse the Hub for 30,000+ checkpoints):

from diffusers import DiffusionPipeline
import torch

pipeline = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16)
pipeline.to("cuda")
pipeline("An image of a squirrel in Picasso style").images[0]

You can also dig into the models and schedulers toolbox to build your own diffusion system:

from diffusers import DDPMScheduler, UNet2DModel
from PIL import Image
import torch

scheduler = DDPMScheduler.from_pretrained("google/ddpm-cat-256")
model = UNet2DModel.from_pretrained("google/ddpm-cat-256").to("cuda")
scheduler.set_timesteps(50)

sample_size = model.config.sample_size
noise = torch.randn((1, 3, sample_size, sample_size), device="cuda")
input = noise

for t in scheduler.timesteps:
    with torch.no_grad():
        noisy_residual = model(input, t).sample
        prev_noisy_sample = scheduler.step(noisy_residual, t, input).prev_sample
        input = prev_noisy_sample

image = (input / 2 + 0.5).clamp(0, 1)
image = image.cpu().permute(0, 2, 3, 1).numpy()[0]
image = Image.fromarray((image * 255).round().astype("uint8"))
image

Check out the Quickstart to launch your diffusion journey today!

How to navigate the documentation

Documentation What can I learn?
Tutorial A basic crash course for learning how to use the library's most important features like using models and schedulers to build your own diffusion system, and training your own diffusion model.
Loading Guides for how to load and configure all the components (pipelines, models, and schedulers) of the library, as well as how to use different schedulers.
Pipelines for inference Guides for how to use pipelines for different inference tasks, batched generation, controlling generated outputs and randomness, and how to contribute a pipeline to the library.
Optimization Guides for how to optimize your diffusion model to run faster and consume less memory.
Training Guides for how to train a diffusion model for different tasks with different training techniques.

Contribution

We โค๏ธ contributions from the open-source community! If you want to contribute to this library, please check out our Contribution guide. You can look out for issues you'd like to tackle to contribute to the library.

Also, say ๐Ÿ‘‹ in our public Discord channel Join us on Discord. We discuss the hottest trends about diffusion models, help each other with contributions, personal projects or just hang out โ˜•.

Popular Tasks & Pipelines

Task Pipeline ๐Ÿค— Hub
Unconditional Image Generation DDPM google/ddpm-ema-church-256
Text-to-Image Stable Diffusion Text-to-Image stable-diffusion-v1-5/stable-diffusion-v1-5
Text-to-Image unCLIP kakaobrain/karlo-v1-alpha
Text-to-Image DeepFloyd IF DeepFloyd/IF-I-XL-v1.0
Text-to-Image Kandinsky kandinsky-community/kandinsky-2-2-decoder
Text-guided Image-to-Image ControlNet lllyasviel/sd-controlnet-canny
Text-guided Image-to-Image InstructPix2Pix timbrooks/instruct-pix2pix
Text-guided Image-to-Image Stable Diffusion Image-to-Image stable-diffusion-v1-5/stable-diffusion-v1-5
Text-guided Image Inpainting Stable Diffusion Inpainting runwayml/stable-diffusion-inpainting
Image Variation Stable Diffusion Image Variation lambdalabs/sd-image-variations-diffusers
Super Resolution Stable Diffusion Upscale stabilityai/stable-diffusion-x4-upscaler
Super Resolution Stable Diffusion Latent Upscale stabilityai/sd-x2-latent-upscaler

Popular libraries using ๐Ÿงจ Diffusers

Thank you for using us โค๏ธ.

Credits

This library concretizes previous work by many different authors and would not have been possible without their great research and implementations. We'd like to thank, in particular, the following implementations which have helped us in our development and without which the API could not have been as polished today:

  • @CompVis' latent diffusion models library, available here
  • @hojonathanho original DDPM implementation, available here as well as the extremely useful translation into PyTorch by @pesser, available here
  • @ermongroup's DDIM implementation, available here
  • @yang-song's Score-VE and Score-VP implementations, available here

We also want to thank @heejkoo for the very helpful overview of papers, code and resources on diffusion models, available here as well as @crowsonkb and @rromb for useful discussions and insights.

Citation

@misc{von-platen-etal-2022-diffusers,
  author = {Patrick von Platen and Suraj Patil and Anton Lozhkov and Pedro Cuenca and Nathan Lambert and Kashif Rasul and Mishig Davaadorj and Dhruv Nair and Sayak Paul and William Berman and Yiyi Xu and Steven Liu and Thomas Wolf},
  title = {Diffusers: State-of-the-art diffusion models},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/huggingface/diffusers}}
}
0.35.2 Oct 15, 2025
0.35.1 Aug 20, 2025
0.35.0 Aug 19, 2025
0.34.0 Jun 24, 2025
0.33.1 Apr 10, 2025
0.33.0 Apr 09, 2025
0.32.2 Jan 15, 2025
0.32.1 Dec 25, 2024
0.32.0 Dec 23, 2024
0.31.0 Oct 22, 2024
0.30.3 Sep 17, 2024
0.30.2 Aug 31, 2024
0.30.1 Aug 24, 2024
0.30.0 Aug 07, 2024
0.29.2 Jun 27, 2024
0.29.1 Jun 20, 2024
0.29.0 Jun 12, 2024
0.28.2 Jun 04, 2024
0.28.1 Jun 04, 2024
0.28.0 May 27, 2024
0.27.2 Mar 20, 2024
0.27.1 Mar 19, 2024
0.27.0 Mar 14, 2024
0.26.3 Feb 13, 2024
0.26.2 Feb 06, 2024
0.26.1 Feb 02, 2024
0.26.0 Jan 31, 2024
0.25.1 Jan 17, 2024
0.25.0 Dec 27, 2023
0.24.0 Nov 29, 2023
0.23.1 Nov 16, 2023
0.23.0 Nov 09, 2023
0.22.3 Nov 08, 2023
0.22.2 Nov 07, 2023
0.22.1 Nov 06, 2023
0.22.0 Nov 06, 2023
0.21.4 Sep 29, 2023
0.21.3 Sep 27, 2023
0.21.2 Sep 18, 2023
0.21.1 Sep 14, 2023
0.21.0 Sep 13, 2023
0.20.2 Aug 31, 2023
0.20.1 Aug 28, 2023
0.20.0 Aug 17, 2023
0.19.3 Jul 30, 2023
0.19.2 Jul 28, 2023
0.19.1 Jul 27, 2023
0.19.0 Jul 26, 2023
0.18.2 Jul 11, 2023
0.18.1 Jul 07, 2023
0.18.0 Jul 06, 2023
0.17.1 Jun 12, 2023
0.17.0 Jun 08, 2023
0.16.1 Apr 28, 2023
0.16.0 Apr 26, 2023
0.15.1 Apr 17, 2023
0.15.0 Apr 12, 2023
0.14.0 Mar 03, 2023
0.13.1 Feb 20, 2023
0.13.0 Feb 17, 2023
0.12.1 Jan 27, 2023
0.12.0 Jan 25, 2023
0.11.1 Dec 20, 2022
0.11.0 Dec 19, 2022
0.10.2 Dec 09, 2022
0.10.1 Dec 09, 2022
0.10.0 Dec 08, 2022
0.9.0 Nov 25, 2022
0.8.1 Nov 24, 2022
0.8.0 Nov 23, 2022
0.7.2 Nov 05, 2022
0.7.1 Nov 04, 2022
0.7.0 Nov 03, 2022
0.6.0 Oct 19, 2022
0.5.1 Oct 13, 2022
0.5.0 Oct 13, 2022
0.4.2 Oct 11, 2022
0.4.1 Oct 07, 2022
0.4.0 Oct 06, 2022
0.3.0 Sep 08, 2022
0.2.4 Aug 22, 2022
0.2.3 Aug 22, 2022
0.2.2 Aug 16, 2022
0.2.1 Aug 16, 2022
0.2.0 Aug 16, 2022
0.1.3 Jul 28, 2022
0.1.2 Jul 21, 2022
0.1.1 Jul 21, 2022
0.1.0 Jul 21, 2022
0.0.4 Jun 15, 2022
0.0.3 Jun 15, 2022
0.0.2 Jun 07, 2022
0.0.1 May 30, 2022

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
importlib_metadata
filelock
huggingface-hub (>=0.34.0)
numpy
regex (!=2019.12.17)
requests
safetensors (>=0.3.1)
Pillow