ThereforeGames / unprompted

Templating language written for Stable Diffusion workflows. Available as an extension for the Automatic1111 WebUI.
777 stars 66 forks source link

Dynamic Prompts not populating when Unprompted is enabled #40

Open masslevel opened 1 year ago

masslevel commented 1 year ago

When Unprompted and Dynamic Prompts are installed and you run a prompt using Dynamic Prompts syntax while Unprompted is enabled (using the UI checkbox), the prompts are not being updated for every generated image.

The prompt is being populated once and stays the same (except the seed that iterates +1) for the whole job. Doesn't matter which Batch count or Batch size is chosen.

For example: A cat in the __seasons__ where __seasons__ calls a text file via Dynamic Prompts, the prompt will be populated with for example A cat in the winter. Winter will stay locked for the whole job. It is not updating.

If I disable Unprompted using the UI checkbox it starts working again.

So of course I don't know if that is a problem with Unprompted or Dynamic Prompts.

As a potential quick workaround would it be possible to have a parameter for config_user.json that disables Unprompted by default so it can be turned on selectively?

Love the templates and idea behind Unprompted. Keep up the good work!

ThereforeGames commented 1 year ago

Hi @masslevel,

Thank you for reaching out! I will certainly see if I can get Unprompted to cooperate with Dynamic Prompts, but I wanted to quickly address one of your comments in the meantime:

As a potential quick workaround would it be possible to have a parameter for config_user.json that disables Unprompted by default so it can be turned on selectively?

The newest version of Unprompted allows you to disable the extension by default, simply add this to your config_user.json (I believe you will need to include the entire block for now):

"ui":
{
"enabled":false,
"wizard_enabled":true,
"wizard_default_shortcode":"txt2mask",
"wizard_autoinclude":false
}

Hope that helps.

masslevel commented 1 year ago

Hi @ThereforeGames,

thank you for your quick reply and the info about the enabled parameter. This helps!

I'm looking forward to integrate Unprompted more into my workflow. I especially like that you're also able to use settings (steps, cfg) in the templates. This is really powerful. Good stuff!

masslevel commented 1 year ago

"enabled": false, is not working for me. I updated to the latest version, added the ui snippet to the config_user.json, with and without the content of config.json, but unprompted stays enabled at startup.

As a test I also edited the default config.json and set enabled to false and it's still enabled on startup.

Just wanted to let you know. I'm not sure if I'm doing something wrong.

ThereforeGames commented 1 year ago

Huh, I'm sort of perplexed by this, but it appears that giving the checkbox a label is interfering with its default state. Possibly a Gradio bug?

Here's a modified version of unprompted.pythat should fix the problem:

https://pastebin.com/sqyhQnhC

It goes in the extensions/unprompted/scripts folder, replacing what's already there.

Will run some more tests to figure out what the heck's going on with the label. Thanks for bringing it to my attention.

masslevel commented 1 year ago

Thank you for your time, @ThereforeGames . Your modified version works - it's disabled now when webui has started or the page is refreshed. I still have to test functionality.

Just as a note for you (totally unimportant for this): the checkbox label is now named checkbox instead of Enabled.

I will do some tests now :-). Thank you!

magejosh commented 1 year ago

Yeah, i would love to be able to use the wildcards from Dynamic Prompts with the unprompted shortcode simultaneously. I've invested time into curating my wildcards, and would like to combine those elements and the variations dynamic prompts can create with them while using unprompted to establish the subject or style to start with. For example, a simple prompt like this: [file pro/fantasy_card/main], pop-loc, midjourney-1500, SDA768 Should pick a fantasy_card/main subject, add a random popular location from the pop-loc.txt file in the wildcards folder, and then apply the textual inversion embeddings i tagged there at the end. Instead i get errors. It still generates, but the unprompted shortcode fails to function. At least according to the prompt parameters, since it still shows [file pro/fantasy_card/main] but the wildcard has been replaced with its random value that was inserted.

adieyal commented 1 year ago

@magejosh this was a while ago, but do you have an error message we can look at?

magejosh commented 1 year ago

Haven't tried to combine both since then, just been swapping out depending on use case needs. To reproduce, add the two extensions and input a txt2img positive prompt using both unprompted short code and any of the Dynamic Prompts wildcards

I will try to reproduce and return the error I get soon as I can.