adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are complex prompts borken?

dm18 opened this issue · comments

commented

I'm seeing an issue with multiple instances of autoamatic1111 with the behavior of sd-dynamic-prompts. New installs, on both master, and dev branch have the issue. Older installs work as expected, until sd-dynamic-prompts is updated. After updating they seem to have the same issue.

{4$$a| b|c|d| e |f|g|h|i|j|k} work as expected
{4-8$$a| b|c|d| e |f|g|h|i|j|k} work as expected
{4$$__clothing_} work as expected
{4-8$$_clothing_} work as expected

But
{4$$ _color_ _clothing_, } does not work as expected.
I would expect that to return 4 RNG instances of "color clothing, ",
But instead I get 1 RNG instances of "color clothing, ",

fixed RNG ranges have the same issue
{4-8$$ _color_ _clothing_,}
also only returns 1 RNG instances of "color clothing, ".

{4-8$$ _clothing_}
also
only returns 1 RNG instances of " clothing". so adding even one space in the prompt break it.

More complex prompts like
{4-8$$ _subject_ _noun_ _verb_. }
are also similar broken

prompt that contain _lists_ and | are also similarly broken
{3$$_color_|_metal_}
will only return 2 results, instead of 3 results.
{4-8$$_color_|_metal_}
will only return 2 results, instead of 4-8 results.

These prompts use to work.
If this is an intentional change. It backwards compatibility with many existing prompts. And it's counterintuitive to existing users.

You gotta make sure to use "__" instead of "_". Dunno if you mean the former and aren't writing it, if the first "__" was a typo, or if you have changed the wildcard character from "__" to "_".

It does seem that there is an issue when the number of requested combinations exceeds the number of possible choices delimited by a pipe in the wildcard request. For example, {Z$$ __X1__ __Y1__|__X2__ __Y2__|...|__XN__ __YN__} only works when Z <= N

The workaround until it is addressed is to create identical options at or in excess of the number of options requested (ie {4$$__Color__ __Metal__} becomes {4$$__Color__ __Metal__|__Color__ __Metal__|__Color__ __Metal__|__Color__ __Metal__} )

Personally, I've never encountered this problem as all my Z <= N. I can't think of an instance where I would want that many options of the same type without also wanting something like BREAK, a linebreak, or other interstitial info.

commented

Thanks for reading the bug report.

I am using __ when referencing lists. To me, it seem like dynamic prompts no longer handles list in the same manor it use to. Prompts that use to work, no longer work. specifically when 'Combinations' are combined with 'Wildcards', and there are additional text, or wildcards.

Based on your response, it seems like other people have the same issue.

Variables also seem to be functioning different then then expected.

IE:
${season=!{summer|autumn|winter|spring}}
${season}
${season}

will return 2 RNG results, ie
summer
winter

instead of the expected output of 1 RNG result, ie
summer
summer

Like it's setting a value of the 'Combinations' instead of the result of the 'Combinations'.

Which version of dynamicprompts is installed in the environments?