Skip to content

Commit

Permalink
Merge pull request #14637 from light-and-ray/fix_tab_indexes_resets_a…
Browse files Browse the repository at this point in the history
…fter_restart_ui

[Bug] Fix tab indexes are reseted after restart UI
  • Loading branch information
AUTOMATIC1111 authored Jan 20, 2024
2 parents a06ae54 + 56676ff commit 1dbee39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def add_copy_image_controls(tab_name, elem):

if category == "image":
with gr.Tabs(elem_id="mode_img2img"):
img2img_selected_tab = gr.State(0)
img2img_selected_tab = gr.Number(value=0, visible=False)

with gr.TabItem('img2img', id='img2img', elem_id="img2img_img2img_tab") as tab_img2img:
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)
Expand Down Expand Up @@ -613,7 +613,7 @@ def copy_image(img):
elif category == "dimensions":
with FormRow():
with gr.Column(elem_id="img2img_column_size", scale=4):
selected_scale_tab = gr.State(value=0)
selected_scale_tab = gr.Number(value=0, visible=False)

with gr.Tabs():
with gr.Tab(label="Resize to", elem_id="img2img_tab_resize_to") as tab_scale_to:
Expand Down
2 changes: 1 addition & 1 deletion modules/ui_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def create_ui():
dummy_component = gr.Label(visible=False)
tab_index = gr.State(value=0)
tab_index = gr.Number(value=0, visible=False)

with gr.Row(equal_height=False, variant='compact'):
with gr.Column(variant='compact'):
Expand Down

0 comments on commit 1dbee39

Please sign in to comment.