pipe = pipe.to("cuda")

>>> pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config)
>>> pipeline.inverse_scheduler = DDIMInverseScheduler.from_config(pipeline.scheduler.config)
>>> pipeline.enable_model_cpu_offload()

>>> prompt = "A bowl of fruits"

>>> inverted_latents = pipe.invert(image=init_image, prompt=prompt).latents  __call__  < source > ( prompt: Union = None mask_image: Union = None image_latents: Union = None inpai