6 Commits (0db084a4ea194b2bb76b3eacb63e86e804c83950)

Author SHA1 Message Date
brkirch e3b53fd295 Add UI setting for upcasting attention to float32
Adds "Upcast cross attention layer to float32" option in Stable Diffusion settings. This allows for generating images using SD 2.1 models without --no-half or xFormers.

In order to make upcasting cross attention layer optimizations possible it is necessary to indent several sections of code in sd_hijack_optimizations.py so that a context manager can be used to disable autocast. Also, even though Stable Diffusion (and Diffusers) only upcast q and k, unfortunately my findings were that most of the cross attention layer optimizations could not function unless v is upcast also.
3 years ago
AUTOMATIC cdfcbd9959 Remove fallback for Protocol import and remove Protocol import and remove instances of Protocol in code
add some whitespace between functions to be in line with other code in the repo
3 years ago
ProGamerGov 984b86dd0a
Add fallback for Protocol import 3 years ago
brkirch c18add68ef Added license 3 years ago
brkirch b119815333 Use narrow instead of dynamic_slice 3 years ago
brkirch d782a95967 Add Birch-san's sub-quadratic attention implementation 3 years ago