inference. Offload the model to the CPU with enable_model_cpu_offload() for out-of-memory errors:   Copied - base.to("cuda")
- refiner.to("cuda")
+ base.enable_model_cpu_offload()
+ refiner.enable_model_cpu_offload() Use torch.compile for ~20% speed-up (you need torch>=2.0):   Copied + base.unet = torch.compile(base.unet, mode="reduce-overhead", fullgraph=True)
+ refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)