feat: add translation for image size describe (#2992)
This commit is contained in:
parent
7b70d27032
commit
04f64ab0bc
|
|
@ -9,9 +9,19 @@
|
||||||
"Advanced": "Advanced",
|
"Advanced": "Advanced",
|
||||||
"Upscale or Variation": "Upscale or Variation",
|
"Upscale or Variation": "Upscale or Variation",
|
||||||
"Image Prompt": "Image Prompt",
|
"Image Prompt": "Image Prompt",
|
||||||
"Inpaint or Outpaint (beta)": "Inpaint or Outpaint (beta)",
|
"Inpaint or Outpaint": "Inpaint or Outpaint",
|
||||||
"Drag above image to here": "Drag above image to here",
|
"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:",
|
"Upscale or Variation:": "Upscale or Variation:",
|
||||||
|
"Drag above image to here": "Drag above image to here",
|
||||||
"Disabled": "Disabled",
|
"Disabled": "Disabled",
|
||||||
"Vary (Subtle)": "Vary (Subtle)",
|
"Vary (Subtle)": "Vary (Subtle)",
|
||||||
"Vary (Strong)": "Vary (Strong)",
|
"Vary (Strong)": "Vary (Strong)",
|
||||||
|
|
|
||||||
|
|
@ -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_gcd = math.gcd(recommended_width, recommended_height)
|
||||||
recommended_lcm_ratio = f'{recommended_width // recommended_gcd}:{recommended_height // recommended_gcd}'
|
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
|
return size_info
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
2
webui.py
2
webui.py
|
|
@ -221,7 +221,7 @@ with shared.gradio_root:
|
||||||
choices=[flags.desc_type_photo, flags.desc_type_anime],
|
choices=[flags.desc_type_photo, flags.desc_type_anime],
|
||||||
value=flags.desc_type_photo)
|
value=flags.desc_type_photo)
|
||||||
desc_btn = gr.Button(value='Describe this Image into Prompt')
|
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('<a href="https://github.com/lllyasviel/Fooocus/discussions/1363" target="_blank">\U0001F4D4 Document</a>')
|
gr.HTML('<a href="https://github.com/lllyasviel/Fooocus/discussions/1363" target="_blank">\U0001F4D4 Document</a>')
|
||||||
|
|
||||||
def trigger_show_image_properties(image):
|
def trigger_show_image_properties(image):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue