stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Long proccesing time with new High Res Fix

Open metzo007 opened this issue 2 years ago • 9 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

I noticed that the high rec options changed a lot, including a lot of new options like Hires steps.

I did play around but could not get any setting that worked, so I loaded a picture that I generated some time ago. So I found out that the default for Hires steps was 100. Everything else looked kind of link before.

Except, when I generate the picture now, it takes 2-3 min with the default Euler A 20 Steps.

The low res proccesing time takes 10 sec for a 512x384 picture.

I remenber that High Res Fix never did 100 steps before, but if I set it to 20 I get broken pictures ( merged faces & bodys )

So something in the new High Res Fix seems to be broken.

Steps to reproduce the problem

update Automacic1111 load an old picture with High Res Fix into text2img klick generate

What should have happened?

proccesing time should be 20 sec, instead of 180 sec

Commit where the problem happens

unknown. newest one

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

none

Additional information, context and logs

I am using google collab

metzo007 avatar Jan 11 '23 19:01 metzo007

Are you using one of the SwinIR upscalers? If so it generates 100 tiles when its run and this is what is taking so much time. Try RealESRGAN or ESRGAN

saunderez avatar Jan 13 '23 16:01 saunderez

Are you using one of the SwinIR upscalers? If so it generates 100 tiles when its run and this is what is taking so much time. Try RealESRGAN or ESRGAN

Upscaler is set to latent.

I would like to know what the High Res Steps do?

metzo007 avatar Jan 13 '23 17:01 metzo007

Hi Res steps is how many steps to do for the HiRes pass. For instance you might want to run 20 steps for the first pass and 50 for the HiRes fix because the resizing is going to remove all that detail anyway.

On Sat, 14 Jan 2023, 03:07 metzo007, @.***> wrote:

Are you using one of the SwinIR upscalers? If so it generates 100 tiles when its run and this is what is taking so much time. Try RealESRGAN or ESRGAN

Upscaler is set to latent.

I would like to know what the High Res Steps do?

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6654#issuecomment-1382145833, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVPV2OIANCHHMD4PU7GPW3WSGDVDANCNFSM6AAAAAATYNV2KA . You are receiving this because you commented.Message ID: @.***>

saunderez avatar Jan 13 '23 17:01 saunderez

but Hi Res steps is a new setting. What was the setting before?

My guess is, thas if you leave it alone, the high res steps = Sampling steps So if you leaf it a 0 is will still do the same high res steps as Sampling Steps

But as you can see below, now1 high res steps take 5x more time as a samplig step. It used to be the same.

40 sampling steps: 100% 40/40 [00:13<00:00, 2.94it/s] 40 high res steps: 100% 40/40 [00:56<00:00, 1.42s/it]

So anything above 512x512 is very time consuming right now. Something is broken.

metzo007 avatar Jan 13 '23 22:01 metzo007

Bring old Hires.Fix back and put this "new" buggy into img2img!

Centurion-Rome avatar Jan 14 '23 12:01 Centurion-Rome

The old method is still available, turn it on in the compatibility tab in settings and go back to what you were doing...

On Sat, 14 Jan 2023, 22:20 Jenar, @.***> wrote:

Bring old Hires.Fix back and put this "new" buggy into img2img!

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6654#issuecomment-1382725986, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVPV2M32BMZT7XQNMJMQ2LWSKK2LANCNFSM6AAAAAATYNV2KA . You are receiving this because you commented.Message ID: @.***>

saunderez avatar Jan 14 '23 12:01 saunderez

The old method is still available, turn it on in the compatibility tab in settings and go back to what you were doing...

Sadly It is not.

I did enable "For hires fix, use width/height sliders to set final resolution rather than first pass (disables Upscale by, Resize width/height to)."

But the outcome is the same. It just disables some sliders. But I found out that if I set the High Res steps to 20 the outcome is ok, while the proccesing time stays low.

Side question if I may Whats up with the upscaler in the High res tab?

I thought the high res fix works like this: A low low res imange is gererates first, and based on that a high res image is createt like in img2img.

But if a hig res image is fully generated, why do I need an upscaler?

metzo007 avatar Jan 14 '23 20:01 metzo007

Why are you setting hires steps so low? A lot of noise gets added to the image during the upscale process and I've always found it takes considerably more steps to clean it up. In the old method the only way to do this was to run a higher number of steps (was usually 50 in my usage)....the new way I run 20 steps on the low res pass and 50 steps on the high res and it saves a lot of time.

The upscaling in hiresfix isn't turning the low res pass to high res result. It's taking the low res pass, upscaling it to high res and adding noise and then cleaning that up with what is essentially IMG2IMG. The result is new image generated "natively" at high resolution by SD, which generates additional information not in the source image.

Upscalers don't have the understanding of image composition that SD has, they need to add more information but the best they can do is a guess. When there's too much information missing the guesses become less accurate and the upscaler produces artifacts.

On Sun, 15 Jan 2023, 06:09 metzo007, @.***> wrote:

The old method is still available, turn it on in the compatibility tab in settings and go back to what you were doing...

Sadly It is not.

I did enable "For hires fix, use width/height sliders to set final resolution rather than first pass (disables Upscale by, Resize width/height to)."

But the outcome is the same. It just disables some sliders. But I found out that if I set the High Res steps to 20 the outcome is ok, while the proccesing time stays low.

Side question if I may Whats up with the upscaler in the High res tab?

I thought the high res fix works like this: A low low res imange is gererates first, and based on that a high res image is createt like in img2img.

But if a hig res image is fully generated, why do I need an upscaler?

— Reply to this email directly, view it on GitHub https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6654#issuecomment-1382904824, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVPV2LYYYFD2GLJTMLLEJ3WSMBXJANCNFSM6AAAAAATYNV2KA . You are receiving this because you commented.Message ID: @.***>

saunderez avatar Jan 14 '23 20:01 saunderez

Hi,

thanks for the quick response

This is the reason for the Bug report. 20 Hi Res Steps it the max I can go, otherwise the prossesing time would be to long. One High Res Step takes 5 times longer than a low res step, so with 50 high res steps I have to whait 3 min per picture.

In the older Auto1111 there was no high res steps setting ( or it was hidden ), and the prossesing time was 30 sec. per picture.

Thanks for the explanation. So its: 1.low res 2.upscaling to high res 3."img2img" with the upscaled version

metzo007 avatar Jan 14 '23 21:01 metzo007

One High Res Step takes 5 times longer than a low res step, so with 50 high res steps I have to whait 3 min per picture.

In the older Auto1111 there was no high res steps setting ( or it was hidden ), and the prossesing time was 30 sec. per picture.

This has always been the case for me, a high resolution image takes exponentially longer to generate than one that is within the native size of the model. Try rendering an image at high resolution with hires fix disabled, I think you'll find it takes pretty much the same amount of time the high res pass takes.

saunderez avatar Jan 18 '23 04:01 saunderez

See and vote "Bring old Hires.Fix back": https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6725

Centurion-Rome avatar Jan 18 '23 10:01 Centurion-Rome