Diffusers documentation

Diffusers

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.43.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started



Diffusers

Diffusers 提供预训练的扩散模型以及构建自定义图像、视频和音频工作流的基础组件。

它包含两条主要路径。

  • DiffusionPipeline 支持使用预训练检查点进行几行代码的推理,并支持 LoRA 等适配器。这是生成任务中最简便的路径。
  • Modular Diffusers 支持可组合的模块以及用于自定义流水线的 ModularPipeline,以便在需要更精细控制时使用。

诸如 offloading 和量化等优化技术,使大型模型能够在内存受限的设备上运行。如果内存不是问题,Diffusers 还支持 torch.compile 以实现更快的推理。

立即在 Hub 上浏览热门的 Diffusers 模型。

学习

如果您是初学者,请从 Hugging Face Diffusion Models Course 开始。该课程涵盖了扩散理论,以及如何使用 Diffusers 生成图像、微调模型等内容。

快速入门还包含一个可复制的用于推理的代理设置提示词。

接下来

Update on GitHub