InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

Dark image after upscaling

Open ArDiouscuros opened this issue 3 years ago • 16 comments

Describe your environment

  • GPU: cuda, GTX 1660 Ti
  • VRAM: 6 GB
  • CPU arch: x86
  • OS: [Windows]
  • Python: [miniconda]

Describe the bug Image after upscale with realesrgan is very dark.

Additional context On my system it works if I set use_half_precision = False Should we take over precision value from main program?

        if not torch.cuda.is_available():  # CPU or MPS on M1
            use_half_precision = False
        else:
            use_half_precision = True

    def load_esrgan_bg_upsampler(self):
        if not torch.cuda.is_available():  # CPU or MPS on M1
            use_half_precision = False
        else:
            use_half_precision = True

ArDiouscuros avatar Oct 05 '22 18:10 ArDiouscuros

Which branch is this happening on?

lstein avatar Oct 05 '22 19:10 lstein

Found it during test of RC2 but it looks like the same general issue with my GTX 1660 and half precision.

ArDiouscuros avatar Oct 05 '22 22:10 ArDiouscuros

Thanks. Looks like an easy fix.

lstein avatar Oct 05 '22 23:10 lstein

Phooey. I omitted including the fix in rc4. I'll send you a comment when I make the relevant commit.

lstein avatar Oct 06 '22 15:10 lstein

Ok, if you checkout release-candidate-2 HEAD (not the tagged version), you'll find the proposed fix for the realesrgan issue.

lstein avatar Oct 06 '22 16:10 lstein

Ok, if you checkout release-candidate-2 HEAD (not the tagged version), you'll find the proposed fix for the realesrgan issue.

I am on commit 911c99f125b5e92a7e5bc9e36e185f473af07645 (HEAD -> release-candidate-2, upstream/release-candidate-2) run command !fix 000403.1.png -U 4 Still have dark output: image

Am I missing something? Started with command python scripts\dream.py --free_gpu_mem Autodetected full precision: >> Using more accurate float32 precision

ArDiouscuros avatar Oct 06 '22 17:10 ArDiouscuros

I turns out to be a challenging problem to fix, but I will work on it when the release is out.

lstein avatar Oct 09 '22 19:10 lstein

Confirmed the same:

Describe your environment GPU: cuda, GTX 1660 Ti VRAM: 6 GB CPU arch: x86 OS: [Windows] Python: [anaconda]

Additional context

  • Upscaling with DreamTextures in Blender (Based on Invoke) works correctly, tested with multiple image sizes. However they are dark when upscaled in InvokeAI

H445 avatar Oct 29 '22 02:10 H445

Similar issue here, images are very dark after upscale, except the bottom right corner for an unknown reason

Describe your environment GPU: cuda, GTX 1660 super VRAM: 6 GB CPU arch: x86 OS: [Windows] Python: [miniconda]

Additional context Fresh install from the main branch yesterday Example output and the upscaled version :

000008 2990360949 000008 2990360949 upscale

BastienX8 avatar Nov 01 '22 12:11 BastienX8

Having the same issue here, also on a 1660 (super) with 6gb VRAM, running on Linux Mint. Installed InvokeAI using the bundled install script.

MasterIO02 avatar Nov 18 '22 22:11 MasterIO02

Have you tried changing between --precision="float16" vs --precision="float32" ?

lstein avatar Nov 24 '22 18:11 lstein

Changing to precision float16 just makes Invoker output black images, it seems it's an issue with this specific GPU that is fixable by using --precision full --no-half, it works on Automatic's webui but Invoker doesn't recognize those arguments.

MasterIO02 avatar Nov 26 '22 00:11 MasterIO02

Changing to precision float16 just makes Invoker output black images, it seems it's an issue with this specific GPU that is fixable by using --precision full --no-half, it works on Automatic's webui but Invoker doesn't recognize those arguments.

I also have a GTX 1660 6gb installed(Windows platform). However, "Automatic" works successfully without any additional arguments. Including the "Upscale" function with the "realesrgan" model. The problem with "Upscale" is observed only in InvokeAI.

goodwin74 avatar Jan 17 '23 08:01 goodwin74

I don't know if this helps, but there's a slight delay in "the darkening", image upscales normally and after a half a sec image gets dark.

JohnyTesla avatar Feb 23 '23 05:02 JohnyTesla

I have a GTX 1660 super 6gb and the same issue. Anyone found a solution?

tomi0911 avatar Apr 01 '23 18:04 tomi0911

I have this issue as well, 1660 Ti. Does not happen with EasyDiffusion or A1111 installs. As said above, seems like a need to allow for a command argument "--precision full --no-half" like is used with the others. Attached image rendered at 512x512 and upscaled 4x. 000003 9a92eff2 4185472284 postprocessed

JSK333 avatar May 09 '23 19:05 JSK333

Why is it closed as completed? This bug is still there

noname9312 avatar Jul 25 '23 12:07 noname9312

still the same bug in april 2024

noname9312 avatar Mar 31 '24 22:03 noname9312