AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: DPM++ 2S a Karras changes considerably on repeats #7323

Closed AlUlkesh closed 1 year ago

AlUlkesh commented 1 year ago

Is there an existing issue for this?

What happened?

With the same parameters, the generated image is considerably different on each repeat.

Steps to reproduce the problem

  1. Go to txt2image
  2. Input parameters:
    2girls, portrait of beautiful 30 year old women, black hair, braids, (dressy casual attire:1.3), (full body tribal tattoos:1.3), flushed, gothic, dark, moody, (beautiful, detailed, smokey dark eyes, eyeliner, eyelashes:1.2), (in shopping mall:1.4), (crowd:1.5), (Albert Lynch), Carne Griffiths, Franz Xaver Winterhalter, Jeremy Mann, masterpiece, best quality, masterpiece
    Negative prompt: (ugly:1.3), (duplicate:1.3), (morbid), (mutilated), out of frame, extra fingers, mutated hands, (poorly drawn hands), (poorly drawn face), (mutation:1.3), (deformed:1.3), (amputee:1.3), blurry, bad anatomy, bad proportions, (extra limbs), cloned face, (disfigured:1.3), gross proportions, (malformed limbs), (missing arms), (missing legs), (extra arms), (extra legs), mutated hands, (fused fingers), (too many fingers), (long neck:1.3), lowres, text, error, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, black and white, monochrome, censored
    Steps: 20, Sampler: DPM++ 2S a Karras, CFG scale: 16.4, Seed: 2554722166, Size: 512x512, Model hash: 812cd9f9d9, Model: Anything-V3.0-pruned-fp16, ENSD: 31337
  3. Generate
  4. Repeat

What should have happened?

The image should be more stable between generations.

Commit where the problem happens

b7d2af8c7fa48d6eef7517a6fbc63a3507c638d4

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--xformers --disable-nan-check --medvram

List of extensions

No, tried it on a fresh install.

Console logs

z:\AI\tests\stable-diffusion-webui_current>webui-user.bat
venv "z:\AI\tests\stable-diffusion-webui_current\venv\Scripts\Python.exe"
Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
Commit hash: b7d2af8c7fa48d6eef7517a6fbc63a3507c638d4
Installing requirements for Web UI
Launching Web UI with arguments: --xformers --disable-nan-check --medvram
Loading weights [812cd9f9d9] from Z:\AI\tests\stable-diffusion-webui_current\models\Stable-diffusion\Anything-V3.0-pruned-fp16.ckpt
Creating model from config: Z:\AI\tests\stable-diffusion-webui_current\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights found near the checkpoint: Z:\AI\tests\stable-diffusion-webui_current\models\Stable-diffusion\Anything-V3.0-pruned-fp16.vae.pt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded in 2.4s (load weights from disk: 0.5s, create model: 0.4s, apply weights to model: 0.4s, apply half(): 0.6s, load VAE: 0.4s).
Running on local URL:  http://127.0.0.1:7860

Additional information

First generation: 00004-2554722166-2girls, portrait of beautiful 30 year old women, black hair, braids, (dressy casual attire_1 3), (full body tribal tattoos_1 3),

Second generation: 00005-2554722166-2girls, portrait of beautiful 30 year old women, black hair, braids, (dressy casual attire_1 3), (full body tribal tattoos_1 3),

Third generation: 00006-2554722166-2girls, portrait of beautiful 30 year old women, black hair, braids, (dressy casual attire_1 3), (full body tribal tattoos_1 3),

johnlester commented 1 year ago

All ancestral samplers (marker with letter a in name) are like this--non-deterministic.

mezotaken commented 1 year ago

It's not the sampler that causes it, but --xformers. Results in general are non-deterministic with it, and ancestral samplers without it output the same thing in consecutive generations with the same seed. 00006-2554722166-2girls, portrait of beautiful 30 year old women, black hair, braids, (dressy casual attire_1 3), (full body tribal tattoos_1 3), 00007-2554722166-2girls, portrait of beautiful 30 year old women, black hair, braids, (dressy casual attire_1 3), (full body tribal tattoos_1 3), Example for your prompt image

mezotaken commented 1 year ago

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3054 https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/2528

AlUlkesh commented 1 year ago

Oh wow, I would never have made the connection with xformers.

I just tried it out and sure enough, I get identical images now. Thanks!