mcmonkeyprojects / sd-infinity-grid-generator-script

Infinite-Axis Grid Generator for Stable Diffusion!
MIT License
178 stars 24 forks source link

Setting a random seed is not obvious. #13

Open valconius opened 1 year ago

valconius commented 1 year ago

When I set the seed's value to -1, I expect one of the following:

I instead observe:

I would like for the seed to be explicitly stored in the generated text file.

I would also like to have the option to make the seed either random per-grid or per-image-per-grid.

(The seed is also not in the pnginfo. I don't know the seed of my images set to generate with seed=-1.)

mcmonkey4eva commented 1 year ago

So as an initial reply to this issue and #14 as well:

itswhateverman commented 1 year ago

I can see the value in these suggestions. Being able to use traditional wildcards for prompts or random seeds for the first run could speed things up, but for the comparison capability to be any value you'd want to persist it from there by writing it back to the yml or to a sidecar file so its honored on future runs.

I guess the total randomness option could have its uses in generating a large set of random images to kind of stress test a model or find seeds to iterate further on but the grid loses a lot of utility when the correlation between the rows becomes meaningless. If mass random gens is the goal an adaptation to support this use in the grid generator would probably make your tool the best suited to do so against a variety of configuration parameters.

valconius commented 1 year ago

I think the text file is generated by my webui settings. Therein are the generation parameters (minus the seed only if it is -1). If the seed was to be -1 then it also does not appear in pnginfo.

Presently, I put an axis that has one option for seed=constant and another for seed=-1. Before generating a grid, I manually make a few grids to find a good seed. Then, in the infinity grid, I set the random seed as a super-axis. This is a quick and easy way to check if a bad result was the fault of an embedding or hypernetwork or if that result was actually fine on another seed. Of course, rather than mindlessly generating 2x or 5x as many images by specifying additional seeds, I can just set the embed or hypernetwork as an axis and scan the random seed section to see what else popped out. It is a bit strange but think of it as fuzzing a set of parameters to vaguely correct presumptuous assumptions of success or failure. I do this when I have super-huge grids, which admittedly is only one grid so far since they take a long time to generate when I'm trying to do this.

It is also a fun setting to get infinite random funny pictures.

mcmonkey4eva commented 1 year ago

I fixed the bug part of this, wherein seed was -1 in pnginfo - pnginfo now has the correct seed.

mcmonkey4eva commented 1 year ago

I tried individual per-image metadata files in the grid tool for https://github.com/Stability-AI/StableSwarmUI and, while some of the issues mentioned before in the other thread remain present, it does work well, so I'll like port it back to here as an option.