diffusion_pipeline.mdx 1.77 KB
Newer Older
Patrick von Platen's avatar
Patrick von Platen committed
1
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Nathan Lambert's avatar
Nathan Lambert committed
2
3
4
5
6
7
8
9
10
11
12

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.
-->

13
# Pipelines
Nathan Lambert's avatar
Nathan Lambert committed
14

15
The [`DiffusionPipeline`] is the easiest way to load any pretrained diffusion pipeline from the [Hub](https://huggingface.co/models?library=diffusers) and to use it in inference.
Nathan Lambert's avatar
Nathan Lambert committed
16

17
18
19
20
21
<Tip>
	
	One should not use the Diffusion Pipeline class for training or fine-tuning a diffusion model. Individual 
	components of diffusion pipelines are usually trained individually, so we suggest to directly work 
	with [`UNetModel`] and [`UNetConditionModel`].
Nathan Lambert's avatar
Nathan Lambert committed
22

23
</Tip>
Nathan Lambert's avatar
Nathan Lambert committed
24

25
26
27
Any diffusion pipeline that is loaded with [`~DiffusionPipeline.from_pretrained`] will automatically 
detect the pipeline type, *e.g.* [`StableDiffusionPipeline`] and consequently load each component of the 
pipeline and pass them into the `__init__` function of the pipeline, *e.g.* [`~StableDiffusionPipeline.__init__`].
Nathan Lambert's avatar
Nathan Lambert committed
28

29
30
Any pipeline object can be saved locally with [`~DiffusionPipeline.save_pretrained`].

31
## DiffusionPipeline
32
[[autodoc]] DiffusionPipeline
33
34
	- all
	- __call__
35
	- device
36
	- to
37
	- components
38
39
40
41

## ImagePipelineOutput
By default diffusion pipelines return an object of class

42
[[autodoc]] pipelines.ImagePipelineOutput
43
44
45
46
47

## AudioPipelineOutput
By default diffusion pipelines return an object of class

[[autodoc]] pipelines.AudioPipelineOutput