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

Generated image slightly differ since V2.0 support was added

Open alkeryn opened this issue 3 years ago • 8 comments

Is there an existing issue for this?

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

What happened?

So i tried to regenerate an old picture with the same parameters, and it was slightly different, i then used git checkout to go one commit before ce6911158b5b2f9cf79b405a1f368f875492044d ("Add support Stable Diffusion 2.0"). and it was the same image again.

Steps to reproduce the problem

regenerate an old image after commit ce6911158b5b2f9cf79b405a1f368f875492044d.

parameters used was euler a, cfg = 10, may not happen depeding on your prompt, if you can't reproduce me i can give you an exact prompt and seed that'll cause the change.

also, i found it on AnythingV3 model. but haven't tried it on vanilla sd model.

What should have happened?

same image being generated ?

Commit where the problem happens

ce6911158b5b2f9cf79b405a1f368f875492044d

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--theme dark --api

Additional information, context and logs

Maybe it isn't a bug and is expected to happen, if so, maybe it would make sense to add the commit hash in the picture metadatas for reproduction purpose.

alkeryn avatar Nov 26 '22 16:11 alkeryn

I am seeing this too.

I wonder if the denoiser is being correctly changed here based on the model you use? https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/ce6911158b5b2f9cf79b405a1f368f875492044d#diff-4c4eff9d10f784b709e6356e8447ea9f06e4cedabc3ca08a5d8c41aa21ef2f78R353

Edit: I think its probably caused by the k-diffusion changes.

ProGamerGov avatar Nov 26 '22 17:11 ProGamerGov

Maybe changes in k-diffusion are responsible?

https://github.com/crowsonkb/k-diffusion/commit/7621f11f786ec17119ae9cac8e88971b822a4bbe

https://github.com/crowsonkb/k-diffusion/pull/46

ProGamerGov avatar Nov 26 '22 17:11 ProGamerGov

It appears xformers is being enabled now even without the --xformers or --force-enable-xformers argument being given, delete repositories/xformers to prevent it loading.

Chryseus avatar Nov 26 '22 17:11 Chryseus

Not sure if I am missing something, but when I upscale my outputs using img2img, the fine details are being erased. Might be related to the changed k-diffusion values.

ProGamerGov avatar Nov 26 '22 17:11 ProGamerGov

@Chryseus it tells me "No module 'xformers'. Proceeding without it." so that's not it.

alkeryn avatar Nov 26 '22 18:11 alkeryn

I just noticed that both my log.csv file and the png chunk info from yesterday appear to have the wrong seed saved (they also saved different seeds for the same image).

ProGamerGov avatar Nov 26 '22 19:11 ProGamerGov

Looks like the xformers issue is just a bit more pronounced now. Was happening before SD2 release, but doing a diff now of several images generated with same seed, there are quite a bit more changes than previously (which was hardly noticable).

leppie avatar Nov 26 '22 21:11 leppie

So does this problem still exist? It seems that forcibly closing xformers does not solve the problem.

kou201 avatar Nov 28 '22 04:11 kou201

@kou201 haven't tested but the issue wasn't due to xformers.

alkeryn avatar Dec 01 '22 17:12 alkeryn

It's january 30, and i was able to recreate multiple images from october. Both images were generated on clean install of sdwebui, no extensions, no xformers. Any image generated with use of xformers is impossible to recreate.

mezotaken avatar Jan 30 '23 08:01 mezotaken

@mezotaken haven't tested in a while, but any idea what fixed it if it is actually fixed ? not all images will be different and when they are the difference is subtle. maybe i should try again.

alkeryn avatar Jan 30 '23 09:01 alkeryn

I know for sure that auto keeps an eye for every possible consistency break and only changes it if absolutely necessary (a bug for example) and with backward compatibility option in settings. Reasons i'm aware of:

  1. Xformers either on previous generation, or on second generation
  2. Different hardware in any kind. GPU, CPU, whatever.
  3. Different precision used. --no-half or --no-half-vae present on one launch, but not on the other.
  4. Everything listed here https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Seed-breaking-changes
  5. Some crucial things were not in infotext before (ENSD, eta's, hypernets), and some of them still not now (VAE, for example). I just remember specifically which VAE and ensd i used but it was not in infotext for the picture i recreated.

In any case no one stops you from experiment: Checkout any version from october, create an image with known parameters and then try to recreate it in today's version. I'd try that myself tbh just to close all those issues.

mezotaken avatar Jan 30 '23 09:01 mezotaken