diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-29 15:40:28 +0300 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-29 15:40:28 +0300 |
commit | c715ef04d1edb1a112a602639ed3bb292fdeb0e2 (patch) | |
tree | 30bd6137b21e771f920bee3f23cd5a7d51fa78c3 /modules/sd_models.py | |
parent | 965dcf446991eca02074a9666048f50540261ba5 (diff) |
fix for incorrect model weight loading for #814
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 7a5edced..eb21e498 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -137,7 +137,7 @@ def load_model(): def reload_model_weights(sd_model, info=None):
- from modules import lowvram, devices
+ from modules import lowvram, devices, sd_hijack
checkpoint_info = info or select_checkpoint()
if sd_model.sd_model_checkpint == checkpoint_info.filename:
@@ -148,8 +148,12 @@ def reload_model_weights(sd_model, info=None): else:
sd_model.to(devices.cpu)
+ sd_hijack.model_hijack.undo_hijack(sd_model)
+
load_model_weights(sd_model, checkpoint_info.filename, checkpoint_info.hash)
+ sd_hijack.model_hijack.hijack(sd_model)
+
if not shared.cmd_opts.lowvram and not shared.cmd_opts.medvram:
sd_model.to(devices.device)
|