Change where VAE state are stored in model

This commit is contained in:
Uminosachi 2023-08-20 23:06:51 +09:00
parent af5d2e8e5f
commit 549b0fc526
2 changed files with 3 additions and 3 deletions

View File

@ -498,8 +498,6 @@ class SdModelData:
pass
if v is not None:
v.base_vae = sd_vae.base_vae
v.loaded_vae_file = sd_vae.loaded_vae_file
self.loaded_sd_models.insert(0, v)

View File

@ -192,7 +192,7 @@ def load_vae_dict(filename, map_location):
def load_vae(model, vae_file=None, vae_source="from unknown source"):
global vae_dict, loaded_vae_file
global vae_dict, base_vae, loaded_vae_file
# save_settings = False
cache_enabled = shared.opts.sd_vae_checkpoint_cache > 0
@ -230,6 +230,8 @@ def load_vae(model, vae_file=None, vae_source="from unknown source"):
restore_base_vae(model)
loaded_vae_file = vae_file
model.base_vae = base_vae
model.loaded_vae_file = loaded_vae_file
# don't call this from outside