Skip to content

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

Merged
AUTOMATIC1111 merged 3 commits into
AUTOMATIC1111:devfrom
Haoming02:auto-scale-by
Mar 16, 2024
Merged

Automatically Set the Scale by value when user selects an Upscale Model#15244
AUTOMATIC1111 merged 3 commits into
AUTOMATIC1111:devfrom
Haoming02:auto-scale-by

Conversation

@Haoming02

@Haoming02 Haoming02 commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

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

w-e-w commented Mar 13, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
AUTOMATIC1111 added a commit that referenced this pull request Mar 16, 2024
ruchej pushed a commit to ruchej/stable-diffusion-webui that referenced this pull request Sep 30, 2024
@Haoming02 Haoming02 deleted the auto-scale-by branch November 26, 2024 08:21
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.

4 participants