AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: 1.6.0 Processing negative embeddings wrong/different? #13150

Open CaptainVarghoss opened 1 year ago

CaptainVarghoss commented 1 year ago

Is there an existing issue for this?

What happened?

Upgraded from 1.5.1 to 1.6.0 and can no longer reproduce images from 1.5.1

I am aware that some changes happened with the DDIM sampler, however I do not believe that they should be causing this problem. (See below)

The following images are made with the exact same prompts, negative prompts, settings, embeddings, etc.

The first is from version 1.5.1 The second is with 1.6.0
1 5 1-with-embeddings 1 6 0-with-embeddings

The differences are quite noticeable. After some searching around other issues trying to see if others were having similar problems and tested various compatibility settings and other samplers. This is the result from both 1.5.1 and 1.6.0 with all embeddings removed from the negative prompts. Nothing else was changed.

1.5.1 without-embeddings 1.6.0 without-embeddings
1 5 1-without-embeddings 1 6 0-without-embeddings
My initial findings seemed to point to the changes to the DDIM sampler in the update so also tested with various other samplers. Results are similar although not quite as drastic. These images are using Euler a using embeddings and appear very similar but are still different. 1.5.1 euler with embeddings 1.6.0 euler with embeddings
1 5 1-euler-a-with-embeddings 1 6 0-euler-a-with-embeddings

Steps to reproduce the problem

  1. Generate image in 1.5.1 with negative embedding
  2. Generate image in 1.6.0 with exact same values as the previous image
  3. Notice they're different
  4. Redo steps 1-2 with no negative embeddings
  5. Notice they are now identical.

What should have happened?

It should produce the exact same image.

Sysinfo

sysinfo#13150.txt

What browsers do you use to access the UI ?

Google Chrome

Console logs

venv "D:\AI\Auto1111\stable-diffusion-webui-1.6.0\venv\Scripts\Python.exe"
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --xformers --opt-channelslast --ckpt-dir D:\AI\Models\checkpoints --hypernetwork-dir D:\AI\Models\hypernetworks --embeddings-dir D:\AI\Models\embeddings --lora-dir D:\AI\Models\loras --vae-dir D:\AI\Models\vae --realesrgan-models-path D:\AI\Models\upscalers --esrgan-models-path D:\AI\Models\upscalers
Loading weights [953a5db015] from D:\AI\Models\checkpoints\AlinaDarkScienceMix-VAE-f16.safetensors
Running on local URL:  http://127.0.0.1:7861

To create a public link, set `share=True` in `launch()`.
Creating model from config: D:\AI\Models\checkpoints\AlinaDarkScienceMix-VAE-f16.yaml
Startup time: 8.4s (prepare environment: 1.4s, import torch: 2.2s, import gradio: 0.6s, setup paths: 0.5s, initialize shared: 0.2s, other imports: 2.2s, load scripts: 0.5s, create ui: 0.3s, gradio launch: 0.3s).
Applying attention optimization: xformers... done.
Model loaded in 4.1s (load weights from disk: 0.6s, create model: 0.2s, apply weights to model: 1.7s, apply channels_last: 0.8s, calculate empty prompt: 0.7s).
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:03<00:00,  9.89it/s]
100%|████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:03<00:00,  2.10it/s]
Total progress:  95%|██████████████████████████████████████████████████████████████▋   | 38/40 [00:32<00:01,  1.17it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:02<00:00, 12.05it/s]
100%|████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:03<00:00,  2.20it/s]
Total progress:  95%|██████████████████████████████████████████████████████████████▋   | 38/40 [00:33<00:01,  1.13it/s]
Total progress:  95%|██████████████████████████████████████████████████████████████▋   | 38/40 [00:33<00:01,  1.29it/s]

Additional information

Both versions tested are clean installs for all tests.

w-e-w commented 1 year ago

I believe someone is investigating this issue

I reformatted the post

AUTOMATIC1111 commented 1 year ago

I have only two of your embeddings, but here is how pics look for me:

1.6: 2610744983-3984377514

1.5: 2610744986-3984377514

1.6 hires fix: 2610744984-3984377514

1.5 hires fix: 2610744985-3984377514

CaptainVarghoss commented 1 year ago

I retested using the same model and also with only the embeddings you have. Still results in different images for each version.. Maybe something changed in the version you have (v1.6.0-112-g46375f05) versus the main release? I checked the changelogs for changes from 1.5.1 to 1.5.2 but I didn't see anything obvious so I don't know if that makes a difference

CaptainVarghoss commented 1 year ago

After some more testing on the above, using only the 2 embeddings you have and the exact same prompt, I get the exact same image as you did on BOTH versions. However, a different prompt still results in the same issue.

As I pointed out at the end of the original post, you can get fairly close to the same results, and apparently the exact same image with a very specific combination of model, sampler, and embeddings. Any of those can be changed and produce sometimes wildly different results between versions.

In case it helps, I've attached the embedding 'bad_pictures' that seems to be making the largest contribution to the problems

bad_pictures.zip

EDIT: Added sample images using only the easynegative, bad-hands-5, and bad_pictures embeddings. Same prompt as above. 1.5.1 1.6.0
1 5 1-bad_pictures 1 6 0-bad_pictures