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

[Bug]: initial black image on every launch, before changing settings

Open paniq opened this issue 2 years ago • 9 comments

Is there an existing issue for this?

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

What happened?

I updated my repo which was checked out a few days ago to 1a23dc3 via git pull. When generating images without changing any settings, all images are black, until some random settings are changed. Then the problem goes away.

Steps to reproduce the problem

  1. Check out the repo from a week ago.
  2. Do some work with it.
  3. Update to latest revision.
  4. Launch server.
  5. Generate, get only black images.
  6. Change model, twiddle with sampling method, CFG, iterations etc. I'm not entirely sure what does it.
  7. Generate again, problem went away.
  8. Change model and settings back, no problem anymore.
  9. Shutdown server, goto 4

What should have happened?

After launch, the images should be produced as normal without having to twiddle with any setting.

Commit where the problem happens

1a23dc3

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No response

Additional information, context and logs

No response

paniq avatar Jan 11 '23 09:01 paniq

same to you, Generate a black image, or the model takes effect.

kakaxixx avatar Jan 11 '23 09:01 kakaxixx

After recently updating this is happening to me as well, except changing settings doesn't help. 🤷‍♂️

MatthewK78 avatar Jan 11 '23 22:01 MatthewK78

So something overwrite config files after shutdown server? How about trying to delete/move config.json and ui-config.json before starting (all settings default) ? I suspect the .json formatting here became messed up.

mclsugi avatar Jan 12 '23 14:01 mclsugi

I have a similar problem, except that I either get black images or just some fuzzy colors that in no way follow the prompt. Even got some interesting geometric shapes, yet nothing even remotely related to the prompt. Sometimes I also get good images, except that they are in no way related to the prompt. I.E. I want to generate a profile picture of a person and get a house with a pool instead.

I deleted the config files, but that didn't fix it. If I however switch the model used back and forth for a while it eventually works (until models are changed again).

This seems to be related to pruned checkpoint files. I did not have this issues with unpruned ones. I tried merging a model with itself to see if that fixes the issue, but it still reliably fails. However mixing that model with an unpruned one at 0.01 strength it created a nearly identical (but bigger) model that does not have these issues.

twothe avatar Jan 12 '23 15:01 twothe

pruned model generate black images,Unless you switch to the original model and then switch back

kakaxixx avatar Jan 12 '23 17:01 kakaxixx

I have same issue whenever i need to use anything3 vae with custom models, its all looks like leftovers after NSFW filter even tho i dont prompt nsfw and it still happens , theres something left over in the code that allows this to happen

2blackbar avatar Jan 13 '23 15:01 2blackbar

I'm also seeing this bug with junk outputs (occasionally black) with merged (pruned?) models (like Protogen Infinity). I also get the NaN error depending on what is in the prompt, so it is perhaps related (#6923). Switching to a different model and back to the desired model seems to fix it, until you start the server again.

Jonseed avatar Jan 21 '23 20:01 Jonseed

I think this may be related to #6923, and a possible fix has been posted over there. See if making that code change in sd_models.py fixes it for you.

Jonseed avatar Jan 21 '23 23:01 Jonseed

reporting back to say that with current revisions, this problem no longer occurs for me.

paniq avatar Mar 07 '23 18:03 paniq