adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation
MIT License
1.96k stars 253 forks source link

Multiple calls with no duplicate rolls #676

Open jamesjimmy88 opened 7 months ago

jamesjimmy88 commented 7 months ago

Is there a way to roll a wildcard multiple times while preventing it from picking the same value more than once? The usercase is something like this (with 4 or 6 values, actually, but still):

${animal={cat|dog|mouse|horse}
A picture of a small __animal__ with a large __animal__ and a normal sized __animal__

I could use a custom separator, but that's not viable in this situation since I have more than two values and I'd need different separators. Maybe it's possible to roll the wildcard in a variable and pick the values like from an array? Something like:

${animal={3$$cat|dog|mouse|horse}
A picture of a small __animal__[0] with a large __animal__[1] and a normal sized __animal__[2]

Thanks for your time