AUTOMATIC1111 / stable-diffusion-webui

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

Add suport for Real-CUGAN Upscaler #2340

Open Eljoseto opened 1 year ago

Eljoseto commented 1 year ago

Currently there is no way to use Real-CUGAN in the web UI, and it seems a decent alternative to R-ESRGAN.

I'd like to be able to select this Upscaler in the extras tab.

But I've tryed to drop the .pth in te RealESRGAN folder and it does not work. Currently I'm using Waifu2x-extension-GUI but I only use the Real-CUGAN upscaler, and the UI seems a bit cluttered.

Below are some examples comparing the original image with R-ESRGAN and R-CUGAN.

Original: Original Image-Euler a-70 steps-seed 1854224268-hash 11df8a9b-(512x960)

Upscaled with R-ESRAGAN: RESRGANx2-Euler a-70 steps-seed 1854224268-hash 11df8a9b-(512x960)

Upscaled with R-CUGAN: RCUGANx2-Euler a-70 steps-seed 1854224268-hash 11df8a9b-(512x960)_waifu2x_2x_3n_png

kybercore commented 1 year ago

Use custom trained ESRGAN models, there is plenty finetuned for Anime. Just drop them into the ESRGAN model folder. Imo there is no need for yet another upscaling architecture, there is already over 5 including an SD Native one and the rock solid BSRGAN and SWINR.

https://upscale.wiki/wiki/Model_Database

victorca25 commented 1 year ago

If you find any issues with the ESRGAN models from the database, try with the code in the PR: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/2067 which should allow all of the models to be used, any of the scales and modifications (as well as BSRGAN and real-ESRGAN).

Eljoseto commented 1 year ago

If you find any issues with the ESRGAN models from the database, try with the code in the PR: #2067 which should allow all of the models to be used, any of the scales and modifications (as well as BSRGAN and real-ESRGAN).

So, to add more models I should list them inside the realesrgan_model.py, following the same convention as the ones already there?

victorca25 commented 1 year ago

No, just drop them in the /models/ESRGAN/ directory in stable-diffusion-webui and you can use them from the interface after a restart

dtlnor commented 1 year ago

If you find any issues with the ESRGAN models from the database, try with the code in the PR: #2067 which should allow all of the models to be used, any of the scales and modifications (as well as BSRGAN and real-ESRGAN).

CUGAN doesn't use ESRGAN's architecture, but waifu2x's architecture. So the generic ESRGAN script is not able to read it.

dtlnor commented 1 year ago

I don't think cugan is a good upscaler for generated result. cugan is designed for the picture full of artifact like banding / blocking everywhere. It removes detail to keep the result clean and sharp. Unless you are generating some pictures with sharp lines and flat color. Its better to use some upscaler that keep or even increase details.

ClashSAN commented 1 year ago

Real-Cugan support should be added, just reopen this if not