Looking a the source code of Diffusers, there are 2 options of attention that we can select for inferencing:
-
The default option is PyTorch implementation of attention which calls torch.nn.functional.scaled_dot_product_attention(). The corresponding attention processor class is here.
-
Another option is the naive attention implemented in the diffuser source code. The corresponding attention processor class is here.
My question is how do we select the option of attention for inferencing StableDiffusionXLPipeline, if we initialize it with from_pretrained() like the below image? What parameter can we pass into from_pretrained() that specify the attention version? If there’s no such parameter, are there other ways to do it?