Setting seed, number of samples, batch size, or output resolution?

#17
by geoad - opened

Looked at the StableDiffusionXLPipeline source but cannot find out how to set basic parameters?

Could anyone offer a hint?

Segmind org

All the parameters work the similar way,

import torch
from torch import Generator
from diffusers import StableDiffusionXLPipeline
gen = Generator(f"cuda:{gpu}")
gen.manual_seed(0)
pipe = StableDiffusionXLPipeline.from_pretrained("segmind/SSD-1B", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
images = pipe(prompt = prompts, negative_prompt = negative_prompts, height = 1024, width = 1024, num_inference_steps = 50, guidance_scale = 9, num_images_per_prompt = 1,generator = gen).images

Here, prompts and negative_prompts are ordinary python lists. Batching is automatically handled when you supply the lists.

Hope this helps!

Thank you, that really helped a lot!

Warlord-K changed discussion status to closed

Sign up or log in to comment