diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-25 06:25:47 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-25 06:25:47 +0000 |
commit | b8eae5de9324df0c1cd30561ec75d85490aced59 (patch) | |
tree | 2cc6f16d7fe136d90f6d8bb2188b8b3041f3f4db /modules/ui.py | |
parent | 600cc0342dfe6c9997f496f6be23de51ae7204a1 (diff) | |
parent | 72e2a96284e0cbc11ebea7e8cd6739175dbc63af (diff) | |
download | stable-diffusion-webui-gfx803-b8eae5de9324df0c1cd30561ec75d85490aced59.tar.gz stable-diffusion-webui-gfx803-b8eae5de9324df0c1cd30561ec75d85490aced59.tar.bz2 stable-diffusion-webui-gfx803-b8eae5de9324df0c1cd30561ec75d85490aced59.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index 4dcf12a2..91f07cd5 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1040,7 +1040,10 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): def loadsave(path, x):
def apply_field(obj, field, condition=None):
key = path + "/" + field
-
+
+ if getattr(obj,'do_not_save_to_config',False):
+ return
+
saved_value = ui_settings.get(key, None)
if saved_value is None:
ui_settings[key] = getattr(obj, field)
@@ -1056,6 +1059,15 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo): if type(x) == gr.Radio:
apply_field(x, 'value', lambda val: val in x.choices)
+ if type(x) == gr.Checkbox:
+ apply_field(x, 'value')
+
+ if type(x) == gr.Textbox:
+ apply_field(x, 'value')
+
+ if type(x) == gr.Number:
+ apply_field(x, 'value')
+
visit(txt2img_interface, loadsave, "txt2img")
visit(img2img_interface, loadsave, "img2img")
visit(extras_interface, loadsave, "extras")
|