hollowaykeanho / Upscaler

A consolidation of various compiled open-source AI image/video upscaling product for a working CLI friendly image and video upscaling program.
BSD 3-Clause "New" or "Revised" License
251 stars 20 forks source link

Proper Image Got into Faulty Mosaic Effect after Upscaled #63

Open cherrynoize opened 7 months ago

cherrynoize commented 7 months ago

Really appreciate someone putting some effort into a CLI version for this. I would love to work on some PRs myself but I just don't have the time right now.

So at least I would like to point out that there's some issues with saving the output image, as by default with param --input image.jpg I would get an error for it tries to save to image.jpg/image-upscaled.jpg (which is clearly not what's expected). Specifying --output per se does not solve the issue but I found that --input ./image.jpg --output ./image-upscaled.jpg (and probably omitting output too) works around the issue. Though it does seem to ignore the --output param completely.

More importantly though:

111044966_p0_master1200-wm_rm 111044966_p0_master1200-wm_rm-upscaled

I get this.

Input is:

upscaler \
                                                  --model upscayl-ultrasharp \
                                                  --scale 2 \
                                                  --input ./111044966_p0_master1200-wm_rm.jpg \
                                          --output ./111044966_p0_master1200-wm_rm-2x.jpg

I would love for this to work properly so I could implement it in my dotfiles to auto upscale wallpapers so I could keep them in a more reasonable format until needed. Maybe it's the model? I'll try different ones now.

Also sorry for making this all a single issue. Maybe I should have made two.

cherrynoize commented 7 months ago

I get the same result using upscayl-realesrgan-x4plus-anime too.

hollowaykeanho commented 7 months ago

So at least I would like to point out that there's some issues with saving the output image, as by default with param --input image.jpg I would get an error for it tries to save to image.jpg/image-upscaled.jpg (which is clearly not what's expected). Specifying --output per se does not solve the issue but I found that --input ./image.jpg --output ./image-upscaled.jpg (and probably omitting output too) works around the issue. Though it does seem to ignore the --output param completely.

Hi @cherrynoize , sorry for the buggy powershell scripting. As a matter of fact, I am working on it but in a separate project repository (since it's rare to find a tested posixshell+powershell standard library). Appreciate your patience.

FYI, next release would be the last one using Shell script wrapping method as I will personally go into the C & C++ codes to make everything scratch.


111044966_p0_master1200-wm_rm-upscaled I get this.

This can be caused by 2 issues:

  1. The input image has an AI poisoning data in it.
  2. Model faulty. You can choose other model. I personally use upscayl-nmkd-4x-superscale-sd-178000-g (next release or git clone the repo), upscayl-remacri, upscayl-ultramix_balanced, and lastly upscayl-ultrasharp-v2.
Joly0 commented 6 months ago

Really appreciate someone putting some effort into a CLI version for this. I would love to work on some PRs myself but I just don't have the time right now.

So at least I would like to point out that there's some issues with saving the output image, as by default with param --input image.jpg I would get an error for it tries to save to image.jpg/image-upscaled.jpg (which is clearly not what's expected). Specifying --output per se does not solve the issue but I found that --input ./image.jpg --output ./image-upscaled.jpg (and probably omitting output too) works around the issue. Though it does seem to ignore the --output param completely.

Hm, that is really odd behaviour. I´ll look into it and try to fix it :)

cherrynoize commented 6 months ago

That would be great. BTW, I thought I had answered to @hollowaykeanho mentioning I wasn't on Windows so I didn't think any powershell scripting would be the issue here.

Joly0 commented 6 months ago

That would be great. BTW, I thought I had answered to @hollowaykeanho mentioning I wasn't on Windows so I didn't think any powershell scripting would be the issue here.

So you arent running this on windows but on linux? If yes, then this is not an issue for me, but for @hollowaykeanho

uq1 commented 6 months ago

I am having the same issue with the squares being random in the image. It does not happen on every run, but it seems to happen a lot.

I have tried about 6 models and they all seem to do the same thing, so it does not seem to be a model issue.

Image poisoning is somewhat impossible as these are textures from a 20 year old game.

Could this simply be some issue in the image save function? The squares in the image look ok, just not in the right location in the over-all picture.

Here's another example: aurora2_upscaled

hollowaykeanho commented 6 months ago

Could this simply be some issue in the image save function? The squares in the image look ok, just not in the right location in the over-all picture.

Here's another example: aurora2_upscaled

Wow. This is definitely the first case I've seen. @cherrynoize, and @uq1, can both of you send me a the original image to be included in the test suite please? I will analyze it.

@Joly0, no worries. Please work on the parallel execution task ya. =) I will triage the case.

Apologize for this the late responsiveness. Am currently involved in a client's project. Will patch the software in and out.

uq1 commented 6 months ago

No problems, here's the original.

aurora2

uq1 commented 6 months ago

FYI: I just upscaled the same image again and this time it worked fine. The original was being called through a game, while this time I tried it just from command prompt. Could other processes CPU/GPU usage be affecting it?

I hope this insight helps.

hollowaykeanho commented 6 months ago

@uq1 , not an issue here. It should lower level like drivers or hardware. I'm incline to former.

sample-03_upscaled

hollowaykeanho commented 6 months ago

Yeah... same case for the Ubuntu (I'm on Debian). It should be related to either model or low level driver before we arrive to hardware (@uq1 , your case is very unlikely a hardware problem). Ubuntu is known for heavy modifications for better user experience.

sample-04_upscaled

hollowaykeanho commented 6 months ago

Help wanted to further root cause the problem. In the meantime, I do what I can to provide workaround for this weird bug.

DrBrule commented 4 months ago

I'm seeing the same issue but only with certain partially AI-generated video. I've tried many of the models, and for certain input sources it always makes a mosaic. The generated AI images are fine looking - I had hoped to improve them 2x, but when I try to upscale them they come out mosaic'ed.

PedCoelho commented 3 months ago

@hollowaykeanho For me this happens with videos and only on -scale 2 but not on -scale 4.
@cherrynoize Try calling the script with -scale 4 as a parameter. Upscaling model of choice didn't seem to matter. I'm assuming it's a bug related to the scaling factor.