aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hypernetwork/ui.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-10-11 11:53:02 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-10-11 11:53:02 +0000
commit530103b586109c11fd068eb70ef09503ec6a4caf (patch)
tree010cc4b82c7f0ccd2a9901fb312459d85ac4deb8 /modules/hypernetwork/ui.py
parent5de806184f6687e46cf936b92055146dc6cf2994 (diff)
downloadstable-diffusion-webui-gfx803-530103b586109c11fd068eb70ef09503ec6a4caf.tar.gz
stable-diffusion-webui-gfx803-530103b586109c11fd068eb70ef09503ec6a4caf.tar.bz2
stable-diffusion-webui-gfx803-530103b586109c11fd068eb70ef09503ec6a4caf.zip
fixes related to merge
Diffstat (limited to 'modules/hypernetwork/ui.py')
-rw-r--r--modules/hypernetwork/ui.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/hypernetwork/ui.py b/modules/hypernetwork/ui.py
index 525f978c..f6d1d0a3 100644
--- a/modules/hypernetwork/ui.py
+++ b/modules/hypernetwork/ui.py
@@ -6,24 +6,24 @@ import gradio as gr
import modules.textual_inversion.textual_inversion
import modules.textual_inversion.preprocess
from modules import sd_hijack, shared
+from modules.hypernetwork import hypernetwork
def create_hypernetwork(name):
fn = os.path.join(shared.cmd_opts.hypernetwork_dir, f"{name}.pt")
assert not os.path.exists(fn), f"file {fn} already exists"
- hypernetwork = modules.hypernetwork.hypernetwork.Hypernetwork(name=name)
- hypernetwork.save(fn)
+ hypernet = modules.hypernetwork.hypernetwork.Hypernetwork(name=name)
+ hypernet.save(fn)
shared.reload_hypernetworks()
- shared.hypernetwork = shared.hypernetworks.get(shared.opts.sd_hypernetwork, None)
return gr.Dropdown.update(choices=sorted([x for x in shared.hypernetworks.keys()])), f"Created: {fn}", ""
def train_hypernetwork(*args):
- initial_hypernetwork = shared.hypernetwork
+ initial_hypernetwork = shared.loaded_hypernetwork
try:
sd_hijack.undo_optimizations()
@@ -38,6 +38,6 @@ Hypernetwork saved to {html.escape(filename)}
except Exception:
raise
finally:
- shared.hypernetwork = initial_hypernetwork
+ shared.loaded_hypernetwork = initial_hypernetwork
sd_hijack.apply_optimizations()