Skip to content

Commit

Permalink
Calculate aspect ratio and pixel count on start (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanLagu authored Sep 15, 2022
1 parent b4de6ca commit 98adf69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def draw_gradio_ui(opt, img2img=lambda x: x, txt2img=lambda x: x, imgproc=lambda

txt2img_width.change(fn=uifn.update_dimensions_info, inputs=[txt2img_width, txt2img_height], outputs=txt2img_dimensions_info_text_box)
txt2img_height.change(fn=uifn.update_dimensions_info, inputs=[txt2img_width, txt2img_height], outputs=txt2img_dimensions_info_text_box)
txt2img_dimensions_info_text_box.value = uifn.update_dimensions_info(txt2img_width.value, txt2img_height.value)

# Temporarily disable prompt parsing until memory issues could be solved
# See #676
Expand Down Expand Up @@ -401,6 +402,7 @@ def img2img_submit_params():
outputs=img2img_dimensions_info_text_box)
img2img_height.change(fn=uifn.update_dimensions_info, inputs=[img2img_width, img2img_height],
outputs=img2img_dimensions_info_text_box)
img2img_dimensions_info_text_box.value = uifn.update_dimensions_info(img2img_width.value, img2img_height.value)

with gr.TabItem("Image Lab", id='imgproc_tab'):
gr.Markdown("Post-process results")
Expand Down

0 comments on commit 98adf69

Please sign in to comment.