ljleb / sd-webui-neutral-prompt

Collision-free AND keywords for a1111 webui!
MIT License
187 stars 13 forks source link

[Bug] Negative prompt with batch size 2+ #44

Closed Miczu closed 9 months ago

Miczu commented 1 year ago

So I started by disabling all extensions and I was able to narrow this bug specifically to sd-webui-neutral-prompt. I disabled all non-native extensions and left sd-webui-neutral-prompt and I was still able to reproduce this issue.

Setup: Prompt: 1girl Negative: gloomy Batch size: 2 Seed: 1

Step 1: generate, this will be reference two images Step 2: modify Negative to "gloomy, vibrant" Step 3: generate, you should already notice something weird with image 2 Step 4: modify Negative back to "gloomy" Step 5: generate - at this point image 2 should look weird and not match reference image from step 1.

This corruption can be fixed by modifying in any way positive prompt (needs to differ on generate), even comma will do.

It feels like some caching issue as detecting change on Positive fixes it, but negative part isn't forcing refresh in the overall prompt.

ljleb commented 1 year ago

Thanks for the detailed steps, I narrowed down the issue.

When you change the negative prompt, for some reason the webui uses the positive prompt function, which the extension hijacks to display the right number of tokens for the positive prompt. I'll make a PR for the webui if I find an opportunity in the code, and otherwise I'll see if there's anything I can do from the extension.

Miczu commented 1 year ago

Glad to hear the issue is reproducible and not just something on my end. Neutral prompt provides really cool and unique features, so looking forward to a resolution. I very appreciate your quick response and details on your findings!

ljleb commented 1 year ago

I submitted a PR to the webui as the issue originates from there. I'm not sure how long this could take.

For now, a workaround is to disable conds caching in the settings.

ljleb commented 9 months ago

Since webui==1.7.0-RC, this is fixed without needing to use the above workaround.