StableSwarmUI icon indicating copy to clipboard operation
StableSwarmUI copied to clipboard

[FEATURE REQUEST] Add Wildcard as an option in the grid generator.

Open LaZoRBear opened this issue 10 months ago • 2 comments

I would like to be able to add wildcards as one or multiple axis in the grid generator. When a wildcard is set as an axis, you chose a wildcard file and each entries would be used once on the axis. It would need either a replace token in the original prompt or the wildcard name should be already used in the prompt.

i.e.: Axes X is a wildcard containing hairs colors (Brown, Blond, Black) Y is a wildcard containing hair styles (Long Straight, Ponytail, Bun)

Prompt is: "a man with wildcard:hair_colors wildcard:hair_styles hairs"

Y\X brown blond black
long straight a man with brown long straight hairs a man with blond long straight hairs a man with black long straight hairs
ponytail a man with brown ponytail hairs a man with blond ponytail hairs a man with black ponytail hairs
bun a man with brown bun hairs a man with blond bun hairs a man with black bun hairs

I am checking for a grid extension but it could also be an option for regular gen to just dump all the combinations into the queue.

I can take a crack at it but I haven't fully understood the codebase just yet to help making this so I'm leaving this here in the meantime.

LaZoRBear avatar Apr 09 '24 20:04 LaZoRBear

ftr you can do the core concept here via the Prompt Replace grid axis, the only part missing is automatic loading from a saved wildcard

mcmonkey4eva avatar Apr 09 '24 20:04 mcmonkey4eva

I've found pretty much all I'm looking for in the GridGeneratorExtension.cs from line 35 to 101. All I need is to come up with the unpacking logic of the wildcard files and check how to handle if the first or only item in the prompt/replace is the wildcard token because we don't want any gen using the actual token, but only the content. Also I need to consider if someone would want not to unpack the wildcard token.

LaZoRBear avatar Apr 10 '24 00:04 LaZoRBear