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.05k stars 263 forks source link

FEATURE REQUEST: ability to create wildcards from prompt box #427

Open PaperOrb opened 1 year ago

PaperOrb commented 1 year ago

I'm not sure what the obstacles would be, but I was thinking how annoying it is needing to leave the prompting box to go the wildcards tab or to go to the file explorer to add/edit wildcard files.

What if instead we could edit, create, or delete wildcards from the promptbox? A rough outline would be you'd have wildcard:{contents}. When you click a GUI button, all instances of :{contents} in the promptbox would get appended to the preceeding wildcard file, or create said wildcard file if it doesn't exist.

So an example prompt would be: portrait, boy with __colors__:{red|green|blue} __clothing__{hat|scarf|jacket} in a snowy forest

Red, green, and blue would get appended to the colors wildcard file, each on a separate line. Obviously it could get as complicated as you want it to be, but that's a simple demo. I obviously didn't cover tons of cases like syntax for deleting a wildcard and so on.

adieyal commented 1 year ago

I get that the ability to create a new wildcard file is missing from the wildcard manager, but I don't understand the value in adding wildcards from the prompt box. It seems like the effort in adding those wildcards using the existing functionality is minimal but perhaps I'm wrong?

PaperOrb commented 1 year ago

It's far fewer button presses, which really adds up if you're rapidly iterating/testing different prompt setups. For me, it's the same logic as using hotkeys--it's faster and feels less frustrating, especially when doing it a lot.