sd-dynamic-prompts icon indicating copy to clipboard operation
sd-dynamic-prompts copied to clipboard

Duplicate entries in wildcards are ignored

Open scrumpyman opened this issue 1 year ago • 5 comments

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

  1. Write a wildcard file containing a lot of duplicates of one entry (ex pose.txt containing "standing" 20 times and "lying" once)
  2. Generate 20 images with that wildcard
  3. Half results are standing and half are lying when lying should be very rare

Expected behaviour Every entry in the wildcard file is considered.

scrumpyman avatar Mar 20 '23 06:03 scrumpyman

This is somewhat by design in the underlying dynamicprompts library: https://github.com/adieyal/dynamicprompts/blob/2ed05b68b807fe2a2d93059934c2b0fabd4ed6db/src/dynamicprompts/wildcardfile.py#L34

akx avatar Mar 24 '23 14:03 akx

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.

scrumpyman avatar Mar 24 '23 17:03 scrumpyman

What is your use case for duplicate values?

adieyal avatar Mar 24 '23 19:03 adieyal

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.

scrumpyman avatar Mar 24 '23 20:03 scrumpyman

We could extend the current .txt wildcard format to include probabilities too...

akx avatar Mar 25 '23 10:03 akx

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

adieyal avatar Jul 14 '23 21:07 adieyal