zixaphir / Stable-Diffusion-Webui-Civitai-Helper

Stable Diffusion Webui Extension for Civitai, to manage your model much more easily.
175 stars 24 forks source link

How to add trigger words to loras? #41

Closed TeKett closed 7 months ago

TeKett commented 8 months ago

I can see that i can "💡: Add this model's trigger words to prompt", but regular a1111 already has that feature and you can write your own list of tokens, except it don't work for XYZ prompt. Presumably your (or rather goldmojo's) extension pulls the trigger words from the civit page, but not all uploaders are smart enough to add the triggers to the correct field and instead post them in the description. So how can i add them manually myself, and do they work with XYZ prompt? Since im only looking for a way to add trigger words for XYZ prompt since i only make grids with multiple loras.

zixaphir commented 8 months ago

I recommend using webui's metadata editor to edit the trigger words and only using this extensions's trigger words functionally for keeping the original trigger words added by the author. The button currently only exists for backwards compatibility reasons and I have no intention of updating it unless it is explicitly broken by a future update to webui.

I think you mean prompt S/R? Prompt S/R has extremely strict requirements in how it processes prompts that make it incompatible with how most Lora authors write prompts (no spaces next to commas).

There is no plans to support adding prompts to prompt S/R.

TeKett commented 8 months ago

Yes, i use prompt S/R in order to load up a few hundred loras in succession in order to just blurt out a mass of images over a few days, however, this runs into the issue of not then having those loras trigger words. This leaves me to only be able to use loras that dont need trigger words, or live with less accurate loras.

If prompt S/R can modulate the prompt between generations, i dont see how checking the loras trigger and then adding it to the prompt in the same way is any different? Maybe it has to be done on a1111 side in order to call the function, but all it really is is just an append to a string.

zixaphir commented 7 months ago

You'd probably be better off writing a shim that can generate your Prompt S/R for you. This extension is not designed to account for all use-cases. Targeting arbitrary prompt inputs just isn't in the scope of this extension at the moment. Even extensions I use that add additional prompts, like ADetailer, are not getting code paths to account for their additions.