-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
[Bug]: hires fix stopped working #6219
Comments
Same in 8d12a72 |
Hi, same here, and lately, I was using https://github.com/Kahsolt/stable-diffusion-webui-sonar which gives really good results, but after last commit it stopped wok showing this issue : |
I think you should go and log that on the other repo. I don't get the errors you mentioned, and different image results to your examples, so I'm not convinced it's the same problem. This is with commit fd4461d |
it same problem with highres.fix like you @GalaxyTimeMachine mention but i am also using sonar script with was written for previous highrest.fix - as you seee in console issue right now there is no "firstphase_height" in new highres.fix |
|
If anyone wants a temporary fix, you can switch to the last working branch using:
To change back:
|
I tried that, but the images are then completely different to what they used to be. All you're doing is creating a low res image and upscaling it, that's not the same as hires fix. |
Thx @GalaxyTimeMachine after rollback - higresfix works perfect |
I didnt use img2img if that's your question I set some prompt, set a constant seed, enabled Hires. fix, generated 1024x1024 in the version fd4461d got the result. |
Tried it with "Euler a"? You'll get a different image every time you change the initial size. They won't (shouldn't) be the same. Mine aren't with most, if not all, samplers. |
Checked "Euler a", same results are you sure your Upscaler type in Hires. fix matches as same as in Settings? |
Where in settings? This is for txt2img, not img2img. |
|
The results are still different versions of a similar image. |
just checked, non-square pictures are not the case either, still got same pictures on both versions |
Could an option be added to use the old system? The new system's odd multipliers seem to give me strange outputs now. I also didn't always upscale width and length by the same amount, but the new system forces the same upscale on both axes. So I can't recreate old images the same way. |
I looked at your settings and I already understanding your problem, your initial values of the first pass are 0 and 0, which means default values, which means 512x512 values (to match almost all trained models base resolution), therefore in your case the picture was matched the hires size and then the edges just got cut off, from this you get a different results, in fact your GPU basically doing useless work, because it generates something that is not then used |
Interesting, thanks! Would that mean there is no way to replicate the original image with the latest changes? I'd say that still needs fixing. |
That was spot on! I just re-ran the original prompt, in fd4461d, using passes of 384x512 and I now get the same image as I would in the latest master. |
As far as I understand the old hires-fix always used img2img upscaler from the settings, but it was missing from PNG info. It's good that it is added into PNG info now. Also, it's good that upscaler can be easily changed from hires-fix. |
If something needs to be changed, then I prefere to make inside Hires. fix |
Agree, why not save the low and the high resolutions as it was before?! That way all the settings are well defined, without the need to convert values with a multiplier. The multiplier can be saved as an additional value, although it is redundant, unless they can mismatch. And backward compatibility is needed. |
sorry I'm a total newbie to this. Where do I need to type that? Thanks <3 |
well, can you not just create the base 512x512 image with the same image prompt? could you try that and see if it generates different images? |
@Flonixcorn I dont want to rollback this Hires fix new feature, or make a separate compatibility button, while we can just complete this feature so that everyone will be happy. Currently this feature has 2 main problems (specifically talking about the multiplier):
And this is A BIG DEAL, because the models (checkpoints) are designed to generate firstpass layer as it was conceived by the creator of the model, means SQUARED (In most cases 512x512).
Although rounding up to 8 is implemented there, the values still turn out strange, which cannot be set in the usual step (64x), unless you manually change the step value into The best solution in my eyes is make it like this #6219 (comment) which will keep new feature (firstpass resolution replaced by target resolution, swapped) as well as make everyone happy (with having a backward compatibility) |
Very true, i also liked the old one, and a compability would be nice |
Apparently, the old upscaler was ESGRAN? |
My images generated with highres. fix are identical to how they were before and after this rework. I'm not sure how numerous people are running into issues with this. |
@stysmmaker
I also had no problems with new version, just adapted all settings to the new ones, and successfully continued to generate. So whats the problem?In simple words, for non-square pictures, for example, people want something like: 512x512 -> 768x1024, but now they dont have the opportunity to make 512x512 -> 768x1024, only 384x512 -> 768x1024, which I think you understand that cause the result different, but it wouldnt be the end of the world, like adapt to a new one, if it werent of HOW DIFFERENT this result is (basically just awful). For them, it doesnt matter that firstpass layer image was cropped (its also generated in seconds, not a big deal), the main thing that they care is that the firstpass layer image is generated correctly. Why exactly 512x512?Because models have been trained for this specific values and produce best result at this specific resolution (there are also 768x768 models) The solution I would like to see #6219 (comment) replace but it will not be so easy, because for example parameter like |
That's a fair compromise I think, even if I do vastly prefer the For the record, voldy/AUTOMATIC has stated before he does not bother checking issues/discussions, so if you want his attention someone will have to make a PR. |
If I knew python, I would have done PR at this point, but well, we will probably wait for someone who can do it a hundred comment, god damn |
After some testing, I believe the Latent upscaler was the default upscaler for "old" hiresfix. |
Seems to happen to me on any model. That was wavymulder modelshoot, but it happens on base 1.5 for me even. I did a fresh git clone too after wiping everything. |
Could you try this interface and test, if it also returns garbled images? I then switched to "beta" internally, in the UI configuration, and re-ran that UI, to install everything (there's more functionality in beta). |
Hello everyone 🍭 , we know this is how hires.fix actually works: For the legacy
Now it becomes like this:
# modules/shared.py
latent_upscale_default_mode = "Latent"
latent_upscale_modes = {
"Latent": {"mode": "bilinear", "antialias": False},
"Latent (antialiased)": {"mode": "bilinear", "antialias": True},
"Latent (bicubic)": {"mode": "bicubic", "antialias": False},
"Latent (bicubic antialiased)": {"mode": "bicubic", "antialias": True},
"Latent (nearest)": {"mode": "nearest", "antialias": False},
} Hence it depends how your old pictures are upscaled, if
these settings would possibly regrettably unreproducible in the latest commit... If to try to get old results back, remember this setting mapping:
|
@Kahsolt I like new method, its much more understandable, and in code way is simpler, but I also understand a problem this issue has, and I dont want to roll back anything, just want to modify what is already there, to make it done that everyone will be happy. New method has only one serious drawback, and this is lack of the creation of a SQUARE firstpass layer image (for which all models was trained and generate best results for this specific ratio) for a NON-SQUARE upscaled image. What we have now:
What we want to see (what will fix this issue):
So whats the difference? Well, people will be able to manage different ratios for different layer passes (which will return full backward compatibility) The difference seems not that big, but on code level, there is alot, even the crop method needs to be returned. |
@Kahsolt |
Well, I guess it got fixed, in a really interesting way... |
Anyone who tried and survived it, please share! |
WebUI used to force you to work backwards. Width and Height were previously the dimensions of the final canvas. You mean like every other part of the UX where you put in the image size you want? txt2img, img2img, inpainting, and everywhere else you set the targets to be the final image size you want. @EdHerdman This lunacy is like having to put in a random canvas size in txt2img and putting in a scale amount to get your final canvas size. The argument of GPU compute time being "wasted" on generating the 512x512 image to be cropped in the old way is just as ridiculous. Oh no, I lost < 0.76 seconds generating this image due to unneeded GPU compute! The only other area that was different was working with the SD upscale script where you had to make tile sizes to generate instead of final canvas size. |
@DrMeo There are still supporters who do not think of "The argument of GPU compute time on generating the SQUARE initial image to be cropped in the old way is so ridiculous". They argue that:
No bother, this functionality comes back in recent commits ;) though with more confusing wired ui options... |
Now the implementation is like: if both "Resize width to" and "Resize height to" are 0:
use "Upscale by"
else:
if either "Resize width to" or "Resize height to" is 0:
adjust the other to match aspect ratio of "width/height"
resize while keeping aspect ratio to match the shorter side of "resize width/height"
crop if the longer side overflow and a more weird change in commit 99b67cf : # special case: the user has chosen to do nothing
if self.hr_upscale_to_x == self.width and self.hr_upscale_to_y == self.height:
self.enable_hr = False
self.denoising_strength = None
self.extra_generation_params.pop("Hires upscale", None)
self.extra_generation_params.pop("Hires resize", None)
return hence if the actual computed upscale factor is exactly |
I think I understand why this change was made -- ostensibly to support hires fix at native 768 (and other) models. But having to maths out the correct ratio or source/target image dimensions given the model native size is a bit much. Previously if I wanted a final resolution of 1024x768, I'd just enter that in. badda boom. That gets me the 'fix' - meaning generating a resolution closer to the trained image resolution of the model, by default of 512x512 to the entered aspect ratio- and then upscale appropriately to the input resolution. Now I need to know that my model is 512, maths it out that the smallest variation of resolution to 512x512 for my target resolution/aspect ratio is 640x448, and set my final resolution to be 1024x768. It's a bit much. Could not there be a way to enter the model native resolution (be it 512 or 768, etc) and have do the maths for me as it did previously? |
Hey guys. Hires.fix from txt2img stop wirkin for me today in Google Colab, but only for big target size res (832x1248). 1 New clean install, !git clone etc That's all. If the image is slightly smaller, around 1000px, then everything is fine. I assume that this may be due to the loading of the jpg preview to gradio.live. Anyway, changing the "JPG quality" in settings did not help. Should I create a new bug report because of this, or is it all related to this branch? |
Closing as duplicate of #6725 (probably should have been the other way around but I did not see this until now). The old functionality was restored shortly afterwards. See the wiki for more info. https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#hires-fix |
Is there an existing issue for this?
What happened?
Just updated to commit 4dbde22 and not getting good results. Exactly the same prompts, settings and seed are not giving the same as before, and I'm getting a lot of body horrors (double length bodies, 2 pairs of boobs etc).
I think it may be related to the hires fix. I'm making 1024x768 images and hires fix used to get rid of body distortions...it's not any more. No distortions with lower res images.
Steps to reproduce the problem
What should have happened?
Same image results as before this commit, when using identical prompts, models, settings and seeds.
Commit where the problem happens
4dbde22
What platforms do you use to access UI ?
Windows
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
Additional information, context and logs
No response
The text was updated successfully, but these errors were encountered: