stable-diffusion-webui
stable-diffusion-webui copied to clipboard
GFPGAN not working as it should based on previous use
Describe the bug I used GFPGAN quite a bit before SD came around so I'm familiar with it's 'look'. Somehow its never quite looked right to me in Web-ui So I thought I'd try and figure it out. Based on GFPGAN v1.4 - Here's the findings.. To Reproduce I loaded a small 256x256 face into Extras, Set the resize to 4 and none as an upscaler, and turned GFPGAN up to 1. I would expect it to do a basic resize and apply GFPGAN and produce a picture of 1024x1024 - which it does - but if you look around the picture you'll see that it's pixelated (The hair, forehead skin detail and teeth are good tells)
Now. If I loaded a small 256x256 face into Extras, Set the resize to 1 this time and none as an upscaler, and turned GFPGAN up to 1. And edited gfpgan_model.py line 39 upscale= and set that to 4 - then restart SD I would expect it to do a basic resize but this time using the setting in gfpgan_model.py and apply GFPGAN and produce a picture of 1024x1024 - which it does - but if you look around the picture you'll see that it's not pixelated like before
This is what I'd expect as a correct result.
Desktop (please complete the following information): Win 10 Browser Chrome/Edge version ab3f997c0c4a1423a82623ae1d4d3c66005bb8da
I've noticed something similar. Sometimes you can see a hard straight horizontal line where the pixilation ends, usually through the top of the hair.
I've noticed that too cvar66, think that is a direct gfpgan 1.4 issue- it's a pain when doing thin plate spline upscales
For the main issue above I'm thinking its an order of operations issue If I put the 256x256 in and set resize to 4 with it set to none for upscaler and no gfpgan and then take the resulting low quality 1024x1024 image and then put that in, with resize set to 1, none for upscaler and gfpgan set to 1
I get the correct 1024x1024 high detail result.
256x256
resize 4, none for upscale, no gfpgan = 1024x1024 result
result 1024x1024 resize 1, none for upscale, gfpgan set to1
Fixed in PR #3874 as far as the extras tab goes, still needs fixing when using highres.fix