提交 b65a3101 编写于 作者: C CookieHCl 提交者: AUTOMATIC1111

Use default value when dropdown ui setting is bad

Default value is the first value of selectables.
Particually, None in styles.
上级 20bf9905
...@@ -1744,7 +1744,7 @@ Requested path was: {f} ...@@ -1744,7 +1744,7 @@ Requested path was: {f}
# Since there are many dropdowns that shouldn't be saved, # Since there are many dropdowns that shouldn't be saved,
# we only mark dropdowns that should be saved. # we only mark dropdowns that should be saved.
if type(x) == gr.Dropdown and getattr(x, 'save_to_config', False): if type(x) == gr.Dropdown and getattr(x, 'save_to_config', False):
apply_field(x, 'value') apply_field(x, 'value', lambda val: val in x.choices)
visit(txt2img_interface, loadsave, "txt2img") visit(txt2img_interface, loadsave, "txt2img")
visit(img2img_interface, loadsave, "img2img") visit(img2img_interface, loadsave, "img2img")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册