pkuliyi2015 / multidiffusion-upscaler-for-automatic1111

Tiled Diffusion and VAE optimize, licensed under CC BY-NC-SA 4.0
Other
4.77k stars 334 forks source link

Setting upscaler to "none" doesn't scale up the image #201

Closed apinanaivot closed 1 year ago

apinanaivot commented 1 year ago

If you set the upscaler to "none", it doesn't rescale the image, but keeps it at the same size. This is not what should happen, it should still scale up the image using a non-neural network upscaling method (such as bilinear interpolation), like how Ultimate SD Upscale does for example. It's bad that scaling up the image only works with upscalers, as they often smooth out surfaces, making the resulting image less detailed.

PotatoBananaApple commented 1 year ago

Have you tried upscalers like:

4x_NMKD-Siax_200k 4x_NMKD-Superscale-Artisoftject_210000_G

apinanaivot commented 1 year ago

Have you tried upscalers like:

4x_NMKD-Siax_200k 4x_NMKD-Superscale-Artisoftject_210000_G

Yes, pretty much all AI upscalers are trained to remove noise, here is an example of the results I get with an upscaler, and without (by manually resizing the image in photoshop before using multidiffusion upscaler):

comparison

As you can see, while removing the noise, it also removed lots of details in the hair strands and other places, and overall made the image look less realistic.

It can't be a difficult addition to make the scale factor still work when setting the upscaler to none.

PotatoBananaApple commented 1 year ago

Hmm interesting.

technically you could use resize by and disable Keep input image size

image

image

apinanaivot commented 1 year ago

Hmm interesting.

technically you could use resize by and disable Keep input image size

No you could not, as this extension overrides that value (as it should)

PotatoBananaApple commented 1 year ago

I mean i tested it and it did upscale. 🤔

pkuliyi2015 commented 1 year ago

If you set the upscaler to "none", it doesn't rescale the image, but keeps it at the same size. This is not what should happen, it should still scale up the image using a non-neural network upscaling method (such as bilinear interpolation), like how Ultimate SD Upscale does for example. It's bad that scaling up the image only works with upscalers, as they often smooth out surfaces, making the resulting image less detailed.

Please select Lanczos manually. Ultimate SD Upscaler switches to Lanczos silently when you choose None.

However, I don't do such silent switching as them, because this extension is not only an upscaler, in many cases I use it to fix the face or hands. And it will be inconvenient when I don't want to change the size of the photo (I have to write several more lines of code, and slide the scale factor to exactly 1 when I use. More difficult than just switch to None).

apinanaivot commented 1 year ago

If you set the upscaler to "none", it doesn't rescale the image, but keeps it at the same size. This is not what should happen, it should still scale up the image using a non-neural network upscaling method (such as bilinear interpolation), like how Ultimate SD Upscale does for example. It's bad that scaling up the image only works with upscalers, as they often smooth out surfaces, making the resulting image less detailed.

Please select Lanczos manually. Ultimate SD Upscaler switches to Lanczos silently when you choose None.

However, I don't do such silent switching as them, because this extension is not only an upscaler, in many cases I use it to fix the face or hands. And it will be inconvenient when I don't want to change the size of the photo (I have to write several more lines of code, and slide the scale factor to exactly 1 when I use. More difficult than just switch to None).

Thanks for the response and tip! I guess it's just a bit confusing that they work differently, maybe there could be an option called "don't upscale" in addition to "none", and "none" would still upscale the image for the sake of clarity and consistency.

pkuliyi2015 commented 1 year ago

Thanks for suggestions. I will change the option names for clarity in my spare time.

andupotorac commented 1 year ago

If you set the upscaler to "none", it doesn't rescale the image, but keeps it at the same size. This is not what should happen, it should still scale up the image using a non-neural network upscaling method (such as bilinear interpolation), like how Ultimate SD Upscale does for example. It's bad that scaling up the image only works with upscalers, as they often smooth out surfaces, making the resulting image less detailed.

Please select Lanczos manually. Ultimate SD Upscaler switches to Lanczos silently when you choose None.

However, I don't do such silent switching as them, because this extension is not only an upscaler, in many cases I use it to fix the face or hands. And it will be inconvenient when I don't want to change the size of the photo (I have to write several more lines of code, and slide the scale factor to exactly 1 when I use. More difficult than just switch to None).

Are you using it with ADetailer for fixing the hands and face?

andupotorac commented 1 year ago

Hmm interesting. technically you could use resize by and disable Keep input image size

No you could not, as this extension overrides that value (as it should)

See this: https://www.reddit.com/r/StableDiffusion/comments/y2mrc2/the_definitive_comparison_to_upscalers/.

For illustrations, there's a better one that he didn't tests (I checked Ultrasharp too). The best option to keep an image the same is to use 4x_foolhardy_Remacri with 0 denoise strength.

image

Attached examples so you can check the comparison (look at the nose):

  1. 4x_foolhardy_Remacri_0 denoise 1  4x_foolhardy_Remacri_0 denoise

  2. realesr-general-wdn-x4v3_0 denoise 2  realesr-general-wdn-x4v3_0 denoise

  3. ESRGAN_4x_0 denoise _3  ESRGAN_4x_0 denoise

  4. R-ESRGAN 4x+ Anime6B_0 denoise 4  R-ESRGAN 4x+ Anime6B_0 denoise

  5. LDSR_0 denoise 5  LDSR_0 denoise

  6. 4x-UltraSharp_0 denoise 6  4x-UltraSharp_0 denoise

And here you see Tiled Upscaling applied to #1 for better details. https://imgur.com/P6lKpbY