mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-21 07:30:02 +08:00
855b9e3d1c
update readme to reflect some recent changes
22 lines
620 B
Python
22 lines
620 B
Python
from modules import extra_networks
|
|
from modules.hypernetworks import hypernetwork
|
|
|
|
|
|
class ExtraNetworkHypernet(extra_networks.ExtraNetwork):
|
|
def __init__(self):
|
|
super().__init__('hypernet')
|
|
|
|
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)
|
|
|
|
hypernetwork.load_hypernetworks(names, multipliers)
|
|
|
|
def deactivate(self, p):
|
|
pass
|