d
from diffusers import UNet2DConditionModel

repo_id = "CompVis/ldm-text2im-large-256"
model = UNet2DConditionModel.from_pretrained(repo_id, subfolder="unet")
Note how we have to define the subfolder="unet" argument to tell ModelMixin.from_pretrained() that the model weights are located in a subfolder of the repository.
As explained in Loading customized pipelines, one can pass a loaded model to a diffusion pipeline, via DiffusionPipeline.from