Skip to content

Commit 307e197

Browse files
authored
Fix pagitation (#3349)
* fix pagitation * fix pagitation, fix page numbering
1 parent 4c2e562 commit 307e197

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kohya_gui/manual_caption_gui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def render_pagination_with_logic(page, max_page):
244244
image_files_state = gr.State([])
245245

246246
info_box = gr.Markdown(visible=False)
247-
page = gr.Number(value=1, visible=False)
247+
page = gr.State(value=1)
248248
max_page = gr.Number(value=1, visible=False)
249249
loaded_images_dir = gr.Text(visible=False)
250250

@@ -316,4 +316,5 @@ def render_pagination_with_logic(page, max_page):
316316

317317
auto_save.change(lambda is_auto_save: [gr.Button(visible=not is_auto_save)] * IMAGES_TO_SHOW, inputs=auto_save, outputs=save_buttons)
318318
page.change(lambda p, m: (f"Page {int(p)} / {int(m)}", f"Page {int(p)} / {int(m)}"), inputs=[page, max_page], outputs=[page_count1, page_count2], show_progress=False)
319+
image_files_state.change(lambda p, m: (f"Page {int(p)} / {int(m)}", f"Page {int(p)} / {int(m)}"), inputs=[page, max_page], outputs=[page_count1, page_count2], show_progress=False)
319320
max_page.change(lambda p, m: (f"Page {int(p)} / {int(m)}", f"Page {int(p)} / {int(m)}"), inputs=[page, max_page], outputs=[page_count1, page_count2], show_progress=False)

0 commit comments

Comments
 (0)