InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Allow wildcard wordlist files with dynamic prompting

Open Jonseed opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

Add the ability to use wildcard files with dynamic prompting. It looks like the node could have had it, but it was not added because there was no way to handle the path to the wildcard directory. Could this option be added in now?

Wildcards via wordlist files Implemented, but we don't have a simple way to handle the path to the wildcard directory yet, so I didn't include it. This is super straightforward to add back in later.

Alternatives

No response

Additional Content

No response

Jonseed avatar Sep 30 '24 19:09 Jonseed

I think we'd want to provide the user a list of wildcards for this to be usable.

Here's what I'm thinking we'd need:

  • Endpoint to list all wildcards
  • UI component to show the list and perhaps allow for easy insertion, same as we do now w/ prompt triggers
  • Maybe a way to upload wildcard lists through the UI - though this would imply a small service or internal API to manage the folder... maybe we could kinda skip the complexity there and make this a wholly user-managed folder?

Any thoughts about the UX for this feature?

psychedelicious avatar Oct 03 '24 05:10 psychedelicious

There are several wildcard collections provided by the original author of dynamic prompts that we could use. I think a wholly user-managed folder would be fine. We could just have a place in the UI (Dynamic Prompts dialog?) where you specify your wildcards folder. The syntax in Auto/Forge is __wildcardfile__ which I think works fine. The extension for Auto1111/Forge does have its own page for viewing and editing the wildcard lists (the Wildcards Manager), but this might not be necessary. It lets you search through your wildcard names, and see the wildcards in each file, adding or removing wildcards as needed. It's handy, but not strictly necessary. Maybe something like that could be integrated into the Dynamic Prompts dialog box currently used for organizing the queue, setting seed behavior, and max prompts.

Jonseed avatar Oct 03 '24 21:10 Jonseed

Thanks.

  • Does the extension's editor UI present you with the wildcard lists as raw data (e.g. JSON, CSV, YAML) or is there a "proper" UI for editing the strings?
  • Does the extension editor feel good to use? Any pain points or missing features?
  • Can you please link to the extension's repo?

Note - these are just exploratory questions, not making any commitment to work on this any time soon

psychedelicious avatar Oct 03 '24 22:10 psychedelicious

The extension's editor UI presents the list of wildcards as a simple list of every file in the folder, with subfolders in collapsible/expandable trees. I'm not sure how this data is listed. You can search for terms in the wildcard filenames, which narrows the list displayed. After clicking on one of these wildcard files, its contents are shown as a simple text area on the right of the list. You can change a wildcard there, add, or delete, each wildcard on its own line, and then there is a button to save the file. I think the extension editor works fine. Perhaps we could use the same implementation in the dynamic prompts dialog. Here is the repo: https://github.com/adieyal/sd-dynamic-prompts

These wildcard files can themselves contain wildcards in the standard {|} format, and even include other wildcard files as __wildcardfile__, which makes for some cool dynamic prompting possibilities.

Jonseed avatar Oct 03 '24 22:10 Jonseed

Great, thanks for the detail.

psychedelicious avatar Oct 03 '24 22:10 psychedelicious