= DiffusionPipeline.from_pretrained(model_id, unet=unet, text_encoder=text_encoder, dtype=torch.float16)
pipeline.to("cuda")

# Perform inference, or save, or push to the hub
pipeline.save_pretrained("dreambooth-pipeline")
If you have installed "accelerate<0.16.0" you need to first convert it to an inference pipeline. This is how you could do it:


	Copied
from accelerate import Accelerator
from diffusers import DiffusionPipeline

# Load the pi