Answers.Body: <p>Yes.</p>
  <p>By setting the seed you can control the reproducibility. See the <a href="https://getimg.ai/guides/guide-to-seed-parameter-in-stable-diffusion" rel="nofollow noreferrer">Guide to using seed in Stable Diffusion</a></p>
  <p><a href="https://i.sstatic.net/YaPEr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YaPEr.png" alt="enter image description here" /></a></p>
  <p>With all parameters fixed except for the seed, the output will have some degree of randomness.</p>
  <p>Using the prompt &quot;dogs chasing cars in Alaska&quot; three times I got the following on Stable Diffusion v1.5:</p>
  <p><a href="https://i.sstatic.net/WrFPo.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WrFPo.jpg" alt="enter image description here" /></a>
  <a href="https://i.sstatic.net/rau8D.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rau8D.jpg" alt="enter image description here" /></a>
  <a href="https://i.sstatic.net/wMR1z.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wMR1z.jpg" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-27T12:50:07.770Z
Answers.LastActivityDate: 2023-03-27T12:50:07.770Z
Answers.UserDisplayName: Brian O'Donnell
Answers.Body: <p>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 <a href="https://github.com/neonsecret/stable-diffusion" rel="nofollow noreferrer">neonsecret/stable-diffusion</a>.</p>
  <p>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.</p>
  <p>SD 1.4, &quot;Indian girl on a flower field, digital art, realistic, highly detailed, concept art&quot;, CFG 3, 50 steps, seed 2347886331, DDIM sampler.</p>
  <p>The gamma of difference images was set to 3.0 in GIMP, to enhance small deviations.</p>
  <p><a href="https://i.sstatic.net/Nhajd.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Nhajd.jpg" alt="SD girl on field comparison" /></a></p>
  <p>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.</p>
  <p>Edit 1: The image comparison is done on lossy-compressed WebP images, with a quality setting of 95%.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-28T16:42:05.327Z
Answers.LastActivityDate: 2023-03-28T18:53:00.513Z
Answers.LastEditDate: 2023-03-28T18:53:00.513Z
Answers.UserDisplayName: NikoNyrh
Answers.Body: <p>It depends.</p>
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-12T15:30:38.957Z
Answers.Text: 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](/help/how-to-answer).
Answers.UserDisplayName: Community
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-12T05:34:20.907Z
Answers.LastActivityDate: 2023-04-12T05:34:20.907Z
Answers.UserDisplayName: Renato Dinhani
Body: <p>Assuming the user can set all parameters, including but not limited to the seed.</p>
  <p>Is the output deterministic? As in, the same set of inputs will create the same image?</p>
  
Tags: <image-generation><randomness>
Title: Is the output of image generation models like Midjourney and Stable Diffusion deterministic?
UserDisplayName: Mindwin Remember Monica
ThreadText: # Is the output of image generation models like Midjourney and Stable Diffusion deterministic?
  
  (Asked by: username_0 on 2023-03-27)
  
  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?
  
  **Tags:** image-generation, randomness
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2023-03-27. Score: 3
  
  Yes.
  
  By setting the seed you can control the reproducibility. See the [Guide to using seed in Stable Diffusion](https://getimg.ai/guides/guide-to-seed-parameter-in-stable-diffusion)
  
  [![enter image description here](https://i.sstatic.net/YaPEr.png)](https://i.sstatic.net/YaPEr.png)
  
  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](https://i.sstatic.net/WrFPo.jpg)](https://i.sstatic.net/WrFPo.jpg)
  [![enter image description here](https://i.sstatic.net/rau8D.jpg)](https://i.sstatic.net/rau8D.jpg)
  [![enter image description here](https://i.sstatic.net/wMR1z.jpg)](https://i.sstatic.net/wMR1z.jpg)
  
  
  ---
  
  ### Answer by username_2 on 2023-03-28. Score: 1
  
  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](https://github.com/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](https://i.sstatic.net/Nhajd.jpg)](https://i.sstatic.net/Nhajd.jpg)
  
  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%.
  
  
  ---
  
  ### Answer by username_3 on 2023-04-12. Score: 0
  
  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.
  
  > **Comments:**
  > **username_4**: 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](/help/how-to-answer).  
  
  ---
  
  