Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Reads the size and ratio of the image and gives the recommended size #2971

Merged
merged 4 commits into from
May 22, 2024

Conversation

xhoxye
Copy link
Contributor

@xhoxye xhoxye commented May 21, 2024

QQ截图20240521085617

@xhoxye xhoxye requested a review from lllyasviel as a code owner May 21, 2024 00:56
Copy link
Collaborator

@mashb1t mashb1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xhoxye thanks for contributing, will check this out in detail in a few hours. Please find one commend attached.

webui.py Outdated Show resolved Hide resolved
@mashb1t
Copy link
Collaborator

mashb1t commented May 21, 2024

@xhoxye I've applied some adjustments, please check again

@mashb1t mashb1t added the Size S small change, basically no testing needed label May 21, 2024
@mashb1t mashb1t added this to the 2.4.0 milestone May 21, 2024
@xhoxye
Copy link
Contributor Author

xhoxye commented May 22, 2024

Thank you very much for your help, although it is a little different from what I had in mind at the beginning, I initially wanted to recommend the standard size of SDXL

@mashb1t
Copy link
Collaborator

mashb1t commented May 22, 2024

@xhoxye thanks for the feedback, that's what i assumed in #2971 (comment) and what makes the most sense.
My reasoning was that people might train LoRAs with specific aspect ratios or bucketing with other resolutions, but when the base model isn't trained these aspect ratios aren't the best choice anyways.
Users can still decide to just choose another available aspect ratio.

@mashb1t mashb1t changed the base branch from main to develop May 22, 2024 18:43
@mashb1t mashb1t merged commit 302bfdf into lllyasviel:develop May 22, 2024
@xhoxye
Copy link
Contributor Author

xhoxye commented May 24, 2024

I modified the use of textbox to display information to facilitate the translation of titles
QQ截图20240524213242
QQ截图20240524213348
desc_image_size = gr.Textbox(label='Image Size and Recommended Size', elem_id='desc_image_size', visible=False)
size_info = f'{width} x {height}, {ratio}, {lcm_ratio}' size_info += f'\n{recommended_width} x {recommended_height}, {recommended_ratio}, {recommended_lcm_ratio}'
Why gr. Markdown doesn't show label?

@mashb1t
Copy link
Collaborator

mashb1t commented May 24, 2024

Will include it in a few hours. Please add a new PR to develop if you want to be the author, if not i'll just cherry pick from your branch.

csokun pushed a commit to csokun/Fooocus that referenced this pull request Jun 16, 2024
lllyasviel#2971)

* Add the information about the size and ratio of the read image

* feat: use available aspect ratios from config, move function to util, change default visibility of label

* refactor: extract sdxl aspect ratios to flags, use in describe

as discussed in
lllyasviel#2971 (comment)
lllyasviel#2971 (comment)

---------

Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: Manuel Schmid <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size S small change, basically no testing needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants