rupeshs / fastsdcpu

Fast stable diffusion on CPU
MIT License
1.51k stars 123 forks source link

Basic LoRA support #142

Closed monstruosoft closed 9 months ago

monstruosoft commented 9 months ago

Basic LoRA support for LCM and LCM-LoRA models, not yet available for OpenVINO.

Please note this time I had to dig deeper into the code in order to load the LoRA weights, however, if no LoRA path is provided and with _fuselora kept at its default value of True, the code should behave exactly as it did before. Note that this code is just meant to test LoRA support and it's subject to change.

I turned _fuselora into a setting because, even if the documentation states that it's meant to produce slightly faster inference times, on my machine it's actually somewhat slower; if kept at the default value of True, the code should behave exactly as before.

This code works with LCM and LCM-LoRA models, not sure if the same approach would work with OpenVINO. Also, a similar code should work with SDXL models but I can't test it since I can't run SDXL based inference.

rupeshs commented 9 months ago

Thanks @monstruosoft