Sygil-Dev / stable-diffusion

GNU Affero General Public License v3.0
1.72k stars 149 forks source link

Seed number is not precise for single txt2img image generated in batch #201

Closed adamesko closed 2 years ago

adamesko commented 2 years ago

When you generate multiple images at once using txt2img with specific seed number, then you can preview them one by one BUT the seed value stored in OUTPUT INFO is the same for all the images, so it's correct only for the first image.

AFAIK If the seed number is e.g. 1000 then it's 1000 for the first image, 1001 for the second image etc.

This fix could really speed up the workflow when working with batch of images.

dudumaroja commented 2 years ago

for me.. correct seed apears in yaml file and the filename.

AdamNizol commented 2 years ago

for me.. correct seed apears in yaml file and the filename.

Lots of us disable the file outputs to save on harddrive space and not have to clear the files constantly when generating a ton of images but then we have the seed issue OP mentioned.

micwalk commented 2 years ago

A hypothetical fix for this would be to update output info every time the selected image in the gallery has changed with the proper modified seed (seed + zero indexed image number). Unfortunately Gradio doesn't provide a built in OnChange event for the Gallery the way it has for other input change events. It may be possible to inject custom JS to execute on change though, but requires more work. Alternatively adding that callback as a new PR to Gradio could be a solution.