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

When running dynamic prompts with batch size > 0, the whole batch runs with the same text

Open gymdreams8 opened this issue 1 year ago • 16 comments

If the prompt is: a man wearing {red|blue|yellow|green} shirt, and I start a batch count of 50, batch size of 1, then the 50 generated image will all be one of the four colors, e.g. a man wearing red shirt 50 times.

What I would expect it to do instead is having all four colors randomized for the 50 count.

Is there any way to get around this limitation?

gymdreams8 avatar Jul 05 '23 11:07 gymdreams8

I'm seeing this as well with wildcards. A few days ago "hair-color hair" wildcard with batch count of 12 would give me 12 images with different hair colors. Now its giving me 12 images with the same 1 hair color.

TheAntiCamper avatar Jul 05 '23 11:07 TheAntiCamper

It's conflicting with adetailer. disable it and the wildcards work.

TheAntiCamper avatar Jul 05 '23 13:07 TheAntiCamper

I'm also experiencing this problem. Is this something that Adetailer needs to fix or Dynamic prompts?

AnteMaxx avatar Jul 05 '23 13:07 AnteMaxx

Adetailer needs to fix

Bing-su avatar Jul 05 '23 13:07 Bing-su

I have the same problem, it appeared after updating dynamic prompts last week. But I don't have Adetailer installed...? Have to use batch size of 1 to make it work.

DP actually generates the random prompts, but SD ignores anything but the first prompt in a batch. So there's a communication issue somewhere.

I'm running SD 1.32.

jmilez avatar Jul 09 '23 16:07 jmilez

Encountered the same promblem after dynamic prompts updated today. Confirm that is not because of adetailer.

amurorei01 avatar Aug 13 '23 04:08 amurorei01

Another observation.

In main WebUI I have seed set to 0. Dynamic Prompts->Advanced Options->Fixed Seed is OFF. Wildcard substitution does work properly (i.e. chosen randomly each generation).

Fixed Seed OFF Images

1_0 1_1

On another hand, if Dynamic Prompts->Advanced Options->Fixed Seed is ON, wildcard substitution happens only once and stays for all other generated images of a batch.

Fixed Seed ON Images

2_0 2_1

I hope it helps to narrow down possible suspects.

SD as well as all extensions are updated to the latest version at the time of writing.

Nucklead avatar Aug 13 '23 15:08 Nucklead

Thanks for the reports, I'll look into it

adieyal avatar Aug 13 '23 18:08 adieyal

@Nucklead when setting fixed seed, try setting unlink seed from prompt. That will choose a random prompt but use the same seed for each image.

adieyal avatar Aug 13 '23 18:08 adieyal

@gymdreams8 @TheAntiCamper @AnteMaxx @jmilez

Is this still an issue for you? I think adetailer has fixed this issue. I can't reproduce it.

adieyal avatar Aug 13 '23 19:08 adieyal

@Nucklead when setting fixed seed, try setting unlink seed from prompt. That will choose a random prompt but use the same seed for each image.

Tested it. Dynamic Prompts->Advanced Options->"Fixed Seed" and "Unlink Seed From Prompt" both ON works mostly as expected.

Generating with batch count of > 1: With Combinatorial Generation ON - seed stays the same across all images, prompt has variations. With Combinatorial Generation OFF - prompt has proper variations but seed increases by 1 with each image in the batch.

About the last one. I've no idea if seed increment is the default behavior of Automatic1111 or something from Dynamic Prompts affects it.

Otherwise, with the "Unlink Seed From Prompt" the issue is resolved for me. Thank you.

Nucklead avatar Aug 13 '23 20:08 Nucklead

There is a PR that should fix this - I wrote it a while ago but haven't merged it in yet - https://github.com/adieyal/sd-dynamic-prompts/pull/552

adieyal avatar Aug 13 '23 21:08 adieyal

So, basically, if I need randomized prompts with fixed seed, it is currently possible to use a workaround: Dynamic Prompts->Advanced Options->"Fixed Seed" and "Unlink Seed From Prompt" both ON, Dynamic Prompts->Combinatorial Generation ON and set Maximum Generations to an amount of images desired.

A little side-effect of this method would be that wildcards\variants won't be exactly randomly chosen, but rather systematically iterated. To return to the pure randomness, if I understand this correctly, one would need to explicitly set "Random ~" sampler for every wildcard\variant. How to do this is explained in detailed documentation->"Samplers" section.

As for seed increment with batch count > 1 when seed is specified in the default WebUI - even with Dynamic Prompts extension turned off in the extensions tab, this increment still happens, so it looks like this is the default behavior of Automatic1111. I wouldn't notice it before because I wasn't paying attention to that, but now I know.

Nucklead avatar Aug 13 '23 22:08 Nucklead

image same issue here started happening two days ago. Update: Restarted UI And Updated to last Commit extensions its fixed now.

barasalah2 avatar Aug 13 '23 23:08 barasalah2

still have this issue, I have a wildcards who contain 12 colors, but one of them ( white ) appears on 90% of the images

AIrtistry avatar Aug 17 '23 17:08 AIrtistry

When I use wildcards and select the combination generate, it always uses the first prompt.

yeungmozhu avatar Aug 18 '23 17:08 yeungmozhu