fix problems related to checkpoint/VAE switching in XY plot

This commit is contained in:
AUTOMATIC 2023-01-16 09:27:52 +03:00
parent dd292a925e
commit 972f578507

View File

@ -263,14 +263,12 @@ class SharedSettingsStackHelper(object):
def __enter__(self): def __enter__(self):
self.CLIP_stop_at_last_layers = opts.CLIP_stop_at_last_layers self.CLIP_stop_at_last_layers = opts.CLIP_stop_at_last_layers
self.hypernetwork = opts.sd_hypernetwork self.hypernetwork = opts.sd_hypernetwork
self.model = shared.sd_model
self.vae = opts.sd_vae self.vae = opts.sd_vae
def __exit__(self, exc_type, exc_value, tb): def __exit__(self, exc_type, exc_value, tb):
modules.sd_models.reload_model_weights(self.model)
opts.data["sd_vae"] = self.vae opts.data["sd_vae"] = self.vae
modules.sd_vae.reload_vae_weights(self.model) modules.sd_models.reload_model_weights()
modules.sd_vae.reload_vae_weights()
hypernetwork.load_hypernetwork(self.hypernetwork) hypernetwork.load_hypernetwork(self.hypernetwork)
hypernetwork.apply_strength() hypernetwork.apply_strength()