fix reuse seed

This commit is contained in:
Vladimir Mandic
2023-12-17 07:56:23 -05:00
parent 0609e995bf
commit 4f5478df4f
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -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])
+1 -1
View File
@@ -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"):