Adapt a model to a new task Many diffusion systems share the same components, allowing you to adapt a pretrained model for one task to an entirely different task. This guide will show you how to adapt a pretrained text-to-image model for inpainting by initializing and modifying the architecture of a pretrained UNet2DConditionModel.  Configure UNet2DConditionModel parameters A UNet2DConditionModel by default accepts 4 channels in the input sample. For example, load a pretrained text-to-image model like runwayml/stable-diffusion-v1-5 and take a look at the number of in_channels:   Copied from diffusers import StableDiffusionPipeline