=torch.float16)
+ pipe.enable_xformers_memory_efficient_attention() Enable torch.compile if you’re using PyTorch >= 2.0 to automatically use scaled dot-product attention (SDPA):   Copied   pipe.unet.to(memory_format=torch.channels_last)
+ pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) This is the same as explicitly setting the attention processor to use AttnAddedKVProcessor2_0:   Copied from diffusers.models.attent