stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Black image as result while generating picture in specific 2.0 checkpoint

Open fractal-fumbler opened this issue 2 years ago • 11 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

after recent update when trying to generate pictures with fp32 2.0 custom checkpoint i am getting black images (tho it only happens with one particular checkpoint https://huggingface.co/kabachuha/gigafractal2-diffusion/

Steps to reproduce the problem

  1. Select checkpoint gigafractal2-diffusion in safetensors format
  2. Go to txt2img tab
  3. Press Generate

What should have happened?

in generating process and after finish non-black images should be as result

Commit where the problem happens

f8c512478568293155539f616dce26c5e4495055

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

No response

Command Line Arguments

--opt-split-attention --opt-channelslast --medvram --always-batch-cond-uncond --opt-sub-quad-attention --no-half --precision full --no-half-vae
  1. cause my gpu is from amd so i am generating pictures w/o xformers
  2. also tried with default SD-2.0 checkpoint and generation process went as ti should be: pictures are normal

p.s. tried without --no-half --precision full --no-half-vae but again got black images as result

Additional information, context and logs

i've noticed that reverting 0c3feb202c5714abd50d879c1db2cd9a71ce93e3 allowing to generate normal pictures again. removing sd_disable_initialization from https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/0c3feb202c5714abd50d879c1db2cd9a71ce93e3/modules/sd_models.py#L16 and removing this line https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/0c3feb202c5714abd50d879c1db2cd9a71ce93e3/modules/sd_models.py#L322

so i guess something offending is inside sd_disable_initialization.py

fractal-fumbler avatar Jan 15 '23 10:01 fractal-fumbler

changing to another model and then back to the one that is causing black images also solved it for me.

J-o-h-n-M avatar Jan 15 '23 14:01 J-o-h-n-M

@J-o-h-n-M, can you tell to which checkpoint you are switching to?

fractal-fumbler avatar Jan 15 '23 14:01 fractal-fumbler

model.ckpt (so the standard SD one I think) I then created 1 image there and switched back to a .safetensors file It then worked

(the 2nd and 3rd time I just switched to model.ckpt and back (without creating anything in model.ckpt) and that also worked fine)

J-o-h-n-M avatar Jan 15 '23 16:01 J-o-h-n-M

model.ckpt (so the standard SD one I think) I then created 1 image there and switched back to a .safetensors file It then worked

that didn't helped me

  1. switch to sd-2.0-768-v-ema.safetensors
  2. generate normal picture
  3. switch to gigafractal2.safetensors
  4. got black image

fractal-fumbler avatar Jan 15 '23 16:01 fractal-fumbler

He switched to v1.4 model ckpt I guess. Try switching to model that used different version of ,yaml (in this case try any v1 models)

mclsugi avatar Jan 15 '23 17:01 mclsugi

He switched to v1.4 model ckpt I guess. Try switching to model that used different version of ,yaml (in this case try any v1 models)

didn't helped too :O

fractal-fumbler avatar Jan 15 '23 17:01 fractal-fumbler

Any VAE used? try turning it off. Long shot, try clip skip other than 1.

mclsugi avatar Jan 15 '23 17:01 mclsugi

Any VAE used? try turning it off. Long shot, try clip skip other than 1.

no vae specified in options and no vae in command line arguements also deleted config files to regenerate them - still black images

fractal-fumbler avatar Jan 15 '23 18:01 fractal-fumbler

My curiosity made me download this model and yes blacked. But it is probably the models fault, look at this check: sdawdawda

mclsugi avatar Jan 15 '23 18:01 mclsugi

thanks for your time!

curious what could possibly broke this one after https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/0c3feb202c5714abd50d879c1db2cd9a71ce93e3

because without disabling initialization model is generating normal pictures.

My curiosity made me download this model and yes blacked. But it is probably the models fault

fractal-fumbler avatar Jan 15 '23 19:01 fractal-fumbler

6 AM, How about another workaround instead reverting back or modifying files? Since the model has no CLIP and a lot of BROKEN components, I merged it with SD v2 model, (0.05 Weighted Sum), and it works (Yes, I know it won't generate the same picture using the same seed etc). But it still got their style though.

Now it became: Screenshot 2023-01-16 061536

In action: Screenshot 2023-01-16 060619

Another test: 03129-1557547952-gigafractal artstyle a  squirrel eating nuts, digital art, polycount, generative art, (fractalism_0 7), lovecraftian, intricate,

Sorry, I don't know how it supposed to look like and I don't know how to prompt this model (keywords etc). I'm not sleeping yet and need to drive my daughter to school LOL. Good luck.

mclsugi avatar Jan 15 '23 23:01 mclsugi

@mclsugi, with latest master it working :D

BUT you gave me a nice idea how to avoid it next time :) lulz i love it :D

please, take care and thanks a lot for your time!!

closing this :)

fractal-fumbler avatar Jan 16 '23 23:01 fractal-fumbler

My curiosity made me download this model and yes blacked. But it is probably the models fault, look at this check: sdawdawda

What extenstion is that? So to see the toolkit tab

J-o-h-n-M avatar Jan 17 '23 06:01 J-o-h-n-M

What extenstion is that? So to see the toolkit tab

That's a secret toolkit for a shadowy government to inject codes for a distributed models that you can't find in extensions list tab... 😎 (joking)

Here it is: https://github.com/arenatemp/stable-diffusion-webui-model-toolkit

mclsugi avatar Jan 17 '23 08:01 mclsugi

a fix for my problems with NaNs https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/7523

fractal-fumbler avatar Feb 04 '23 17:02 fractal-fumbler