aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-19 15:58:08 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-01-19 15:58:08 +0000
commitc1928cdd6194928af0f53f70c51d59479b7025e2 (patch)
tree4e19d1b5eda441aa5a66bcb40bd31152a1116d7d /modules/ui.py
parentd1ea518dea3d7584be2927cc486d15ec3e18ddb0 (diff)
downloadstable-diffusion-webui-gfx803-c1928cdd6194928af0f53f70c51d59479b7025e2.tar.gz
stable-diffusion-webui-gfx803-c1928cdd6194928af0f53f70c51d59479b7025e2.tar.bz2
stable-diffusion-webui-gfx803-c1928cdd6194928af0f53f70c51d59479b7025e2.zip
bring back short hashes to sd checkpoint selection
Diffstat (limited to 'modules/ui.py')
-rw-r--r--modules/ui.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/modules/ui.py b/modules/ui.py
index 0c5ba358..13d80ae2 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -439,7 +439,7 @@ def apply_setting(key, value):
opts.data_labels[key].onchange()
opts.save(shared.config_filename)
- return value
+ return getattr(opts, key)
def update_generation_info(generation_info, html_info, img_index):
@@ -597,6 +597,16 @@ def ordered_ui_categories():
yield category
+def get_value_for_setting(key):
+ value = getattr(opts, key)
+
+ info = opts.data_labels[key]
+ args = info.component_args() if callable(info.component_args) else info.component_args or {}
+ args = {k: v for k, v in args.items() if k not in {'precision'}}
+
+ return gr.update(value=value, **args)
+
+
def create_ui():
import modules.img2img
import modules.txt2img
@@ -1600,7 +1610,7 @@ def create_ui():
opts.save(shared.config_filename)
- return gr.update(value=value), opts.dumpjson()
+ return get_value_for_setting(key), opts.dumpjson()
with gr.Blocks(analytics_enabled=False) as settings_interface:
with gr.Row():
@@ -1771,15 +1781,6 @@ def create_ui():
component_keys = [k for k in opts.data_labels.keys() if k in component_dict]
- def get_value_for_setting(key):
- value = getattr(opts, key)
-
- info = opts.data_labels[key]
- args = info.component_args() if callable(info.component_args) else info.component_args or {}
- args = {k: v for k, v in args.items() if k not in {'precision'}}
-
- return gr.update(value=value, **args)
-
def get_settings_values():
return [get_value_for_setting(key) for key in component_keys]