ml-stable-diffusion icon indicating copy to clipboard operation
ml-stable-diffusion copied to clipboard

Add --increment-seed argument

Open hirakujira opened this issue 3 years ago • 2 comments

The --image-count option in the swift example generates images with the initial seed, which the user gives. But for the rest of the images, it generates an MLShapedArray with the normalShapedArray function, which is difficult to reproduce the resulting image again.

Imagine this scenario:

  1. A user use --image-count=1000 --seed=42 to generate a batch of images
  2. The user found that image No. 420 is the best result. He wants to reproduce the image with different steps
  3. Since we can't get the seed of image No. 420, the only solution is to rerun the whole batch with the steps he wants.

With the --increment-seed argument in this PR, the seed of each image is predictable. If a user wants image No. 420, he only needs to rerun the single image with seed 462 (420 + 42).

With --increment-seed argument, the swift application also saves each image right after the image is generated. We can let the application run and filter the result we want in the same time instead of waiting for the whole process to finish.

Do not erase the below when submitting your pull request: #########

  • [x] I agree to the terms outlined in CONTRIBUTING.md

hirakujira avatar Dec 16 '22 09:12 hirakujira

the numbers at the end of the generated file name is the seed that was used for that particular image.

dec2-anon avatar Dec 16 '22 12:12 dec2-anon

the numbers at the end of the generated file name is the seed that was used for that particular image.

I know. But this is for the first image only. Then the application generates the remaining images of the batch with normalShapedArray function, which is difficult to get the "seed".

hirakujira avatar Dec 16 '22 12:12 hirakujira