Generation seed
In Stable Diffusion, a seed is a random number that is used to initialize the generation process. The seed is used to create a noise tensor, which is then used by the diffusion model to generate an image. The same seed together with the same prompt and settings will generally produce the same image.
The generation seed is needed for two reasons:
- Reproducibility: By using the same seed, you can consistently generate the same image with identical settings and prompts.
- Exploration: You can discover diverse image variations by altering the seed number. This often leads to the emergence of novel and intriguing images.
When a seed number is not provided, the Diffusers package automatically generates a random number for each image creation process. However, you have the option to specify your preferred seed number, as demonstrated in the following Python code:
my_seed = 1234 generator = torch.Generator("cuda:0").manual_seed(my_seed) prompt...