sd-dynamic-prompts
sd-dynamic-prompts copied to clipboard
Duplicate entries in wildcards are ignored
Describe the bug Duplicate entries in wildcards are ignored. I want to add duplicate entries to have them be picked more frequently but they are ignored.
To Reproduce
- Write a wildcard file containing a lot of duplicates of one entry (ex pose.txt containing "standing" 20 times and "lying" once)
- Generate 20 images with that wildcard
- Half results are standing and half are lying when lying should be very rare
Expected behaviour Every entry in the wildcard file is considered.
This is somewhat by design in the underlying dynamicprompts library: https://github.com/adieyal/dynamicprompts/blob/2ed05b68b807fe2a2d93059934c2b0fabd4ed6db/src/dynamicprompts/wildcardfile.py#L34
Well, from what I can see the library is by the same author, made for this extension, so it doesn't really matter if it's in the library. I would think this should at least be an option. I can add stuff like [::1] next to every duplicate to have them be read while not affecting prompt, but that's really not ideal.
What is your use case for duplicate values?
As I said, to control the probability of selection, for example in a pose wildcard I would want some poses to not be selected with the same frequency as others.
We could extend the current .txt wildcard format to include probabilities too...
It is now possible to prevent de-duplication and sorting of wildcard files. see here: https://github.com/adieyal/sd-dynamic-prompts/blob/main/README.md#wildcard-settings