diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-01-09 19:45:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 19:45:39 +0000 |
commit | 18c001792a3f034245c2a9c38cb568d31c147fed (patch) | |
tree | f43e79374dd7e74074dcbf48fc579f1b12b4d1a8 /modules/ui.py | |
parent | 72497895b9b1948f86d9309fe897cbb70c20ba7e (diff) | |
parent | 2b94ec78869db7d2beaad23bdff47340416edf85 (diff) | |
download | stable-diffusion-webui-gfx803-18c001792a3f034245c2a9c38cb568d31c147fed.tar.gz stable-diffusion-webui-gfx803-18c001792a3f034245c2a9c38cb568d31c147fed.tar.bz2 stable-diffusion-webui-gfx803-18c001792a3f034245c2a9c38cb568d31c147fed.zip |
Merge branch 'master' into varsize
Diffstat (limited to 'modules/ui.py')
-rw-r--r-- | modules/ui.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/ui.py b/modules/ui.py index 4e709a71..9d6b141e 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -267,7 +267,7 @@ def calc_resolution_hires(enable, width, height, hr_scale, hr_resize_x, hr_resiz with devices.autocast():
p.init([""], [0], [0])
- return f"resize: from <span class='resolution'>{width}x{height}</span> to <span class='resolution'>{p.hr_upscale_to_x}x{p.hr_upscale_to_y}</span>"
+ return f"resize: from <span class='resolution'>{p.width}x{p.height}</span> to <span class='resolution'>{p.hr_resize_x or p.hr_upscale_to_x}x{p.hr_resize_y or p.hr_upscale_to_y}</span>"
def apply_styles(prompt, prompt_neg, style1_name, style2_name):
@@ -745,15 +745,20 @@ def create_ui(): custom_inputs = modules.scripts.scripts_txt2img.setup_ui()
hr_resolution_preview_inputs = [enable_hr, width, height, hr_scale, hr_resize_x, hr_resize_y]
- hr_resolution_preview_args = dict(
- fn=calc_resolution_hires,
- inputs=hr_resolution_preview_inputs,
- outputs=[hr_final_resolution],
- show_progress=False
- )
-
for input in hr_resolution_preview_inputs:
- input.change(**hr_resolution_preview_args)
+ input.change(
+ fn=calc_resolution_hires,
+ inputs=hr_resolution_preview_inputs,
+ outputs=[hr_final_resolution],
+ show_progress=False,
+ )
+ input.change(
+ None,
+ _js="onCalcResolutionHires",
+ inputs=hr_resolution_preview_inputs,
+ outputs=[],
+ show_progress=False,
+ )
txt2img_gallery, generation_info, html_info, html_log = create_output_panel("txt2img", opts.outdir_txt2img_samples)
parameters_copypaste.bind_buttons({"txt2img": txt2img_paste}, None, txt2img_prompt)
|