lllyasviel / Paints-UNDO

Understand Human Behavior to Align True Needs
Apache License 2.0
3.25k stars 287 forks source link

use xformers for single frame model #47

Open KohakuBlueleaf opened 1 month ago

KohakuBlueleaf commented 1 month ago

After pytorch 2.2.0, flash attn 2 have been added to pytorch's sdp attn implementation. But it also drop the support of flash attn on Windows platform.

Since this project already require user to install xformers (which have flash attn 2 support on windows by default). I recommend to use xformers instead of diffusers' default implementation (which use pytorch sdp).

Use xformers also avoid extra transpose operation for q/k/v and attn output.