adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation
MIT License
2.05k stars 264 forks source link

[BUG] leading whitespace collapse #409

Open afbagwell opened 1 year ago

afbagwell commented 1 year ago

The prompt I have in a file includes the line:

cloak{ with a hood|}

but the first option always collapses the leading whitespace to:

cloakwith a hood

I've confirmed this doesn't happen to trailing whitespace, so the prompt:

{hooded |}cloak

generates "hooded cloak" as expected

adieyal commented 1 year ago

Not a solution - but as a work around you could do something like cloak{1:: with a hood|}

blooest commented 1 year ago

Because of this, I'm sure you're aware, but the bug here is actually moreso that trailing whitespace ISN'T ignored (and there's also no way to escape whitespace that should be part of the final prompt). I wanted to convert my wildcards into multiline YAML, as some of them are getting quite complex, but it became an immediate impossibility because my usecase does not allow for any extra spaces or `ns hanging around.

VL4DST3R commented 5 months ago

I came looking to report the same issue, glad I'm not the only one who found this inconsistent.