Skip to content
代码片段 群组 项目
提交 9258a33e 编辑于 作者: CookieHCl's avatar CookieHCl 提交者: AUTOMATIC1111
浏览文件

Warn when user uses bad ui setting

上级 b65a3101
No related branches found
No related tags found
无相关合并请求
......@@ -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:
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册