Back to Diffusers

Pipelines

docs/source/en/api/pipelines/overview.md

0.37.16.3 KB
Original Source
<!--Copyright 2025 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. -->

Pipelines

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.

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.

[!WARNING] 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.

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 decorator because pipelines should not be used for training. If you're interested in training, please take a look at the Training guides instead!

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.

PipelineTasks
aMUSEdtext2image
AnimateDifftext2video
Attend-and-Excitetext2image
AudioLDMtext2audio
AudioLDM2text2audio
AuraFlowtext2image
BLIP Diffusiontext2image
Bria 3.2text2image
CogVideoXtext2video
Consistency Modelsunconditional image generation
ControlNettext2image, image2image, inpainting
ControlNet with Flux.1text2image
ControlNet with Hunyuan-DiTtext2image
ControlNet with Stable Diffusion 3text2image
ControlNet with Stable Diffusion XLtext2image
ControlNet-XStext2image
ControlNet-XS with Stable Diffusion XLtext2image
Dance Diffusionunconditional audio generation
DDIMunconditional image generation
DDPMunconditional image generation
DeepFloyd IFtext2image, image2image, inpainting, super-resolution
DiffEditinpainting
DiTtext2image
Fluxtext2image
Hunyuan-DiTtext2image
I2VGen-XLimage2video
InstructPix2Piximage editing
Kandinsky 2.1text2image, image2image, inpainting, interpolation
Kandinsky 2.2text2image, image2image, inpainting
Kandinsky 3text2image, image2image
Kolorstext2image
Latent Consistency Modelstext2image
Latent Diffusiontext2image, super-resolution
Lattetext2image
LEDITS++image editing
Lumina-T2Xtext2image
Marigolddepth-estimation, normals-estimation, intrinsic-decomposition
MultiDiffusiontext2image
MusicLDMtext2audio
PAGtext2image
Paint by Exampleinpainting
PIAimage2video
PixArt-αtext2image
PixArt-Σtext2image
Self-Attention Guidancetext2image
Semantic Guidancetext2image
Shap-Etext-to-3D, image-to-3D
Stable Audiotext2audio
Stable Cascadetext2image
Stable Diffusiontext2image, image2image, depth2image, inpainting, image variation, latent upscaler, super-resolution
Stable Diffusion XLtext2image, image2image, inpainting
Stable Diffusion XL Turbotext2image, image2image, inpainting
Stable unCLIPtext2image, image variation
T2I-Adaptertext2image
Text2Videotext2video, video2video
Text2Video-Zerotext2video
unCLIPtext2image, image variation
UniDiffusertext2image, image2text, image variation, text variation, unconditional image generation, unconditional audio generation
Value-guided planningvalue guided sampling
Wuerstchentext2image
VisualClozetext2image, 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

DiffusionPipeline

[[autodoc]] DiffusionPipeline - all - call - device - to - components

[[autodoc]] pipelines.StableDiffusionMixin.enable_freeu

[[autodoc]] pipelines.StableDiffusionMixin.disable_freeu

PushToHubMixin

[[autodoc]] utils.PushToHubMixin

Callbacks

[[autodoc]] callbacks.PipelineCallback

[[autodoc]] callbacks.SDCFGCutoffCallback

[[autodoc]] callbacks.SDXLCFGCutoffCallback

[[autodoc]] callbacks.SDXLControlnetCFGCutoffCallback

[[autodoc]] callbacks.IPAdapterScaleCutoffCallback

[[autodoc]] callbacks.SD3CFGCutoffCallback