mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
fix reuse seed
This commit is contained in:
+3
-1
@@ -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])
|
||||
|
||||
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user