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

[Feature Request]: img2img - upscale the image by 200% before running it shows improvement

Open 1blackbar opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

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

What would your feature do ?

I noticed that you get noticeably better detail when you just upscale image to 200% before doing img2img to fix the faces, heres ezamples

Original image, no idea who the guy is , untouched 512res output faceforg

So sending to inpaint , masking face to upscale it with full resolution enabled gets you this fafix1 Still pretty uncanny so.... heres the fix, just upscale it manually to 1024 ! So i just upscaled it original 512 image to 1024 and opened in img2img, then ran full resolution again on face masked to upscale it fafixhand

Proposed workflow

As You see, there is improvement, you can also restore hand like this, original 512 image just works worse at original scale when doing img2img compared to upscaled one and its something we can use to our advantage maybe even for full image upscales not just the heads . So what id propose is this , but maybe there coud be easier and smarter way about it

  • under the hood when we run img2img or inpaint please scale the image by 200% always to immitate manual upscale that i did , so we can get better details , Then run img2img on it , when isynthesizing is done on 200% upscaled image just scale the image back under the hood to original 512 res (or even keep the 1024 res if we wish)

I think this is worth consideration, try it out yourself, just manually upscale your image by 200% and reimport it to inpaint.

This is cumbersome tho and it would be great if the upscale woud happen under the hood

Additional information

No response

1blackbar avatar Nov 11 '22 01:11 1blackbar

Most models are trained with 512x512, inpaint with full-res (in your case inpaint part becomes 512x512) got sufficient size already. Yeah, the 200% one is more like somebody but I don't think it is an improvement to the 100% one (well idk what yr prompt is. your result could be a "random" outcome which just looks better). (or if you could provide more cases, not from cherry-picking the result)

dtlnor avatar Nov 11 '22 05:11 dtlnor

Oh thats interestin,g can you show a comparison proof that 200% upscaling doesnt improve the end result ? I get better result pretty much everytime i do 200% image

2blackbar avatar Nov 11 '22 17:11 2blackbar

Did you use the same seed in both results?

MarcusAdams avatar Nov 20 '22 02:11 MarcusAdams

Did you use the same seed in both results?

@MarcusAdams its meaningless to keep the same seed at different resolution. As they will generate different noise pattern

dtlnor avatar Nov 20 '22 08:11 dtlnor

Did you use the same seed in both results?

@MarcusAdams its meaningless to keep the same seed at different resolution. As they will generate different noise pattern

Did you repeat the test multiple times then?

MarcusAdams avatar Nov 20 '22 22:11 MarcusAdams