Skip to content

Commit 1dbee39

Browse files
Merge pull request #14637 from light-and-ray/fix_tab_indexes_resets_after_restart_ui
[Bug] Fix tab indexes are reseted after restart UI
2 parents a06ae54 + 56676ff commit 1dbee39

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/ui.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def add_copy_image_controls(tab_name, elem):
532532

533533
if category == "image":
534534
with gr.Tabs(elem_id="mode_img2img"):
535-
img2img_selected_tab = gr.State(0)
535+
img2img_selected_tab = gr.Number(value=0, visible=False)
536536

537537
with gr.TabItem('img2img', id='img2img', elem_id="img2img_img2img_tab") as tab_img2img:
538538
init_img = gr.Image(label="Image for img2img", elem_id="img2img_image", show_label=False, source="upload", interactive=True, type="pil", tool="editor", image_mode="RGBA", height=opts.img2img_editor_height)
@@ -613,7 +613,7 @@ def copy_image(img):
613613
elif category == "dimensions":
614614
with FormRow():
615615
with gr.Column(elem_id="img2img_column_size", scale=4):
616-
selected_scale_tab = gr.State(value=0)
616+
selected_scale_tab = gr.Number(value=0, visible=False)
617617

618618
with gr.Tabs():
619619
with gr.Tab(label="Resize to", elem_id="img2img_tab_resize_to") as tab_scale_to:

modules/ui_postprocessing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def create_ui():
77
dummy_component = gr.Label(visible=False)
8-
tab_index = gr.State(value=0)
8+
tab_index = gr.Number(value=0, visible=False)
99

1010
with gr.Row(equal_height=False, variant='compact'):
1111
with gr.Column(variant='compact'):

0 commit comments

Comments
 (0)