diff options
author | CookieHCl <nhc7502@snu.ac.kr> | 2022-10-15 20:09:11 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-16 07:04:14 +0000 |
commit | 9258a33e3755c76922cd47a03cd59419b6426304 (patch) | |
tree | d5df64c1dbff93d9c9e8d50daa2a98d52add284c /modules/ui.py | |
parent | b65a3101ce82b42b4ccc525044548e66cc44ae4a (diff) | |
download | stable-diffusion-webui-gfx803-9258a33e3755c76922cd47a03cd59419b6426304.tar.gz stable-diffusion-webui-gfx803-9258a33e3755c76922cd47a03cd59419b6426304.tar.bz2 stable-diffusion-webui-gfx803-9258a33e3755c76922cd47a03cd59419b6426304.zip |
Warn when user uses bad ui setting
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index c8e68bd6..10bdf121 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1717,7 +1717,9 @@ Requested path was: {f} saved_value = ui_settings.get(key, None)
if saved_value is None:
ui_settings[key] = getattr(obj, field)
- elif condition is None or condition(saved_value):
+ elif condition and not condition(saved_value):
+ print(f'Warning: Bad ui setting value: {key}: {saved_value}; Default value "{getattr(obj, field)}" will be used instead.')
+ else:
setattr(obj, field, saved_value)
if type(x) in [gr.Slider, gr.Radio, gr.Checkbox, gr.Textbox, gr.Number] and x.visible:
|