3
$\begingroup$

Assuming the user can set all parameters, including but not limited to the seed.

Is the output deterministic? As in, the same set of inputs will create the same image?

$\endgroup$
1
  • $\begingroup$ Everything a computer does is deterministic, with the possible exception of synchronization bugs in programs that run on multiple processors. $\endgroup$
    – user253751
    Mar 28 at 13:01

3 Answers 3

3
$\begingroup$

Yes.

By setting the seed you can control the reproducibility. See the Guide to using seed in Stable Diffusion

enter image description here

With all parameters fixed except for the seed, the output will have some degree of randomness.

Using the prompt "dogs chasing cars in Alaska" three times I got the following on Stable Diffusion v1.5:

enter image description here enter image description here enter image description here

$\endgroup$
0
$\begingroup$

Even with all parameters fixed, I have gotten slightly different results with SD 1.4 at least when generating a batch of images. I haven't done extensive testing on this, but even a single sample is sufficient to show that the results weren't identical. The used code is a private fork from neonsecret/stable-diffusion.

Eight of the nine images were pretty much identical, but for some reason the middle row's right image showed some variation between runs on the hand. I also tried running a single image once, and this time the result was identical.

SD 1.4, "Indian girl on a flower field, digital art, realistic, highly detailed, concept art", CFG 3, 50 steps, seed 2347886331, DDIM sampler.

The gamma of difference images was set to 3.0 in GIMP, to enhance small deviations.

SD girl on field comparison

Actually it would be better to run a larger batch of identical seeds and see whether they are identical or not. I did these via copy-paste from a free SD website I run. It would be interesting to know if these results can be reproduced on different code-bases. My fork deviates quite a lot from the original one, due to several extra optimizations.

Edit 1: The image comparison is done on lossy-compressed WebP images, with a quality setting of 95%.

$\endgroup$
0
$\begingroup$

It depends.

It is reproducible on the same hardware, but if you try running on different operating systems or different Torch devices (CPU and CUDA, CUDA and MPS), the results are not the same.

$\endgroup$
1
  • $\begingroup$ Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Apr 12 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .