From 4f5478df4f048b0d343988456757076ce762737e Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 17 Dec 2023 07:56:23 -0500 Subject: [PATCH] fix reuse seed --- modules/ui.py | 4 +++- modules/ui_interrogate.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ui.py b/modules/ui.py index c93c76430..97b7c3e4b 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -269,11 +269,13 @@ def connect_reuse_seed(seed: gr.Number, reuse_seed: gr.Button, generation_info: """ Connects a 'reuse (sub)seed' button's click event so that it copies last used (sub)seed value from generation info the to the seed field. If copying subseed and subseed strength was 0, i.e. no variation seed was used, it copies the normal seed value instead.""" - def copy_seed(gen_info_string: str, index): + def copy_seed(gen_info_string: str, index: int): res = -1 try: gen_info = json.loads(gen_info_string) + log.debug(f'Reuse: info={gen_info}') index -= gen_info.get('index_of_first_image', 0) + index = int(index) if is_subseed and gen_info.get('subseed_strength', 0) > 0: all_subseeds = gen_info.get('all_subseeds', [-1]) diff --git a/modules/ui_interrogate.py b/modules/ui_interrogate.py index b9bb074ea..98fbe9a2f 100644 --- a/modules/ui_interrogate.py +++ b/modules/ui_interrogate.py @@ -195,7 +195,7 @@ def create_ui(): analyze_btn = gr.Button("Analyze", variant='primary') unload_btn = gr.Button("Unload") with gr.Row(): - buttons = parameters_copypaste.create_buttons(["txt2img", "img2img", "extras"]) + buttons = parameters_copypaste.create_buttons(["txt2img", "img2img", "extras", "control"]) for tabname, button in buttons.items(): parameters_copypaste.register_paste_params_button(parameters_copypaste.ParamBinding(paste_button=button, tabname=tabname, source_text_component=prompt, source_image_component=image,)) with gr.Tab("Batch"):