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

Empty custom separators?

Open pmcculler opened this issue 1 year ago • 3 comments

I'd like to directly concatenate selections with a customer separator.

Using a space works: {1-2$$ $$::pgm_poses::} but doesn't just concatenate the results, there's a space between them, of course.

Using no space causes a syntax error: {1-2$$$$::pgm_poses::}

Does this mean I must use a syntax like the below to achieve my goal?

{::pgm_poses::}{0-1$$::pgm_poses::}

If it's not too much trouble, I think supporting empty custom separators would enable more elegant prompt code.

pmcculler avatar Jul 24 '23 20:07 pmcculler

Unfortunately the parser doesn't currently handle empty spaces. You're right, it really should be supported. I'll look into it when I get a chance.

adieyal avatar Jul 25 '23 19:07 adieyal

Thanks much! If you point me to the place to look maybe I can figure out what to do? Dynamic Prompts code is a little sprawling, at least from my hobbyist perspective. 😄

pmcculler avatar Jul 27 '23 17:07 pmcculler

You can have a look at the parser - https://github.com/adieyal/dynamicprompts/blob/main/src/dynamicprompts/parser/parse.py

It's probably a small fix but I haven't had time to look into it.

adieyal avatar Jul 27 '23 21:07 adieyal