Continue was in a semi-working state. However, the generated prompt
by continue was a mess and didn't remove essential parts such as
character name and prompt bias. This caused duplication and bad
generations.
Now, append the prompt bias after the CFG has been appended and then
clean up the continued cache before adding it to the final prompt.
Signed-off-by: kingbri <bdashore3@proton.me>
Positive prompts are the opposite of negative prompts. This helps
make the mixing process more accurate by keeping the negative differences
as close as possible to the positive ones by including this prompt.
In addition, fix prompt insertion order at a depth of 0 by hijacking
the same function used for Author's Note as a zero depth anchor.
Signed-off-by: kingbri <bdashore3@proton.me>
Make the generate function build a negative prompt in addition to the
normal one. This allows for nonconflicting insertion with other extension
prompts and World Info.
Signed-off-by: kingbri <bdashore3@proton.me>
Insertion depth allows for CFG to variably inject itself into the
negative prompt. This is similar to how Author's note works.
However, this method of insertion depth conflicts with AN and
world info where negatives can be meshed between two lines
of those specific insertions.
A custom separator must be wrapped in quotes, otherwise the default
separator is a newline for negative cascading.
Signed-off-by: kingbri <bdashore3@proton.me>
CFG with LLMs works differently than stable diffusion. The main principle
is prompt mixing and utilizing the differences between the two prompts
rather than a full "negative prompt" of what the user doesn't want.
SillyTavern its own way of formatting a prompt sent to an LLM backend.
Therefore, take that prompt and add negatives to it.
Signed-off-by: kingbri <bdashore3@proton.me>
Groupchats have their CFG defined a little differently. Chat and
global CFGs are publicly accessible within the window. As a compromise,
individual character CFGs can be injected as part of each character's
prompt. However, these CFG settings need to be adjusted in the character's
individual chats which will carry over to the group.
In addition, make this character logic gated under a checkbox to
always prefer chat unless explicitly specified. Negative cascading
is still open, so individual character negatives can be included
at any time.
Signed-off-by: kingbri <bdashore3@proton.me>
This allows for flexibility with global, character, and chat negative
prompts. Combining prompts is very useful for users who want to maintain
a set of global negatives and then add extra layers on top of that. The
ordering is chat -> character -> global tags due to the specificity of
each.
The guidance scale follows the cascade of chat -> character -> global
due to being one number that is set when CFG is fired. If the guidance
scale is 1, nothing happens.
Signed-off-by: kingbri <bdashore3@proton.me>
Per-chat CFG applies a CFG setting per-chat only rather than character
or globally. This overrides all other CFG settings (this will be changed).
Also add fixes to remove character CFG entries properly and not to
apply CFG if the scale is 1 as that won't do anything to generation.
Signed-off-by: kingbri <bdashore3@proton.me>
Adds per-character CFG as a drop-in replacement for global CFG. If
the use character CFG checkbox isn't checked, the global one will be
used.
Signed-off-by: kingbri <bdashore3@proton.me>
CFG is bundled as an extension which is more flexible in terms of
storing settings and consolidating code.
Global CFG is currently supported and the old power user setting
is auto-migrated.
Signed-off-by: kingbri <bdashore3@proton.me>