diffusion_pipeline.md 1.48 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

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

17
<Tip>
Steven Liu's avatar
Steven Liu committed
18

Steven Liu's avatar
Steven Liu committed
19
You shouldn't use the [`DiffusionPipeline`] class for training or finetuning a diffusion model. Individual 
Steven Liu's avatar
Steven Liu committed
20
components (for example, [`UNet2DModel`] and [`UNet2DConditionModel`]) of diffusion pipelines are usually trained individually, so we suggest directly working with them instead.
Nathan Lambert's avatar
Nathan Lambert committed
21

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

Steven Liu's avatar
Steven Liu committed
24
25
The pipeline type (for example [`StableDiffusionPipeline`]) of any diffusion pipeline loaded with [`~DiffusionPipeline.from_pretrained`] is automatically 
detected and pipeline components are loaded and passed to the `__init__` function of the pipeline.
Nathan Lambert's avatar
Nathan Lambert committed
26

27
28
Any pipeline object can be saved locally with [`~DiffusionPipeline.save_pretrained`].

29
## DiffusionPipeline
Steven Liu's avatar
Steven Liu committed
30

31
[[autodoc]] DiffusionPipeline
32
33
	- all
	- __call__
34
	- device
35
	- to
36
	- components