woctezuma/stable-diffusion-colab

How can I fix a seed with stable diffusion 2.0?

shivangibithel opened this issue · 3 comments

How can I fix a seed with stable diffusion 2.0?

I would set a generator with a seed, but I have not tried to see if this works as expected.

This is not working with v2. I used this with stable diffusion v1 and it used to work there.

I have checked and this works fine with all three models.

images = pipe(
    prompt,
    height = image_length,
    width = image_length,
    num_inference_steps = 25,
    guidance_scale = 9,
    num_images_per_prompt = num_images,
    negative_prompt = negative_prompt,
    generator = [torch.Generator(device).manual_seed(i) for i in range(num_images)]
    ).images

Tested with:

model_id = "stabilityai/stable-diffusion-2-1-base"
model_id = "stabilityai/stable-diffusion-2-1"
model_id = "dreamlike-art/dreamlike-photoreal-2.0"