divamgupta / divamgupta/stable-diffusion-tensorflow

First generated image is different from the following ones using same settings

Open
#25 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.6k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

For some reason, the first generated image is different from the following ones using the code below:

```
from tensorflow import keras
from stable_diffusion_tf.stable_diffusion import Text2Image
from PIL import Image

# Prompt and seed copied from
# https://lexica.art/?prompt=715596cf-84bd-497f-8413-6e9bb8f39c5e
prompt = "cat seahorse fursona, autistic bisexual graphic designer, attractive fluffy humanoid character design, sharp focus, weirdcore voidpunk digital art by artgerm, akihiko yoshida, louis wain, simon stalenhag, wlop, noah bradley, furaffinity, artstation hd, trending on deviantart"

generator = Text2Image(img_height=512, img_width=512, jit_compile=False)
for num in range(3):
img = generator.generate(
prompt,
num_steps=25,
unconditional_guidance_scale=7.0,
temperature=1,
batch_size=1,
seed=4030098432,
)
Image.fromarray(img[0]).save(f"output{num+1}.png")
```

Here are the images:

First generated image:
![output1](https://user-images.githubusercontent.com/106794/191567614-affe3e79-afba-4921-bc75-aa62ba086ab6.png)

Second generated image:
![output2](https://user-images.githubusercontent.com/106794/191567622-3c642a27-4e50-4dfe-8185-5c241ff46432.png)

Third generated image:
![output3](https://user-images.githubusercontent.com/106794/191567625-a0b25404-f538-4e2e-a172-99099cb8526c.png)

I get the same results even if I create a new generator for each image in the `for`-loop.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.