Additionally, we also use model cpu offloading to reduce the memory usage.  Torch.compile You can achieve a 20-25% speed-up at the expense of slightly increased memory by compiling the UNet as follows:   Copied - pipe.enable_model_cpu_offload()