Chasing save issues (#2331)
* already_saved_as attribute for gallery items after hiresfix quickbutton * different method to select image in gallery after hires quickbutton with insert option to avoid other changes
This commit is contained in:
+7
-1
@@ -470,6 +470,12 @@ def create_ui():
|
||||
toprow.prompt.submit(**txt2img_args)
|
||||
toprow.submit.click(**txt2img_args)
|
||||
|
||||
def select_gallery_image(index):
|
||||
index = int(index)
|
||||
if getattr(shared.opts, 'hires_button_gallery_insert', False):
|
||||
index += 1
|
||||
return gr.update(selected_index=index)
|
||||
|
||||
txt2img_upscale_inputs = txt2img_inputs[0:1] + [output_panel.gallery, dummy_component_number, output_panel.generation_info] + txt2img_inputs[1:]
|
||||
output_panel.button_upscale.click(
|
||||
fn=wrap_gradio_gpu_call(modules.txt2img.txt2img_upscale, extra_outputs=[None, '', '']),
|
||||
@@ -477,7 +483,7 @@ def create_ui():
|
||||
inputs=txt2img_upscale_inputs,
|
||||
outputs=txt2img_outputs,
|
||||
show_progress=False,
|
||||
)
|
||||
).then(fn=select_gallery_image, js="selected_gallery_index", inputs=[dummy_component], outputs=[output_panel.gallery])
|
||||
|
||||
res_switch_btn.click(lambda w, h: (h, w), inputs=[width, height], outputs=[width, height], show_progress=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user