same image with same seed, cfg, etc?

#14
by terekita - opened

I keep seeing variations of this question: is it possible to create the same image as discord bot/DreamStudio when using the released weights? (Should be in principle, since it's the same model...) I realize that there may be some differences in hardware that cause indeterminant results. However, do DreamStudio and the discord bots run on the exact same hardware? (Perhaps so?)

Earlier today I saw an example on simulacrabot discord that came somewhat close to the same image when using the same seed. Both images are attached.

Top is image is discord bot, bottom is from this colab: https://github.com/DamascusGit/stable-k-4d

Has anyone come closer than this, and been able to attain identical images? More importantly, has anyone been able to attain the same level of "quality" as DreamStudio?

It feels like there's some important default parameters somewhere that haven't been widely uncovered re: the sampling process. Would love if the full set of defaults for the discord bots were revealed somewhere!

db1.png

db2.png

We are very close to being able to reproduce the discord images exactly. I think the only problem is that we don't have the code for the right sampler in the github. The github has just the ddim and plms samplers, but the discord bot uses k_lms as its sampler. My guess is that if we can use the k_lms sampler, we would be able to reproduce the discord results almost exactly.

I have not yet looked into exactly what these samplers are all about. Based on the names of some of them, I think they may be based on different numerical integration techniques.

The colab that I linked above uses k_lms. However, there's still something not quite there yet...

I've set up klms to work with the public repo successfully. Check out https://github.com/DamascusGit/stable-diffusion/tree/main/scripts to see some versions he made using klms (the "_k.py" scripts). I edited them a bit, but it's more or less those scripts that will show you the right way. Here are the additional requirements:

accelerate
jsmonmerge
torchdiffeq
https://github.com/GaParmar/clean-fid
https://github.com/assafshocher/ResizeRight
https://github.com/crowsonkb/k-diffusion

@beecee Did you by any chance make a shareable colab with your edits?

Unfortunately not, but if you add those references and then take a look at the _k.py scripts, you should be able to get it working either locally or on an existing notebook

I've set up klms to work with the public repo successfully. Check out https://github.com/DamascusGit/stable-diffusion/tree/main/scripts to see some versions he made using klms (the "_k.py" scripts). I edited them a bit, but it's more or less those scripts that will show you the right way. Here are the additional requirements:

accelerate
jsmonmerge
torchdiffeq
https://github.com/GaParmar/clean-fid
https://github.com/assafshocher/ResizeRight
https://github.com/crowsonkb/k-diffusion

Great info, thanks! Was taking a stab at it for a bit yesterday

Sign up or log in to comment