mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
CFG: Add positive prompt support and fixes
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>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<small>
|
||||
<b>Unique to this chat.</b><br>
|
||||
</small>
|
||||
<label for="chat_cfg_negative_prompt">
|
||||
<label for="chat_cfg_guidance_scale">
|
||||
<span data-i18n="Scale">Scale</span>
|
||||
<small data-i18n="1 = disabled">1 = disabled</small>
|
||||
</label>
|
||||
@@ -33,6 +33,11 @@
|
||||
<span data-i18n="Negative Prompt">Negative Prompt</span>
|
||||
</label>
|
||||
<textarea id="chat_cfg_negative_prompt" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]write short replies, write replies using past tense" placeholder="write short replies, write replies using past tense"></textarea>
|
||||
|
||||
<label for="chat_cfg_positive_prompt">
|
||||
<span data-i18n="Positive Prompt">Positive Prompt</span>
|
||||
</label>
|
||||
<textarea id="chat_cfg_positive_prompt" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]write short replies, write replies using past tense" placeholder="write short replies, write replies using past tense"></textarea>
|
||||
</div>
|
||||
<div id="groupchat_cfg_use_chara_container">
|
||||
<label class="checkbox_label" for="groupchat_cfg_use_chara">
|
||||
@@ -53,7 +58,7 @@
|
||||
<div class="inline-drawer-content">
|
||||
<small><b>Will be automatically added as the CFG for this character.</b></small>
|
||||
<br />
|
||||
<label for="chara_cfg_negative_prompt">
|
||||
<label for="chara_cfg_guidance_scale">
|
||||
<span data-i18n="Scale">Scale</span>
|
||||
<small data-i18n="1 = disabled">1 = disabled</small>
|
||||
</label>
|
||||
@@ -72,6 +77,11 @@
|
||||
<span data-i18n="Negative Prompt">Negative Prompt</span>
|
||||
</label>
|
||||
<textarea id="chara_cfg_negative_prompt" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]write short replies, write replies using past tense" placeholder="write short replies, write replies using past tense"></textarea>
|
||||
|
||||
<label for="chara_cfg_positive_prompt">
|
||||
<span data-i18n="Positive Prompt">Positive Prompt</span>
|
||||
</label>
|
||||
<textarea id="chara_cfg_positive_prompt" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]write short replies, write replies using past tense" placeholder="write short replies, write replies using past tense"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,7 +96,7 @@
|
||||
<div class="inline-drawer-content">
|
||||
<small><b>Will be used as the default CFG options for every chat unless overridden.</b></small>
|
||||
<br />
|
||||
<label for="global_cfg_negative_prompt">
|
||||
<label for="global_cfg_guidance_scale">
|
||||
<span data-i18n="Scale">Scale</span>
|
||||
<small data-i18n="1 = disabled">1 = disabled</small>
|
||||
</label>
|
||||
@@ -105,49 +115,54 @@
|
||||
<span data-i18n="Negative Prompt">Negative Prompt</span>
|
||||
</label>
|
||||
<textarea id="global_cfg_negative_prompt" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]write short replies, write replies using past tense" placeholder="write short replies, write replies using past tense"></textarea>
|
||||
|
||||
<label for="global_cfg_positive_prompt">
|
||||
<span data-i18n="Positive Prompt">Negative Prompt</span>
|
||||
</label>
|
||||
<textarea id="global_cfg_positive_prompt" rows="2" class="text_pole textarea_compact" data-i18n="[placeholder]write short replies, write replies using past tense" placeholder="write short replies, write replies using past tense"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="cfg_negative_combine_container">
|
||||
<div id="cfg_prompt_combine_container">
|
||||
<hr class="sysHR">
|
||||
<div class="inline-drawer">
|
||||
<div id="defaultANBlockToggle" class="inline-drawer-toggle inline-drawer-header">
|
||||
<b>Negative Cascading</b>
|
||||
<b>CFG Prompt Cascading</b>
|
||||
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
|
||||
</div>
|
||||
<div class="inline-drawer-content">
|
||||
<div class="flex-container flexFlowColumn">
|
||||
<small>
|
||||
<b>Combine negative prompts from other boxes.</b>
|
||||
<b>Combine positive/negative prompts from other boxes.</b>
|
||||
<br />
|
||||
For example, ticking the chat, global, and character boxes combine all negative prompts into a comma-separated string.
|
||||
</small>
|
||||
</div>
|
||||
<br />
|
||||
<div class="flex-container flexFlowColumn">
|
||||
<label for="cfg_negative_combine">
|
||||
<label for="cfg_prompt_combine">
|
||||
<span data-i18n="Scale">Always Include</span>
|
||||
</label>
|
||||
<label class="checkbox_label">
|
||||
<input type="checkbox" name="cfg_negative_combine" value="0" />
|
||||
<input type="checkbox" name="cfg_prompt_combine" value="0" />
|
||||
<span data-i18n="Chat Negatives">Chat Negatives</span>
|
||||
</label>
|
||||
<label class="checkbox_label">
|
||||
<input type="checkbox" name="cfg_negative_combine" value="1" />
|
||||
<input type="checkbox" name="cfg_prompt_combine" value="1" />
|
||||
<span data-i18n="Character Negatives">Character Negatives</span>
|
||||
</label>
|
||||
<label class="checkbox_label">
|
||||
<input type="checkbox" name="cfg_negative_combine" value="2" />
|
||||
<input type="checkbox" name="cfg_prompt_combine" value="2" />
|
||||
<span data-i18n="Global Negatives">Global Negatives</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex-container flexFlowColumn">
|
||||
<label>
|
||||
Custom Separator: <input id="cfg_negative_separator" class="text_pole textarea_compact widthUnset" placeholder=""\n"" type="text" />
|
||||
Custom Separator: <input id="cfg_prompt_separator" class="text_pole textarea_compact widthUnset" placeholder=""\n"" type="text" />
|
||||
</label>
|
||||
<label>
|
||||
Insertion Depth: <input id="cfg_negative_insertion_depth" class="text_pole widthUnset" type="number" min="0" max="99" />
|
||||
Insertion Depth: <input id="cfg_prompt_insertion_depth" class="text_pole widthUnset" type="number" min="0" max="99" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user