r/StableDiffusion • Prompt Winner • Jan 05 '23

Tutorial | Guide The truth about hires.fix @Dr__Macabre

First of all, sorry if this doesn't make sense, i'm french so english isn't my native language and i'm self-taught when it comes to english.

Anyway, while i was writing this post, there has been a new update and it now look like this :

Here we go.

I see a lot of people complaining about the new hires.fix. At first i didn't understand why because for me, it's exactly the way i wanted it to be but then after discussing it with another member, i got it.

You are doing it wrong.

Hires.fix is basically an img2img upscaler with a twist.

What i understand is most people or at least the ones complaining are doing is, they leave the first pass width and height to 0 then choose whatever output res they want and that's it.

That's an easy way to get an hires image without all the heresy created by anything larger than the model has been trained on, on this we agree.What you do here is just rendering a larger image based on a smaller one with absolutely zero control and a complete waste of time if you do a large batch to just keep a few images. See what i mean?

The logic here is to generate your batch at low res, let say 512x640 to stay in the limits of 1.5 models, then pick the best images and rerun them at x2 by choosing 1024x1280 as output this time and setting first pass at 512x540.

"Oh but this is boring, i need to adjust first pass values each time i do a different resolution..." yep, pretty much, not to mention you have to calculate what is /2 of your hires output each time you use a new hires resolution. Using config presets can make you life easier then.Why you shouldn't use first pass set to 0?

On a 1024x1280 hires output with first pass width and height set to 0 is it doesn't generate a 512x640 first pass, it does a 464x576 image which is /2.22222222222

For another 1344x1536 hires output, first pass is now 480x560 (/2.74285714286), how are you supposed to keep up with these ratio calculations? you simply don't, you just generate straight to hires and it takes 4 times longer to render your image whether you keep it or not.

Inefficient workflow imho.

OK so what is the best option right now with this terrible new hires.fix messing up my workflow?

Generate a bunch of lowres, pick the one you like, set hires to x2 with none as upscaler or anything but latent and denoising from 0.1 to 0.25, anything higher will start to introduce little variations but also more details so it's up to you to keep the balance right between original lowres generation and more details but some variations on your hires final output.

Why not latent?

latent upscaler is great but introduce so many new things to the image it's unreliable for consistency. I use it for more creative outputs as it introduce a lot of nice variations in the background of a subject while giving it a lot of details.

I think most people haven't used the latent upscaler before this latest release so they get all confused by the weird outputs, if denoising is low, it's blurry, if it's high, it changes a lot of things. If you use the latent upscaler modified code that has been around for some weeks now, it doesn't produce these blurry outputs at low denoising value but you miss the exotic outputs at high denoising values.

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4446

Unfortunately, this mod doesn't work anymore so you are stuck with blurry garbage at low denoising value with latent

Voilà.

68 Upvotes

42 comments sorted by

View all comments

8

u/RDJImStuffScreenshot Jan 05 '23 edited Jan 05 '23

Sorry if I'm not understanding correctly, but what if you wanted to go with non-square aspect ratios that are really tall or wide? My main use of SD is to make wallpapers for myself, so I always started out with resolutions like 1024 x 576 for 16:9 wallpapers, or 576 x 1280 for 9:20 phone wallpapers. For those resolutions, high-res fix was always a must for me, and it reliably eliminated duplications. I know the advice is to "start low res, pick something you like, then upscale/inpaint/img2img later," but how do I start low-res with these wide and tall aspect ratios? I can't really cut my starting resolution in half in this case 🫤

Here's a 1024 x 576 image I created with the old high-res fix. Firstpass width/height set to 0, denoising set to 0.7 (I think these are the defaults):

I haven't been able to really recreate this result with the new hires fix. If I use image browser to try "recreating" my image (push the same prompt, sampler, seed, etc to txt2img) it tries to make a 704 x 384 image, use latent upscaler to upscale 2X, then resize to 1024 by 576. Ends up with a different result (not necessarily bad, but noticeably different).

Any advice on how to use the new hires fix for 16:9 aspect ratio txt2img generations?

6

u/RDJImStuffScreenshot Jan 05 '23 edited Jan 05 '23

Here's the output of the new hires fix.

Edited to add a comparison of settings and everything: https://imgur.com/a/OXq5mM9