ts with the from_pretrained() method. To seamlessly switch between tasks with the same checkpoint without reallocating additional memory, use the from_pipe() method to transfer the components from the original pipeline to the new one.   Copied from diffusers import AutoPipelineForText2Image
import torch

pipeline = AutoPipelineForText2Image.from_pretrained(
    "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16, use_safetensors=True
).