stable-diffusion-webui/extensions-builtin/Lora/extra_networks_lora.py
AUTOMATIC 855b9e3d1c Lora support!
update readme to reflect some recent changes
2023-01-21 16:15:53 +03:00

20 lines
559 B
Python

from modules import extra_networks
import lora
class ExtraNetworkLora(extra_networks.ExtraNetwork):
def __init__(self):
super().__init__('lora')
def activate(self, p, params_list):
names = []
multipliers = []
for params in params_list:
assert len(params.items) > 0
names.append(params.items[0])
multipliers.append(float(params.items[1]) if len(params.items) > 1 else 1.0)
lora.load_loras(names, multipliers)
def deactivate(self, p):
pass