jinja2 templates--can they be tied to seed the way simple dynamic prompts are? #547
Speusippus
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With dynamic prompting on in A1111, and with jinja2 off, if I type the following into A1111's prompt field
{dog|cat}
and set it to produce six images, and set a specific starting seed of 1, then the result is six images, about half of a dog, about half of a cat, with consecutive seeds 1, 2, 3, 4, 5 and 6.
If I hit "generate" again without changing anything, it gives me exactly the same sequence of six images. The seed has determined when it chooses cat, and when it chooses dog.
This is something I use!
But if I turn jinja2 templates on, and type the following into A1111's prompt field:
{{ choice('cat', 'dog') }}
And set it to six images and seed of 1, then it generates six images, about half dogs, about half cats, and with consecutive seeds 1, 2, 3, 4, 5, 6. But then if I hit generate again, it creates six images, about half dogs about half cats, with the same consecutive seeds, but the selection as to which are cats and which are dogs is different from before.
And, using "random sample" instead of "choice," I get the same kind of result--the seed no longer determines which selection is made (even though in the docs this is described as behaving just like simple dynamic prompting).
What I ultimatele am hoping for is a way to have a prompt syntax that lets me type somehting like this:
Script:
for colors in [red, green, blue]
create a prompt as follows: "A %color% {pig|dog}"
And have that create (and generate an image based on) each of the following prompts:
A red {pig|dog}
A green {pig|dog}
A blue {pig|dog}
and then if I run exactly the same script, with exactly the same seed, have it as a result generate exactly the same images, rather than generating just exactly the same prompts but varying in which selection it makes each time it encounters the dynamic prompt curly brackets.
In other words, I would like to do both combinatorial and dynamically selected prompting within a single script, and have the results be based entirely on the seed. Right now this does not appear to be possible in either the simple dynamic prompting syntax or the jinja2 syntax.
Is there a way though, that I am missing? And if not, is this an issue that anyone has brought up before?
Beta Was this translation helpful? Give feedback.
All reactions