sd-dynamic-prompts
sd-dynamic-prompts copied to clipboard
[BUG] Variables stay the same accross the whole batch
${hair_color=!__f_facial/colors_hair__}
a woman with ${hair_color} hair.
If the batch size is 8, this will only random once at the start and then set the same color for every image.
well thats kinda funny, because i want this behavior for another project even if its not prefererd :/
@adieyal I've looked into the code and it seems that the variables aren't getting reset after each image. So when immediate is = true, it sets the value, but all images will use the same variables.
In randomprompts.py
gen = self._context.sample_prompts(template, num_images) has to be part of the for seed in seeds: loop and at the end the variables of the SamplingContext have to be reset.
Has this issue fixed itself for anyone else despite not having a new sd-dynamic-prompts commit? I've been avoiding variables because of this issue, but when I tested it today I'm getting different prompts in the same batch with
${prompt= __Background/Random__ }
${prompt}
I'm not clever enough to understand why by parsing through the code, but I turned off all other extensions in case some other extension was interacting with it and I still can't repro the issue. I did update Automatic1111 recently -- I wonder if that could be the cause of this change in behavior.
Edit: nevermind -- I misunderstood the purpose of immediate evaluation; the following does produce the same prompt across the entire batch
${prompt=!__Background/Random__ }
${prompt}
@Picometer12 The issue is not with the sd-dynamic-prompt extension itself, but in one of it's dependencies. A library which is also created by @adieyal
I am also getting this issue, even after updating to the newest version of the extension. seems to be fine when taking from a wildcard, but if it's in the prompt on it's own it has this problem
This happened in my environment, especially when Umprompted was enabled (there may be other causes, but it worked fine in the current latest environment by turning it "off") means disabling it on the Automatic1111 UI, not disabling the extension itself. I will report it as an example.
https://github.com/ThereforeGames/unprompted