adieyal / dynamicprompts

Templating language for generating prompts for text to image generators such as Stable Diffusion
MIT License
118 stars 20 forks source link

randomizer in the jinja template seem to use a different seed. #108

Open Nrgte opened 1 year ago

Nrgte commented 1 year ago

If I assign a random value from a wildcard, it doesn't seem to use the normal generation seed.

{% set cloth_color = wildcard("__colors_cloth__")|random %}

Even if I fix the seed, the values will be different on each generation.

jdahlstrom commented 10 months ago

Presumably it just uses Python's random modules's internal seed. Should calle random.seed somewhere, or even better, allow creating arbitrary Random instances in templates so you could fix the seed of one part of the template while varying another… There's also of course a lot of useful functions in random/Random that would be nice to have available in templates.