diff options
author | CookieHCl <nhc7502@snu.ac.kr> | 2022-10-15 19:54:53 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-16 07:04:14 +0000 |
commit | b65a3101ce82b42b4ccc525044548e66cc44ae4a (patch) | |
tree | 0794006e52ff05795760835b75ad8c03b8e72457 | |
parent | 20bf99052a9d50b5f99d199f4c449ef1ddd6e3cb (diff) | |
download | stable-diffusion-webui-gfx803-b65a3101ce82b42b4ccc525044548e66cc44ae4a.tar.gz stable-diffusion-webui-gfx803-b65a3101ce82b42b4ccc525044548e66cc44ae4a.tar.bz2 stable-diffusion-webui-gfx803-b65a3101ce82b42b4ccc525044548e66cc44ae4a.zip |
Use default value when dropdown ui setting is bad
Default value is the first value of selectables.
Particually, None in styles.
-rw-r--r-- | modules/ui.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index 78096f27..c8e68bd6 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1744,7 +1744,7 @@ Requested path was: {f} # Since there are many dropdowns that shouldn't be saved,
# we only mark dropdowns that should be saved.
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(img2img_interface, loadsave, "img2img")
|