Diffusers documentation
Utilities
Get started
Tutorials
OverviewUnderstanding pipelines, models and schedulersAutoPipelineTrain a diffusion modelLoad LoRAs for inferenceAccelerate inference of text-to-image diffusion models
Using Diffusers
Loading & Hub
OverviewLoad pipelines, models, and schedulersLoad and compare different schedulersLoad community pipelines and componentsLoad safetensorsLoad different Stable Diffusion formatsLoad adaptersPush files to the Hub
Tasks
OverviewUnconditional image generationText-to-imageImage-to-imageInpaintingText or image-to-videoDepth-to-image
Techniques
Textual inversionIP-AdapterMerge LoRAsDistributed inference with multiple GPUsImprove image quality with deterministic generationControl image brightnessPrompt weightingImprove generation quality with FreeU
Specific pipeline examples
OverviewStable Diffusion XLSDXL TurboKandinskyControlNetShap-EDiffEditDistilled Stable Diffusion inferencePipeline callbacksCreate reproducible pipelinesCommunity pipelinesContribute a community pipelineLatent Consistency Model-LoRALatent Consistency ModelTrajectory Consistency Distillation-LoRAStable Video Diffusion
Training
OverviewCreate a dataset for trainingAdapt a model to a new task
Models
Unconditional image generationText-to-imageStable Diffusion XLKandinsky 2.2WuerstchenControlNetT2I-AdaptersInstructPix2Pix
Methods
Taking Diffusers Beyond Images
Optimization
Conceptual Guides
PhilosophyControlled generationHow to contribute?Diffusers' Ethical GuidelinesEvaluating Diffusion Models
API
Main Classes
Loaders
Models
OverviewUNet1DModelUNet2DModelUNet2DConditionModelUNet3DConditionModelUNetMotionModelUViT2DModelVQModelAutoencoderKLAsymmetricAutoencoderKLTiny AutoEncoderConsistencyDecoderVAETransformer2DTransformer TemporalPrior TransformerControlNet
Pipelines
OverviewaMUSEdAnimateDiffAttend-and-ExciteAudioLDMAudioLDM 2AutoPipelineBLIP-DiffusionConsistency ModelsControlNetControlNet with Stable Diffusion XLDance DiffusionDDIMDDPMDeepFloyd IFDiffEditDiTI2VGen-XLInstructPix2PixKandinsky 2.1Kandinsky 2.2Kandinsky 3Latent Consistency ModelsLatent DiffusionLEDITS++MultiDiffusionMusicLDMPaint by ExamplePersonalized Image Animator (PIA)PixArt-αSelf-Attention GuidanceSemantic GuidanceShap-EStable Cascade
Stable Diffusion
OverviewText-to-imageImage-to-imageImage-to-videoInpaintingDepth-to-imageImage variationSafe Stable DiffusionStable Diffusion 2Stable Diffusion XLSDXL TurboLatent upscalerSuper-resolutionK-DiffusionLDM3D Text-to-(RGB, Depth), Text-to-(RGB-pano, Depth-pano), LDM3D UpscalerStable Diffusion T2I-AdapterGLIGEN (Grounded Language-to-Image Generation)
Stable unCLIPText-to-videoText2Video-ZerounCLIPUniDiffuserValue-guided samplingWuerstchenSchedulers
OverviewCMStochasticIterativeSchedulerConsistencyDecoderSchedulerDDIMInverseSchedulerDDIMSchedulerDDPMSchedulerDEISMultistepSchedulerDPMSolverMultistepInverseDPMSolverMultistepSchedulerDPMSolverSDESchedulerDPMSolverSinglestepSchedulerEulerAncestralDiscreteSchedulerEulerDiscreteSchedulerEDMEulerSchedulerEDMDPMSolverMultistepSchedulerHeunDiscreteSchedulerIPNDMSchedulerKarrasVeSchedulerKDPM2AncestralDiscreteSchedulerKDPM2DiscreteSchedulerLCMSchedulerLMSDiscreteSchedulerPNDMSchedulerRePaintSchedulerScoreSdeVeSchedulerScoreSdeVpSchedulerTCDSchedulerUniPCMultistepSchedulerVQDiffusionScheduler
Internal classes
You are viewing v0.27.2 version. A newer version v0.38.0 is available.
Utilities
Utility and helper functions for working with 🤗 Diffusers.
numpy_to_pil
Convert a numpy image or a batch of images to a PIL image.
pt_to_pil
Convert a torch image to a PIL image.
load_image
diffusers.utils.load_image
< source >( image: Union convert_method: Callable = None ) → PIL.Image.Image
Parameters
- image (
strorPIL.Image.Image) — The image to convert to the PIL Image format. - convert_method (Callable[[PIL.Image.Image], PIL.Image.Image], optional) —
A conversion method to apply to the image after loading it.
When set to
Nonethe image will be converted “RGB”.
Returns
PIL.Image.Image
A PIL Image.
Loads image to a PIL Image.
export_to_gif
export_to_video
diffusers.utils.export_to_video
< source >( video_frames: Union output_video_path: str = None fps: int = 10 )
make_image_grid
Prepares a single grid of images. Useful for visualization purposes.