hnmr293 / sd-webui-cutoff

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

PLEASE add Cutoff to Vladmantic #19

Open HarrisTerry opened 1 year ago

HarrisTerry commented 1 year ago

This version of Auto1111 has the perfect features, save one, this extension. Any possibility of making it work? I was testing it and it does not function with it, although it does not make error messages or anything, it just doesn't function.

10k thanks!

RealAzmodeo commented 1 year ago

I just tried it and looks like it just doesn't work. It's like it is ignored.

nekomimist commented 1 year ago

Try changing "Settings > Stable Diffusion > Prompt attention parser" to A1111 parser. In my vladmantic automatic environment, cutoff seems to work with this setting.

HarrisTerry commented 1 year ago

Will try today!

brknsoul commented 1 year ago

IMO changing the parser isn't really a solution. cutoff should really work regardless of the parser.

vladmandic commented 1 year ago

IMO changing the parser isn't really a solution. cutoff should really work regardless of the parser.

i agree. and full parser may work slightly differently internally, but the end result is fully compatible parsed prompt. what seems to happen is that this extension relies on erroneus , symbols left around by original parser - separator for cutoff should be explicit, not rely on leftovers since ',' on its own has no meaning and is stripped when appearing between terms.

HarrisTerry commented 1 year ago

If there is a separator for cutoff other than a comma, I would love to know! This extension makes different colors on things so much easier. Any way to delineate a separator like the comma, it could be anything.

lbeltrame commented 1 year ago

@vladmandic Are you referring to this part of the code? https://github.com/hnmr293/sd-webui-cutoff/blob/3a073e9c4525c21b72ae4645125768457c9c98e1/scripts/cutofflib/embedding.py#L173

I ask because there hasn't been any activity in this repo for a while, so I might want to take a stab at fixing this, however I have zero knowledge of how SD works (I'm good with Python, though).

vladmandic commented 1 year ago

that would be cool!

and yes, I am.

But there is a bigger conceptual problem - this extension relies that prompt parser will leave some bad artifacts such as , after its done so it can pick them up as separators. extension should not rely on any separator that can be changed/removed or in any way parsed by prompt parser, it should be an explicit separator used by this extension.

if you want to see how prompt goes in and what comes out from prompt parser, set env variable SD_PROMPT_DEBUG=1

brknsoul commented 1 year ago

I imagine using an extension specific character would be better; a woman, with #blue hair, wearing a #red shirt and a #green skirt Or something like that. This way, we wouldn't have to place the adjectives in the target tokens box, as the specific character would take the next word as the target token.

At the moment the following characters are already in used by SD or popular extenstions; [ ] { } ( ) | , : (square brackets, braces, parenthesis, vertical line, comma, and colon)

vladmandic commented 1 year ago

exactly. just need to select something simple and unique enough and not already taken by prompt parser - that's why there is debug output so you can see what comes out of the parser, not just what goes in.

lbeltrame commented 10 months ago

I think this fork (https://github.com/pmcculler/sd-webui-cutoff-in-prompt) uses a different separator (&), however I couldn't tell if it worked with SD.Next's parser or not.

vladmandic commented 10 months ago

seems to be working