diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-17 20:11:33 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-17 20:11:33 +0000 |
commit | b397f63e00bbfbe9087d80abb457aa9a593b181b (patch) | |
tree | 61dc84464d77059246afeb442b0d86bfb735894e /modules/ui.py | |
parent | 30410fd355c08c639ae40ce4be08033a70463885 (diff) | |
download | stable-diffusion-webui-gfx803-b397f63e00bbfbe9087d80abb457aa9a593b181b.tar.gz stable-diffusion-webui-gfx803-b397f63e00bbfbe9087d80abb457aa9a593b181b.tar.bz2 stable-diffusion-webui-gfx803-b397f63e00bbfbe9087d80abb457aa9a593b181b.zip |
add option to reorder tabs
fix Reload UI not working
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ui.py b/modules/ui.py index bed8464e..a47af214 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -1644,7 +1644,10 @@ def create_ui(): parameters_copypaste.connect_paste_params_buttons()
with gr.Tabs(elem_id="tabs") as tabs:
- for interface, label, ifid in interfaces:
+ tab_order = {k: i for i, k in enumerate(opts.ui_tab_order)}
+ sorted_interfaces = sorted(interfaces, key=lambda x: tab_order.get(x[1], 9999))
+
+ for interface, label, ifid in sorted_interfaces:
if label in shared.opts.hidden_tabs:
continue
with gr.TabItem(label, id=ifid, elem_id=f"tab_{ifid}"):
|