AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.15k stars 26.41k forks source link

blending for esrgan like its currently for gfpgan #14

Closed 1blackbar closed 2 years ago

1blackbar commented 2 years ago

All is working well but i was wondering can you incorporate esrgan blending with original ? So we can move slider like with gfpgan and it would blend two images (original preupscale+pastupscale ran through esrgan) With bicubic or lanczos upscale blended with esrgan.Can a slider affect it in realtime in preview window? S you just render gfpgan at full strength and you blend with original one by moving the slider, so you dont have to resynthesize with gfpgan everytime you want less strength, it will save gpu , i believe this effect can be done by simply blending two images with opacity/blend of upscaled one adjustable in real time over original image. I assume you blend gfpgan with original one upscaled by lanczos ? Would this work in realtime tho ? So you would upscale with gfpgan and then move slider to alter how strong the blend should be and it would affect the image in realtime ? I belive gfpgan should be last step so esrgan wouldnt try to upscale the face on top of it., at the moment i think realsrgan sits on top of gfpgan and is upscaling the face making it look artificial again, thats why i think it should be below gfpgan in the pipeline.Face should look as natural as possible The styles ccan vary so much that you might only need just a tiny bit of upscale with gfpgan or realsrgan to get best result while on other cases you can go to the max, such process would benefit strongly from realtime preview. But maybe it would need separate "blend" slider and not just renamed strength?

For basic sharpening maybe this would be useful with slider ? https://www.analyticsvidhya.com/blog/2021/08/sharpening-an-image-using-opencv-library-in-python/#:~:text=To%20sharpen%20an%20image%20in,image%20that%20will%20undergo%20sharpening. So ther would be 3 sharpening/upscaling methods on one panel ( realsrgan layer, filter2d layer, and face restoration layer )controled by blending sliders

AUTOMATIC1111 commented 2 years ago

Blending multiple resize modes added in latest commit.