aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-11-18 18:27:54 +0000
committerMuhammad Rizqi Nur <rizqinur2010@gmail.com>2022-11-19 04:47:54 +0000
commit028b67b6357b5a00ccbd6ea72d2f244a6664162b (patch)
treec8e3f9a8cfd2562a7684c6bb53d0e4a7fd1c96be /modules
parent9fdc343dcaee70f1a0ff15c0cc668dbd487abc61 (diff)
downloadstable-diffusion-webui-gfx803-028b67b6357b5a00ccbd6ea72d2f244a6664162b.tar.gz
stable-diffusion-webui-gfx803-028b67b6357b5a00ccbd6ea72d2f244a6664162b.tar.bz2
stable-diffusion-webui-gfx803-028b67b6357b5a00ccbd6ea72d2f244a6664162b.zip
Use underscore naming for "private" functions in sd_vae
Diffstat (limited to 'modules')
-rw-r--r--modules/sd_vae.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/sd_vae.py b/modules/sd_vae.py
index 5b4709b5..d82a7bad 100644
--- a/modules/sd_vae.py
+++ b/modules/sd_vae.py
@@ -55,7 +55,7 @@ def restore_base_vae(model):
global loaded_vae_file
if base_vae is not None and checkpoint_info == model.sd_checkpoint_info:
print("Restoring base VAE")
- load_vae_dict(model, base_vae)
+ _load_vae_dict(model, base_vae)
loaded_vae_file = None
delete_base_vae()
@@ -147,7 +147,7 @@ def load_vae(model, vae_file=None):
store_base_vae(model)
vae_ckpt = torch.load(vae_file, map_location=shared.weight_load_location)
vae_dict_1 = {k: v for k, v in vae_ckpt["state_dict"].items() if k[0:4] != "loss" and k not in vae_ignore_keys}
- load_vae_dict(model, vae_dict_1)
+ _load_vae_dict(model, vae_dict_1)
# If vae used is not in dict, update it
# It will be removed on refresh though
@@ -164,7 +164,7 @@ def load_vae(model, vae_file=None):
# don't call this from outside
-def load_vae_dict(model, vae_dict_1):
+def _load_vae_dict(model, vae_dict_1):
model.first_stage_model.load_state_dict(vae_dict_1)
model.first_stage_model.to(devices.dtype_vae)