-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Add Upscale by
and Upscaler
options to img2img
#7931
Add Upscale by
and Upscaler
options to img2img
#7931
Conversation
Upscale by
and Upscaler
options to img2img
Oh man, I just noticed yesterday that this didn't exist and wondered why. |
lets get this approved and I have some ideas how to fix it the trick I am thinking is to create a hidden field and a dummy slider then with JavaScript you can attach an on change event listener on the dummy slider and dispatch the event passing it to the dummy field to update the value (the dom range change event is different from gradios custom event change, it dispatches the value when you release the slider not when you drag it) |
If the performance is bad then let's not merge this in. If the bad performance us caused by sending in the image for resize from/to text, then let's just ditch the text - it was needed for hr upscale because people were confused, it's not strictly needed here. As for upscaler selection, what will happen if you choose |
I think the issue with the gradio controls that dispatch only input events are causing performance issues everywhere and are not specific to webui in the ui e.g quicksettings, hires.fix when you upscale by, you can notice the flashing, so many requests just to return the calculated size. I manage to implemented a workaround for all the number fields, and range sliders of the ui to dispatch only on change of the event we need a more solid approach for all the interactive components unfortunately gradio close this like it was a small think it is not only the sliders that are affected but all the input fields as well they need to change and rethink about the architecture of their components until then if we want better components we need to hack them around |
The bad performance is caused by gradio, specifically the slider change event running on every mouse movement. If you could bump gradio's version past 3.20.0 then it could be fixed |
gradio only fixed the slider drag-release, this is lame the issue is present on every field if you use the input arrows from the slider to adjust the value same issue there even if bump gradio's version just checked it this fix was a joke i will reopen the issue there somebody has to explain them that this is an important issue affecting all applications |
Oh I see, filed an issue here gradio-app/gradio#3443 And you're welcome! |
7106f86
to
dbee0a3
Compare
What will happen if you choose latent upscale, corp and resize option, 512x512 resolution and a 1024x512 source image? |
dbee0a3
to
75e7eb9
Compare
Ran across an issue when copying the result image to other img2img tabs, appears to be this Gradio bug: gradio-app/gradio#3623 |
Can't wait this PR to be merged! |
I just tried to incorporate this PR into my local version, which is the stable version 2 weeks ago. It seems that some libraries like Releaseable in gradio are not available. |
|
I jumped the gun again and merged this without much thought. I'm reverting it but unfortunately there's no way for me to un-mark this PR as merged. Here's my list of grievances with it:
|
Disagree, I've found it useful almost every time I've used it, I use the output resolution as a mental note of how much memory the operation will take, I don't see why not have an equivalent in img2img, it's the same featureset as HR fix but on a different tab. With an "upscale by" slider I'm always going to want to do the mental calculation of the output resolution anyway About the rest, I'd be willing to fix the UI to be more to your preferences, although I use a large screen and don't have issues. |
The "resize to" text can be hidden in the case of Upscale By not being used, in that case it's redundant info |
Thanks for the work and I have just tested it out, here I want to share my humble opinion and suggestion:
|
|
Thanks for the feedback. I think auto's working on some improvements I'll test out shortly The saga continues in #9108... |
…/img2img-enhance"" This reverts commit 433b3ab.
…/img2img-enhance"" This reverts commit 2a0e0bc.
…ace-nuko/img2img-enhance""" This reverts commit 760a7fe.
…from space-nuko/img2img-enhance"""" This reverts commit c80f7db.
…ace-nuko/img2img-enhance""" This reverts commit 2b25c28.
…/img2img-enhance"" This reverts commit 2a0e0bc.
…ace-nuko/img2img-enhance""" This reverts commit 760a7fe.
Describe what this pull request is trying to achieve.
Adds "upscale by" and "upscaler" options to img2img, with the same functionality as Hires. fix
Closes #7422
Additional notes and description of your changes
"Upscale by" is disabled by default, it only takes effect if the slider's value is > 1. Otherwise the old behavior is used
Infotext and XYZ Grid support was also added
The "Just Resize (latent upscale)" resize mode was removed since it's now redundant
Non-latent upscalers are run before sampling, latent upscalers are run later during sampling
Sadly performance is bad because the event callbacks are run every time the sliders update and not when they're released, this is the corresponding gradio issue: gradio-app/gradio#3204No longer an issue since webui uses Gradio 3.23.0, can use their.release()
callback nowEnvironment this was tested in
List the environment you have developed / tested this on. As per the contributing page, changes should be able to work on Windows out of the box.
Screenshots or videos of your changes