hnmr293 / sd-webui-cutoff

Cutoff - Cutting Off Prompt Effect
Other
1.2k stars 85 forks source link

fails if negative tokens over 75 #11

Open akari-1129 opened 1 year ago

akari-1129 commented 1 year ago

when i try using the extension with a negative embedding that puts the token count over 75 it does this Capture

works fine without it, also works fine regardless of how high the positive token count is

tarpeyd12 commented 1 year ago

For your specific prompt: try changing [deepnegative:0.2] to (deepnegative:0.2).

Though this is certainly a problem with [from:to:when] constructions in the negative prompt.

hnmr293 commented 1 year ago

Okay, I've confirmed it is reproducible. This problem is caused by a combination of sevaral factors.

  1. You are using a large negative prompt over 75 tokens. I think deepnegative in your negative prompt is a TI such a ng_deepnegative_v1_64t or ng_deepnegative_v1_75t of https://civitai.com/models/4629/deep-negative-v1x. Right? They consist of 64 or 75 tokens.
  2. You are using prompt editing - whether you intended to or not. And its "before" and "after" token counts are different. You have not specified a "before" prompt, so the "before" token count is 0. On the other hand, the "after" token count is the deepnegative's token count, 64 or 75.
  3. As a result of that, various things have happened. Thus they led to the error.

This is a bug. But it is very hard to fix for me. If I can come up with a better way, I will work on it.

For workaround, as @tarpeyd12 said, use (deepnegative:0.2). Perhaps that is what you really want to do. If not, and you really want to use prompt editing, ... I can't figure out a good way which might solve your problem right away. Sorry.

akari-1129 commented 1 year ago
  1. You are using prompt editing - whether you intended to or not.

it was intentional but i guess i'll have to do without it when using this exension. hopefully you can work it out someday, it works great otherwise