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

Incorrect parsing of prompt with lora tags #269

Open KondPa opened 1 year ago

KondPa commented 1 year ago

Describe the bug If lora name with double underscore in it is used than dynamic prompt throws error

To Reproduce use prompt with lora that has double underscore in it "1girl, clothing , "

Are you using a local install or a colab?

local install

Expected behaviour Expected to ignore lora while parsing prompt since it doesn't use closing __ in it

Additional context Error running process: F:\AI_art\stable-diffusion-webui\extensions\sd-dynamic-prompts\scripts\dynamic_prompting.py Traceback (most recent call last): File "F:\AI_art\stable-diffusion-webui\modules\scripts.py", line 386, in process script.process(p, *script_args) File "F:\AI_art\stable-diffusion-webui\extensions\sd-dynamic-prompts\sd_dynamic_prompts\dynamic_prompting.py", line 423, in process all_prompts, all_negative_prompts = generate_prompts( File "F:\AI_art\stable-diffusion-webui\extensions\sd-dynamic-prompts\sd_dynamic_prompts\dynamic_prompting.py", line 84, in generate_prompts all_prompts = prompt_generator.generate(prompt, num_prompts) File "F:\AI_art\stable-diffusion-webui\venv\lib\site-packages\dynamicprompts\generators\randomprompt.py", line 47, in generate return list(self._sampler.generate_prompts(template, num_images)) File "F:\AI_art\stable-diffusion-webui\venv\lib\site-packages\dynamicprompts\samplers\base.py", line 50, in generate_prompts command = parse(prompt, parser_config=self._parser_config) File "F:\AI_art\stable-diffusion-webui\venv\lib\site-packages\dynamicprompts\parser\parse.py", line 257, in parse tokens = create_parser(parser_config=parser_config).parse_string( File "F:\AI_art\stable-diffusion-webui\venv\lib\site-packages\pyparsing\core.py", line 1141, in parse_string raise exc.withtraceback(None) pyparsing.exceptions.ParseException: Expected end of text, found '' (at char 63), (line:1, col:64)

adieyal commented 1 year ago

There's a PR that will be merged soon that will fix this: https://github.com/adieyal/dynamicprompts/pull/35

adieyal commented 1 year ago

v2.8.2 allows you to customise the wildcard prefix and suffix. Have a look in Settings under Dynamic Prompts