aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hypernetworks/ui.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-11 15:04:47 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-10-11 15:04:47 +0000
commitd682444ecc99319fbd2b142a12727501e2884ba7 (patch)
tree0b4cb662da210c35c513e95b2786d2eb4082d6df /modules/hypernetworks/ui.py
parent5ba23cb41f28f5856a7f64cb0d95e1e94dce90af (diff)
downloadstable-diffusion-webui-gfx803-d682444ecc99319fbd2b142a12727501e2884ba7.tar.gz
stable-diffusion-webui-gfx803-d682444ecc99319fbd2b142a12727501e2884ba7.tar.bz2
stable-diffusion-webui-gfx803-d682444ecc99319fbd2b142a12727501e2884ba7.zip
add option to select hypernetwork modules when creating
Diffstat (limited to 'modules/hypernetworks/ui.py')
-rw-r--r--modules/hypernetworks/ui.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/hypernetworks/ui.py b/modules/hypernetworks/ui.py
index e7540f41..cdddcce1 100644
--- a/modules/hypernetworks/ui.py
+++ b/modules/hypernetworks/ui.py
@@ -9,11 +9,11 @@ from modules import sd_hijack, shared
from modules.hypernetworks import hypernetwork
-def create_hypernetwork(name):
+def create_hypernetwork(name, enable_sizes):
fn = os.path.join(shared.cmd_opts.hypernetwork_dir, f"{name}.pt")
assert not os.path.exists(fn), f"file {fn} already exists"
- hypernet = modules.hypernetworks.hypernetwork.Hypernetwork(name=name)
+ hypernet = modules.hypernetworks.hypernetwork.Hypernetwork(name=name, enable_sizes=[int(x) for x in enable_sizes])
hypernet.save(fn)
shared.reload_hypernetworks()