aboutsummaryrefslogtreecommitdiff
path: root/modules/hypernetworks/ui.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-19 18:58:49 +0300
committerGitHub <noreply@github.com>2022-10-19 18:58:49 +0300
commitc664b231a836891d22081c5643c46aace180e427 (patch)
tree90c719f4b176e8676ea228237f354b73a3d67147 /modules/hypernetworks/ui.py
parentf510a2277ee3641564c13841b04b50293384526f (diff)
parent365d4b1650b77c8f8aedf4a294c2b9e47d665f04 (diff)
Merge pull request #3162 from discus0434/master
Added what I forgot to commit in already merged PR: #3086
Diffstat (limited to 'modules/hypernetworks/ui.py')
-rw-r--r--modules/hypernetworks/ui.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/hypernetworks/ui.py b/modules/hypernetworks/ui.py
index 7e8ea95e..08f75f15 100644
--- a/modules/hypernetworks/ui.py
+++ b/modules/hypernetworks/ui.py
@@ -1,5 +1,6 @@
import html
import os
+import re
import gradio as gr
@@ -13,6 +14,9 @@ def create_hypernetwork(name, enable_sizes, layer_structure=None, add_layer_norm
fn = os.path.join(shared.cmd_opts.hypernetwork_dir, f"{name}.pt")
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)))
+
hypernet = modules.hypernetworks.hypernetwork.Hypernetwork(
name=name,
enable_sizes=[int(x) for x in enable_sizes],