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.04k stars 262 forks source link

Replace parser with something more lenient #778

Open akx opened 5 months ago

akx commented 5 months 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 5 months 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