aboutsummaryrefslogtreecommitdiff
path: root/modules/shared.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-04 12:35:07 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-01-04 12:35:07 +0300
commit02d7abf5141431b9a3a8a189bb3136c71abd5e79 (patch)
tree6b19b67fab476214ffd5d19a316d4daf8baf1a70 /modules/shared.py
parent7e549468b3d01e6cdf6d07d00c2719c1a5787517 (diff)
helpful error message when trying to load 2.0 without config
failing to load model weights from settings won't break generation for currently loaded model anymore
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 23657a93..7588c47b 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -14,7 +14,7 @@ import modules.interrogate
import modules.memmon
import modules.styles
import modules.devices as devices
-from modules import localization, sd_vae, extensions, script_loading
+from modules import localization, sd_vae, extensions, script_loading, errors
from modules.paths import models_path, script_path, sd_path
@@ -494,7 +494,12 @@ class Options:
return False
if self.data_labels[key].onchange is not None:
- self.data_labels[key].onchange()
+ try:
+ self.data_labels[key].onchange()
+ except Exception as e:
+ errors.display(e, f"changing setting {key} to {value}")
+ setattr(self, key, oldval)
+ return False
return True