opensi·si

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,…

Overview

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!

Use API > Pipelines in the sidebar to browse all pipeline references by modality. For task-oriented workflows, start with the Quickstart or a guide such as text-to-image, image-to-image, inpainting, or video generation.

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

Source and license

Source: Diffusers documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.