ljleb / prompt-fusion-extension

auto1111 webui extension for all sorts of prompt interpolations!
MIT License
259 stars 16 forks source link

Prompt fusion change seeds even if prompt has not any key words #83

Open RomanKuschanow opened 3 months ago

RomanKuschanow commented 3 months ago

I noticed that the extension changes the seeds a lot even when I don’t use keywords and the extension is turned off in the settings. The only thing that helps is completely disabling the entire extension in the extensions panel.

ljleb commented 3 months ago

Can you show an example of what it means to change the seed? Currently I am not sure if you are referring to the seed of the generation in the PNG info metadata, or the hash of the generated image, or something else.

I'm asking this because the extension does not fiddle at all with the seed saved in the PNG info in any way, and I'm not sure what "seed" refers to if it's not that.

RomanKuschanow commented 3 months ago

What I mean is that the extension affects the determinism of the seeds. When enabled, conditions become the same size (for example 154) and this affects the result. However, if you turn off the extension in settings (option prompt_fusion_enabled), the influence becomes less but is still present. It only disappears if you turn off the extension completely. I debugged the code but did not find the reason why this is happening.

If you need example images to understand what I mean, I can send them a little later.

Edited: There are 3 arts, without extension, with disabled in settings, and with enabled but without trigger words image image image

ljleb commented 3 months ago

That is odd. This is the kind of thing I test before merging code. Let me take a look.

ljleb commented 3 months ago

Apologies for the delay, I was just able to get to this. I am unable to reproduce this on forge. Can you provide which webui alternative you are using?

I suspect it maybe be related to this as, AFAIK, in A1111 and forge it does not affect the image to simply have the extension enabled. In particular, if you look at the code, the extension returns by using the original callback as soon as it can if it is soft disabled.

RomanKuschanow commented 3 months ago

I'm using A1111. I saw that the extension returns the original callback and so I don't understand the reason for this error. Also, I haven't noticed any impact from other extensions on this issue.

I use this CMD args in webui-user.bat: --api --opt-sdp-attention --opt-split-attention --opt-sub-quad-attention --xformers --reinstall-xformers --medvram --no-half-vae --no-hashing --disable-nan-check --allow-code --no-download-sd-model --administrator --disable-safe-unpickle

Maybe --opt-sdp-attention, --opt-split-attention, --opt-sub-quad-attention or --xformers might have some impact

ljleb commented 3 months ago

Thanks for the flags, I'll take another look at this eventually (unfortunately I'm not sure when I'll be able to do that exactly at the moment)

RomanKuschanow commented 3 months ago

I'll let you know if I find the reason or can fix it.

RomanKuschanow commented 2 months ago

Now I tried to check this error again, and it turned out that it was gone. More precisely, it exists, but only if the extension was enabled in the settings (Enable prompt-fusion extension) after restarting webui. In this case, you need to turn it off, generate one picture and turn it on again, after that everything will be fine, if there are no trigger words, everything is as before, if there is, the seed changes, if not again, everything is as it was. If the extension was disabled, then you can simply enable it and it will immediately work correctly.