aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hypernetworks/ui.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-21 06:57:55 +0000
committerGitHub <noreply@github.com>2022-10-21 06:57:55 +0000
commit0c5522ea211370046a2ca628e92d35a7c8c97972 (patch)
tree7c66a3eba0a8a8149900056c6511146182b02276 /modules/hypernetworks/ui.py
parent858462f719c22ca9f24b94a41699653c34b5f4fb (diff)
parent2273e752fb3e578f1047f6d38b96330b07bf61a9 (diff)
downloadstable-diffusion-webui-gfx803-0c5522ea211370046a2ca628e92d35a7c8c97972.tar.gz
stable-diffusion-webui-gfx803-0c5522ea211370046a2ca628e92d35a7c8c97972.tar.bz2
stable-diffusion-webui-gfx803-0c5522ea211370046a2ca628e92d35a7c8c97972.zip
Merge branch 'master' into training-help-text
Diffstat (limited to 'modules/hypernetworks/ui.py')
-rw-r--r--modules/hypernetworks/ui.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/hypernetworks/ui.py b/modules/hypernetworks/ui.py
index f45345ea..266f04f6 100644
--- a/modules/hypernetworks/ui.py
+++ b/modules/hypernetworks/ui.py
@@ -10,19 +10,20 @@ from modules import sd_hijack, shared, devices
from modules.hypernetworks import hypernetwork
-def create_hypernetwork(name, enable_sizes, overwrite_old, layer_structure=None, add_layer_norm=False):
+def create_hypernetwork(name, enable_sizes, overwrite_old, layer_structure=None, add_layer_norm=False, activation_func=None):
fn = os.path.join(shared.cmd_opts.hypernetwork_dir, f"{name}.pt")
if not overwrite_old:
assert not os.path.exists(fn), f"file {fn} already exists"
if type(layer_structure) == str:
- layer_structure = tuple(map(int, re.sub(r'\D', '', layer_structure)))
+ layer_structure = [float(x.strip()) for x in layer_structure.split(",")]
hypernet = modules.hypernetworks.hypernetwork.Hypernetwork(
name=name,
enable_sizes=[int(x) for x in enable_sizes],
layer_structure=layer_structure,
add_layer_norm=add_layer_norm,
+ activation_func=activation_func,
)
hypernet.save(fn)