AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: SD upscale script outputs yellow squares when VAE is loaded #5681

Closed VeselyiKot closed 1 year ago

VeselyiKot commented 1 year ago

Is there an existing issue for this?

What happened?

It starts spitting out half-yellow squares when you use SD upscale script with VAE on. Number of squares varies from one to two, and they are always in the random corner. If you unload VAE, SD upscale works normally. Here is an example of a broken generation 00034-365785959

Steps to reproduce the problem

  1. load VAE of your choice (NAI default for example)
  2. go to IMG2IMG
  3. load image
  4. load SD upscale script
  5. run SD upscale
  6. look at output

What should have happened?

Upscaled image without yellow squares. Like this, generated with unloaded VAE. 00036-2613422481

Commit where the problem happens

685f9631b56ff8bd43bce24ff5ce0f9a0e9af490

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

set COMMANDLINE_ARGS=--disable-safe-unpickle --xformers --opt-split-attention

Additional information, context and logs

My upscale parameters were: 512x704 source image, SD upscale settings set as 576x768, batch size 4, CFG scale 7, 0.4 denoising, 48 Tile Overlap, 2x upscale factor. Upscaler does not matter, as I found, never tried to change anything else here since disabling VAE solved the problem for me.

amarand commented 1 year ago

Also, how cool of an effect is that? Maybe we should have a command-line to make a checkerboard pattern? 😹

cstone1991 commented 1 year ago

This is very common with both NAI and Anything-V3 vae's. Enabling --no-half-vae in in COMMANDLINE_ARGS fixes it. Alternatively, it doesn't happen with the kl_f8_anime or kl_f8_anime2 vae's from the Waifu-Diffusion-v1-4 repo.