Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fnurl opened this issue Sep 21, 2022 · 2 comments

Comments

@fnurl
Copy link

fnurl commented Sep 21, 2022

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

Second generated image:
output2

Third generated image:
output3

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

@matpalm
Copy link
Contributor

matpalm commented Sep 22, 2022

there's a minor bug in the seeding. see #27

@fnurl
Copy link
Author

fnurl commented Sep 23, 2022

Thanks, I checked out your pull request #32 an am getting consistent results now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants