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

$ in promt creates Error message

Open rin-development opened this issue 9 months ago • 3 comments

Issue: Parsing Error with $ in Tags in Dynamic Prompts

Description When using a wildcard file containing references, I encountered a parsing error caused by $ characters in certain tags. Since $ is reserved in Dynamic Prompts for variable substitution, this results in a parsing error. For example,this issue arises when a LoRA creator includes a $ in the trigger tag, often to stylize a name (e.g., $tephanie instead of Stephanie). Since $ is reserved in Dynamic Prompts for variable substitution, this results in a parsing error.

Steps to Reproduce

  1. Use a wildcard file that includes references with $ in their tags.
  2. Include __your_wildcard__ in a prompt.
  3. Generate an image using Dynamic Prompts (preferrably using combinatorial, as this will always parse the line in question).

Expected Behavior

  • $ in tags should either be escaped properly or ignored by the parser to prevent a crash.

Question

Is there currently a way to escape the $ character in tags? If not, could this be implemented in a future update?

Thanks for your great work on this extension! 😊

rin-development avatar Feb 18 '25 13:02 rin-development

dang it! same problem, was hoping you can escape it but can't find a way to

timwillhack avatar Jun 13 '25 21:06 timwillhack

That might be too late, but it can help others.

I had the same issue after reinstalling Forge, the problem seems to be an update of pyparsing

* Go into venv/scripts/

* Open a cmd and type `activate` (this will open the python command for your virtual environnement)

* Type `pip show pyparsing`

* Mine was showing 3.2.4

* Installing pyparsing 3.2.3 fixed the issue for me. `pip install pyparsing==3.2.3`

hey I had the same problem but I was on an older pyparsing version, updating didnt help do you know exactly what caused this? I know the parser cant comprehend $ in the regular prompt because of the variables

Z3TOR avatar Sep 16 '25 02:09 Z3TOR