From 9258a33e3755c76922cd47a03cd59419b6426304 Mon Sep 17 00:00:00 2001 From: CookieHCl Date: Sun, 16 Oct 2022 05:09:11 +0900 Subject: [PATCH] Warn when user uses bad ui setting --- modules/ui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ui.py b/modules/ui.py index c8e68bd6b..10bdf121e 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: