adieyal / sd-dynamic-prompts

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

Replace parser with something more lenient #778

Open akx opened 1 month ago

akx commented 1 month ago

We'd want a parser that's more lenient and would process things that don't smell like valid syntax as just literals.

This would fix e.g. #750, #777, #755, etc.

Maybe... https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html

odie5533 commented 1 month ago

As a shorter-term solution, slightly better error reporting would be very helpful:

TBH the yaml syntax I saw seemed fine? Just in my case I had no idea what the underlying issue was