2022-07-13 09:42:05 -06:00
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
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.
-->
2022-09-08 08:46:38 -06:00
# Pipelines
2022-07-13 09:42:05 -06:00
2022-09-08 05:50:06 -06:00
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.
2022-07-13 09:42:05 -06:00
2022-09-08 05:50:06 -06:00
<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`].
2022-07-13 09:42:05 -06:00
2022-09-08 05:50:06 -06:00
</Tip>
2022-07-13 09:42:05 -06:00
2022-09-08 05:50:06 -06:00
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__`].
2022-07-13 09:42:05 -06:00
2022-09-08 05:50:06 -06:00
Any pipeline object can be saved locally with [`~DiffusionPipeline.save_pretrained`].
2022-09-08 08:46:38 -06:00
## DiffusionPipeline
2022-09-08 05:50:06 -06:00
[[autodoc]] DiffusionPipeline
- from_pretrained
- save_pretrained
2022-10-20 05:28:11 -06:00
- to
- device
- components
2022-09-08 08:46:38 -06:00
## ImagePipelineOutput
By default diffusion pipelines return an object of class
[[autodoc]] pipeline_utils.ImagePipelineOutput