ensure your pipeline and its components (unet and scheduler) can be saved with save_pretrained(), add them to the register_modules function:   Copied   from diffusers import DiffusionPipeline
  import torch

  class UnetSchedulerOneForwardPipeline(DiffusionPipeline):
      def __init__(self, unet, scheduler):
          super().__init__()

+         self.register_modules(unet=unet, scheduler=scheduler) Cool, the __init__ step is done and you can