From aff12749b2114d432d355042817df927d916173f Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Fri, 24 May 2024 21:58:17 +0200 Subject: [PATCH] feat: add translation for image size describe (#2992) --- language/en.json | 14 ++++++++++++-- modules/util.py | 3 ++- webui.py | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/language/en.json b/language/en.json index 3eb5d5e25e..33a70b7ba3 100644 --- a/language/en.json +++ b/language/en.json @@ -9,9 +9,19 @@ "Advanced": "Advanced", "Upscale or Variation": "Upscale or Variation", "Image Prompt": "Image Prompt", - "Inpaint or Outpaint (beta)": "Inpaint or Outpaint (beta)", - "Drag above image to here": "Drag above image to here", + "Inpaint or Outpaint": "Inpaint or Outpaint", + "Drag inpaint or outpaint image to here": "Drag inpaint or outpaint image to here", + "Outpaint Direction": "Outpaint Direction", + "Method": "Method", + "Describe": "Describe", + "Drag any image to here": "Drag any image to here", + "Content Type": "Content Type", + "Photograph": "Photograph", + "Art/Anime": "Art/Anime", + "Describe this Image into Prompt": "Describe this Image into Prompt", + "Image Size and Recommended Size": "Image Size and Recommended Size", "Upscale or Variation:": "Upscale or Variation:", + "Drag above image to here": "Drag above image to here", "Disabled": "Disabled", "Vary (Subtle)": "Vary (Subtle)", "Vary (Strong)": "Vary (Strong)", diff --git a/modules/util.py b/modules/util.py index 4f975bf5ca..8317dd5049 100644 --- a/modules/util.py +++ b/modules/util.py @@ -494,7 +494,8 @@ def get_image_size_info(image: np.ndarray, aspect_ratios: list) -> str: recommended_gcd = math.gcd(recommended_width, recommended_height) recommended_lcm_ratio = f'{recommended_width // recommended_gcd}:{recommended_height // recommended_gcd}' - size_info += f'\nRecommended Size: {recommended_width} x {recommended_height}, Ratio: {recommended_ratio}, {recommended_lcm_ratio}' + size_info = f'{width} x {height}, {ratio}, {lcm_ratio}' + size_info += f'\n{recommended_width} x {recommended_height}, {recommended_ratio}, {recommended_lcm_ratio}' return size_info except Exception as e: diff --git a/webui.py b/webui.py index 7606e01035..25e57222a2 100644 --- a/webui.py +++ b/webui.py @@ -221,7 +221,7 @@ def ip_advance_checked(x): choices=[flags.desc_type_photo, flags.desc_type_anime], value=flags.desc_type_photo) desc_btn = gr.Button(value='Describe this Image into Prompt') - desc_image_size = gr.Markdown(label='Image Size', elem_id='desc_image_size', visible=False) + desc_image_size = gr.Textbox(label='Image Size and Recommended Size', elem_id='desc_image_size', visible=False) gr.HTML('\U0001F4D4 Document') def trigger_show_image_properties(image):