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

Automatically Set the Scale by value when user selects an Upscale Model #15244

Merged
merged 3 commits into from Mar 16, 2024

Conversation

Haoming02
Copy link
Contributor

@Haoming02 Haoming02 commented Mar 13, 2024

Description

Edited

What you're trying to accomplish
Since the majority of the upscale models are named with its scaling factor (eg. 4x-UltraSharp or DAT x2), this PR makes it automatically set the appropriate Scale by value when user selects a model with that pattern.

A summary of changes in code
When setting up the UI, add a function that utilizes the gradio input method to check for the above condition via re, then set the value if possible. This feature is toggleable in the Settings.

Checklist:

@Haoming02 Haoming02 changed the title add hook Automatically Set the Scale by value when user selects an Upscale Model Mar 13, 2024
@w-e-w
Copy link
Collaborator

w-e-w commented Mar 13, 2024

this behavior is controversial some might find it useful others might find it annoying, there must be an option to toggle this behavior
I don't know whether the default should be enabled or disabled, (some might like it, but I personally would find this annoying)

... pattern of [scale]x[name/architecture] ...

while that may be true for modues downloaded from OpenModelDB, but I think none of the models we provide by default follow this pattern, I think the match pattern should be more general

@catboxanon
Copy link
Collaborator

I agree with w-e-w. The intent behind this PR makes sense, but frankly most users aren't going to care what upscale factor the model was trained on, and are going to want to upscale an image by the factor they desire.

Now supports all natively provided upscaler as well
Now this is disabled by default
@AUTOMATIC1111 AUTOMATIC1111 merged commit afb9296 into AUTOMATIC1111:dev Mar 16, 2024
3 checks passed
AUTOMATIC1111 added a commit that referenced this pull request Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants