overview.md 6.44 KB
Newer Older
Aryan's avatar
Aryan committed
1
<!--Copyright 2025 The HuggingFace Team. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13
14

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Pipelines

Steven Liu's avatar
Steven Liu committed
15
Pipelines provide a simple way to run state-of-the-art diffusion models in inference by bundling all of the necessary components (multiple independently-trained models, schedulers, and processors) into a single end-to-end class. Pipelines are flexible and they can be adapted to use different schedulers or even model components.
16

Steven Liu's avatar
Steven Liu committed
17
All pipelines are built from the base [`DiffusionPipeline`] class which provides basic functionality for loading, downloading, and saving all the components. Specific pipeline types (for example [`StableDiffusionPipeline`]) loaded with [`~DiffusionPipeline.from_pretrained`] are automatically detected and the pipeline components are loaded and passed to the `__init__` function of the pipeline.
18

19
<Tip warning={true}>
20

Steven Liu's avatar
Steven Liu committed
21
22
23
24
25
You shouldn't use the [`DiffusionPipeline`] class for training. Individual components (for example, [`UNet2DModel`] and [`UNet2DConditionModel`]) of diffusion pipelines are usually trained individually, so we suggest directly working with them instead.

<br>

Pipelines do not offer any training functionality. You'll notice PyTorch's autograd is disabled by decorating the [`~DiffusionPipeline.__call__`] method with a [`torch.no_grad`](https://pytorch.org/docs/stable/generated/torch.no_grad.html) decorator because pipelines should not be used for training. If you're interested in training, please take a look at the [Training](../../training/overview) guides instead!
26

27
</Tip>
28

Steven Liu's avatar
Steven Liu committed
29
30
31
32
The table below lists all the pipelines currently available in 🤗 Diffusers and the tasks they support. Click on a pipeline to view its abstract and published paper.

| Pipeline | Tasks |
|---|---|
33
| [aMUSEd](amused) | text2image |
34
| [AnimateDiff](animatediff) | text2video |
Steven Liu's avatar
Steven Liu committed
35
36
37
| [Attend-and-Excite](attend_and_excite) | text2image |
| [AudioLDM](audioldm) | text2audio |
| [AudioLDM2](audioldm2) | text2audio |
38
| [AuraFlow](auraflow) | text2image |
Steven Liu's avatar
Steven Liu committed
39
| [BLIP Diffusion](blip_diffusion) | text2image |
galbria's avatar
galbria committed
40
| [Bria 3.2](bria_3_2) | text2image |
41
| [CogVideoX](cogvideox) | text2video |
Steven Liu's avatar
Steven Liu committed
42
43
| [Consistency Models](consistency_models) | unconditional image generation |
| [ControlNet](controlnet) | text2image, image2image, inpainting |
44
45
46
| [ControlNet with Flux.1](controlnet_flux) | text2image |
| [ControlNet with Hunyuan-DiT](controlnet_hunyuandit) | text2image |
| [ControlNet with Stable Diffusion 3](controlnet_sd3) | text2image |
Steven Liu's avatar
Steven Liu committed
47
| [ControlNet with Stable Diffusion XL](controlnet_sdxl) | text2image |
UmerHA's avatar
UmerHA committed
48
49
| [ControlNet-XS](controlnetxs) | text2image |
| [ControlNet-XS with Stable Diffusion XL](controlnetxs_sdxl) | text2image |
Steven Liu's avatar
Steven Liu committed
50
51
52
53
54
55
| [Dance Diffusion](dance_diffusion) | unconditional audio generation |
| [DDIM](ddim) | unconditional image generation |
| [DDPM](ddpm) | unconditional image generation |
| [DeepFloyd IF](deepfloyd_if) | text2image, image2image, inpainting, super-resolution |
| [DiffEdit](diffedit) | inpainting |
| [DiT](dit) | text2image |
56
57
| [Flux](flux) | text2image |
| [Hunyuan-DiT](hunyuandit) | text2image |
SahilCarterr's avatar
SahilCarterr committed
58
| [I2VGen-XL](i2vgenxl) | image2video |
Steven Liu's avatar
Steven Liu committed
59
| [InstructPix2Pix](pix2pix) | image editing |
60
| [Kandinsky 2.1](kandinsky) | text2image, image2image, inpainting, interpolation |
Steven Liu's avatar
Steven Liu committed
61
| [Kandinsky 2.2](kandinsky_v22) | text2image, image2image, inpainting |
62
| [Kandinsky 3](kandinsky3) | text2image, image2image |
63
| [Kolors](kolors) | text2image |
64
| [Latent Consistency Models](latent_consistency_models) | text2image |
Steven Liu's avatar
Steven Liu committed
65
| [Latent Diffusion](latent_diffusion) | text2image, super-resolution |
66
| [Latte](latte) | text2image |
67
| [LEDITS++](ledits_pp) | image editing |
68
| [Lumina-T2X](lumina) | text2image |
69
| [Marigold](marigold) | depth-estimation, normals-estimation, intrinsic-decomposition |
Steven Liu's avatar
Steven Liu committed
70
71
| [MultiDiffusion](panorama) | text2image |
| [MusicLDM](musicldm) | text2audio |
72
| [PAG](pag) | text2image |
73
| [Paint by Example](paint_by_example) | inpainting |
74
| [PIA](pia) | image2video |
75
| [PixArt-α](pixart) | text2image |
76
| [PixArt-Σ](pixart_sigma) | text2image |
Steven Liu's avatar
Steven Liu committed
77
78
79
| [Self-Attention Guidance](self_attention_guidance) | text2image |
| [Semantic Guidance](semantic_stable_diffusion) | text2image |
| [Shap-E](shap_e) | text-to-3D, image-to-3D |
80
| [Stable Audio](stable_audio) | text2audio |
81
| [Stable Cascade](stable_cascade) | text2image |
Steven Liu's avatar
Steven Liu committed
82
| [Stable Diffusion](stable_diffusion/overview) | text2image, image2image, depth2image, inpainting, image variation, latent upscaler, super-resolution |
83
| [Stable Diffusion XL](stable_diffusion/stable_diffusion_xl) | text2image, image2image, inpainting |
Steven Liu's avatar
Steven Liu committed
84
| [Stable Diffusion XL Turbo](stable_diffusion/sdxl_turbo) | text2image, image2image, inpainting |
Steven Liu's avatar
Steven Liu committed
85
| [Stable unCLIP](stable_unclip) | text2image, image variation |
86
| [T2I-Adapter](stable_diffusion/adapter) | text2image |
Steven Liu's avatar
Steven Liu committed
87
| [Text2Video](text_to_video) | text2video, video2video |
88
89
| [Text2Video-Zero](text_to_video_zero) | text2video |
| [unCLIP](unclip) | text2image, image variation |
Steven Liu's avatar
Steven Liu committed
90
91
92
| [UniDiffuser](unidiffuser) | text2image, image2text, image variation, text variation, unconditional image generation, unconditional audio generation |
| [Value-guided planning](value_guided_sampling) | value guided sampling |
| [Wuerstchen](wuerstchen) | text2image |
Zhong-Yu Li's avatar
Zhong-Yu Li committed
93
| [VisualCloze](visualcloze) | text2image, image2image, subject driven generation, inpainting, style transfer, image restoration, image editing, [depth,normal,edge,pose]2image, [depth,normal,edge,pose]-estimation, virtual try-on, image relighting |
Steven Liu's avatar
Steven Liu committed
94

95
## DiffusionPipeline
96

97
98
99
100
101
102
[[autodoc]] DiffusionPipeline
	- all
	- __call__
	- device
	- to
	- components
103

104
105
106
107
108

[[autodoc]] pipelines.StableDiffusionMixin.enable_freeu

[[autodoc]] pipelines.StableDiffusionMixin.disable_freeu

109
## FlaxDiffusionPipeline
110

111
[[autodoc]] pipelines.pipeline_flax_utils.FlaxDiffusionPipeline
112
113
114
115

## PushToHubMixin

[[autodoc]] utils.PushToHubMixin
116
117
118
119
120
121
122
123
124
125
126
127
128
129

## Callbacks

[[autodoc]] callbacks.PipelineCallback

[[autodoc]] callbacks.SDCFGCutoffCallback

[[autodoc]] callbacks.SDXLCFGCutoffCallback

[[autodoc]] callbacks.SDXLControlnetCFGCutoffCallback

[[autodoc]] callbacks.IPAdapterScaleCutoffCallback

[[autodoc]] callbacks.SD3CFGCutoffCallback