diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-17 21:03:16 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-17 21:03:16 +0000 |
commit | 3694379f26500f54a7c6ece3d171ffd6635e7a93 (patch) | |
tree | 022b22cd23097603a9b92dc3d94f2ab4f80a7fcf /modules/ui.py | |
parent | 973ae87309e5787bc874e6dad1ec81398b57a77d (diff) | |
download | stable-diffusion-webui-gfx803-3694379f26500f54a7c6ece3d171ffd6635e7a93.tar.gz stable-diffusion-webui-gfx803-3694379f26500f54a7c6ece3d171ffd6635e7a93.tar.bz2 stable-diffusion-webui-gfx803-3694379f26500f54a7c6ece3d171ffd6635e7a93.zip |
rework #8863 to work with all img2img tabs
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/ui.py b/modules/ui.py index b915482f..9ae0e2a5 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -954,6 +954,14 @@ def create_ui(): res_switch_btn.click(fn=None, _js="function(){switchWidthHeight('img2img')}", inputs=None, outputs=None, show_progress=False)
+ detect_image_size_btn.click(
+ fn=lambda w, h, _: (w or gr.update(), h or gr.update()),
+ _js="currentImg2imgSourceResolution",
+ inputs=[dummy_component, dummy_component, dummy_component],
+ outputs=[width, height],
+ show_progress=False,
+ )
+
restore_progress_button.click(
fn=progress.restore_progress,
_js="restoreProgressImg2img",
@@ -967,8 +975,6 @@ def create_ui(): show_progress=False,
)
- detect_image_size_btn.click(lambda i, w, h : i.size if i is not None else (w, h), inputs=[init_img, width, height], outputs=[width, height])
-
img2img_interrogate.click(
fn=lambda *args: process_interrogate(interrogate, *args),
**interrogate_args,
|