Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging

This commit is contained in:
Cohee 2023-11-02 20:05:44 +02:00
commit a1df95592c
10 changed files with 551 additions and 506 deletions

View File

@ -62,23 +62,24 @@
.margin-bot-10px,
.marginBot10 {
margin-bottom: 10px;
margin-bottom: 10px !important;
}
.marginTop10 {
margin-top: 10px;
margin-top: 10px !important;
}
.marginBot5 {
margin-bottom: 5px;
margin-bottom: 5px !important;
}
.marginTop5 {
margin-top: 5px;
margin-top: 5px !important;
}
.marginTopBot5 {
margin: 5px 0;
margin-top: 5px !important;
margin-bottom: 5px !important;
}
.margin5 {
@ -113,6 +114,10 @@
align-self: start;
}
.gap0 {
gap: 0 !important;
}
.gap3px {
gap: 3px !important;
}
@ -125,6 +130,14 @@
gap: 10px !important;
}
.gap10h20v {
gap: 10px 20px !important;
}
.gap10h5v {
gap: 5px 10px !important;
}
.wide10pMinFit {
width: 10%;
min-width: fit-content;
@ -212,6 +225,22 @@
display: flex;
}
.flexBasis50p {
flex-basis: 50%
}
.flexBasis25p {
flex-basis: 25%
}
.flexBasis200px {
flex-basis: 200px
}
.flexBasis48p {
flex-basis: 48%
}
.flex-container {
display: flex;
gap: 5px;
@ -226,6 +255,10 @@
flex-grow: 1;
}
.flexShrink {
flex-shrink: 1
}
.flexnowrap {
flex-wrap: nowrap;
}
@ -304,10 +337,6 @@
flex: 50%;
}
.wide50p {
width: 50% !important;
}
.wide25p {
width: 25%;
}
@ -473,4 +502,16 @@ textarea:disabled {
.opacity1 {
opacity: 1 !important;
}
.circleborder30px {
right: 30px;
top: 10px;
position: absolute;
border: 1px solid var(--SmartThemeBodyColor);
border-radius: 100%;
aspect-ratio: 1 / 1;
height: 30px;
text-align: center;
padding: 5px;
}

View File

@ -122,13 +122,14 @@
<div data-i18n="clickslidertips" class="toggle-description wide100p editable-slider-notification">
Click slider numbers to input manually.
</div>
<a href="https://docs.sillytavern.app/usage/api-connections/koboldai/" target="_blank" title="Improved Samplers documentation coming soon."><span name="samplerHelpButton" class="note-link-span topRightInset fa-solid fa-circle-question"></span></a>
<div class="scrollableInner">
<div class="flex-container" id="ai_response_configuration">
<div id="respective-presets-block" class="width100p">
<div id="kobold_api-presets">
<h4 class="margin0"><span data-i18n="kobldpresets">Kobold Presets</span>
<a href="https://docs.sillytavern.app/usage/api-connections/koboldai/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<div class="flex-container">
@ -147,7 +148,7 @@
<h4 class="margin0">
<span data-i18n="novelaipreserts">NovelAI Presets</span>
<a href="https://docs.sillytavern.app/usage/api-connections/novelai/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<div class="flex-container">
@ -212,47 +213,36 @@
</div>
<div id="common-gen-settings-block" class="width100p">
<div id="pro-settings-block">
<div id="amount_gen_block" class="range-block">
<div class="range-block-title" data-i18n="response legth(tokens)">
Response Length (tokens)
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="amount_gen" name="volume" min="16" max="1024" step="1">
</div>
<div class="range-block-counter" data-randomization-disabled="true">
<input type="number" min="16" max="1024" step="1" data-for="amount_gen" id="amount_gen_counter">
<div id="pro-settings-block" class="flex-container gap10h5v justifyCenter">
</div>
</div>
<div id="amount_gen_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="response legth(tokens)">
<small>Response Length (tokens)</small>
<input class="neo-range-slider" type="range" id="amount_gen" name="volume" min="16" max="1024" step="1">
<div data-randomization-disabled="true" class="wide100p">
<input class="neo-range-input" type="number" min="16" max="1024" step="1" data-for="amount_gen" id="amount_gen_counter">
</div>
<div id="streaming_textgenerationwebui_block" class="flex-container alignitemscenter justifyCenter marginTop5">
<label class="checkbox_label" for="streaming_textgenerationwebui">
<input type="checkbox" id="streaming_textgenerationwebui" />
<small data-i18n="Streaming">Stream
<div class="margin5 fa-solid fa-circle-info opacity50p " title="Display the response bit by bit as it is generated.&#13;When this is off, responses will be displayed all at once when they are complete."></div>
</small>
</label>
</div>
</div>
<div id="max_context_block" class="range-block">
<div class="range-block-title" data-i18n="context size(tokens)">
Context Size (tokens)
<div id="max_context_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="context size(tokens)">
<small>Context Size (tokens)</small>
<input class="neo-range-slider" type="range" id="max_context" name="volume" min="512" max="8192" step="64">
<div data-randomization-disabled="true" class="wide100p">
<input class="neo-range-input" type="number" min="512" max="8192" step="64" data-for="max_context" id="max_context_counter">
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="max_context" name="volume" min="512" max="8192" step="64">
</div>
<div class="range-block-counter" data-randomization-disabled="true">
<input type="number" min="512" max="8192" step="64" data-for="max_context" id="max_context_counter">
</div>
</div>
</div>
<div class="max_context_unlocked_block">
<label class="checkbox_label">
<input id="max_context_unlocked" type="checkbox" />
<span data-i18n="unlocked">Unlocked</span>
</label>
<div id="max_context_unlocked_warning" class="toggle-description justifyLeft widthUnset">
<span data-i18n="Only select models support context sizes greater than 4096 tokens. Increase only if you know what you're doing.">
Only select models support context sizes greater than 4096 tokens.
Increase only if you know what you're doing.
</span>
<div class="flex-container alignitemscenter justifyCenter marginTop5" id="max_context_unlocked_block">
<label class="checkbox_label">
<input id="max_context_unlocked" type="checkbox" />
<small data-i18n="unlocked">Unlocked
<div id="max_context_unlocked_warning" class="fa-solid fa-circle-info opacity50p " title="Only select models support context sizes greater than 4096 tokens.&#13;Increase only if you know what you're doing."></div>
</small>
</label>
</div>
</div>
</div>
@ -460,129 +450,62 @@
</div>
</div>
<div id="range_block_textgenerationwebui">
<div class="range-block">
<label class="checkbox_label" for="streaming_textgenerationwebui">
<input type="checkbox" id="streaming_textgenerationwebui" />
<span data-i18n="Streaming">Streaming</span>
</label>
<div class="toggle-description justifyLeft">
<span data-i18n="Display the response bit by bit as it is generated.">
Display the response bit by bit as it is generated.</span><br>
<span data-i18n="When this is off, responses will be displayed all at once when they are complete.">
When this is off, responses will be displayed all at once when they are complete.
</span>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="temperature">
Temperature
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="temp_textgenerationwebui" name="volume" min="0.0" max="2.0" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="0.0" max="2.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui">
<div class="flex-container gap10h5v justifyCenter">
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="temperature">
<small>Temperature
</div>
</small>
<input class="neo-range-slider" type="range" id="temp_textgenerationwebui" name="volume" min="0.0" max="2.0" step="0.01" x-setting-id="temp">
<input type="number" class="neo-range-input" min="0.0" max="2.0" step="0.01" data-for="temp_textgenerationwebui" id="temp_counter_textgenerationwebui">
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="rep.pen">
Repetition Penalty
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="rep_pen_textgenerationwebui" name="volume" min="1" max="1.5" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="1" max="1.5" step="0.01" data-for="rep_pen_textgenerationwebui" id="rep_pen_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="rep.pen">
<small>Repetition Penalty
</div>
</small>
<input class="neo-range-slider" type="range" id="rep_pen_textgenerationwebui" name="volume" min="1" max="1.5" step="0.01">
<input class="neo-range-input" type="number" min="1" max="1.5" step="0.01" data-for="rep_pen_textgenerationwebui" id="rep_pen_counter_textgenerationwebui">
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="rep.pen range">
Repetition Penalty Range
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="0" max="4096" step="1">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="4096" step="1" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="rep.pen range">
<small>Repetition Penalty Range
</div>
</small>
<input class="neo-range-slider" type="range" id="rep_pen_range_textgenerationwebui" name="volume" min="0" max="4096" step="1">
<input class="neo-range-input" type="number" min="0" max="4096" step="1" data-for="rep_pen_range_textgenerationwebui" id="rep_pen_range_counter_textgenerationwebui">
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="Encoder Rep. Pen.">
Encoder Repetition Penalty
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="encoder_rep_pen_textgenerationwebui" name="volume" min="0.8" max="1.5" step="0.01" />
</div>
<div class="range-block-counter">
<input type="number" min="0.8" max="1.5" step="0.01" data-for="encoder_rep_pen_textgenerationwebui" id="encoder_rep_pen_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Encoder Rep. Pen.">
<small>Encoder Repetition Penalty
</div>
</small>
<input class="neo-range-slider" type="range" id="encoder_rep_pen_textgenerationwebui" name="volume" min="0.8" max="1.5" step="0.01" />
<input class="neo-range-input" type="number" min="0.8" max="1.5" step="0.01" data-for="encoder_rep_pen_textgenerationwebui" id="encoder_rep_pen_counter_textgenerationwebui">
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="Frequency Penalty">
Frequency Penalty
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="freq_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
</div>
<div class="range-block-counter">
<input type="number" data-for="freq_pen_textgenerationwebui" min="-2" max="2" step="0.01" id="freq_pen_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Frequency Penalty">
<small>Frequency Penalty
</div>
</small>
<input class="neo-range-slider" type="range" id="freq_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
<input class="neo-range-input" type="number" data-for="freq_pen_textgenerationwebui" min="-2" max="2" step="0.01" id="freq_pen_counter_textgenerationwebui">
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="Presence Penalty">
Presence Penalty
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="presence_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
</div>
<div class="range-block-counter">
<input type="number" min="-2" max="2" step="0.01" data-for="presence_pen_textgenerationwebui" id="presence_pen_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Presence Penalty">
<small>Presence Penalty
</div>
</small>
<input class="neo-range-slider" type="range" id="presence_pen_textgenerationwebui" name="volume" min="-2" max="2" step="0.01" />
<input class="neo-range-input" type="number" min="-2" max="2" step="0.01" data-for="presence_pen_textgenerationwebui" id="presence_pen_counter_textgenerationwebui">
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="No Repeat Ngram Size">
No Repeat Ngram Size
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="no_repeat_ngram_size_textgenerationwebui" name="volume" min="0" max="20" step="1">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="20" step="1" data-for="no_repeat_ngram_size_textgenerationwebui" id="no_repeat_ngram_size_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="No Repeat Ngram Size">
<small>No Repeat Ngram Size
</div>
</small>
<input class="neo-range-slider" type="range" id="no_repeat_ngram_size_textgenerationwebui" name="volume" min="0" max="20" step="1">
<input class="neo-range-input" type="number" min="0" max="20" step="1" data-for="no_repeat_ngram_size_textgenerationwebui" id="no_repeat_ngram_size_counter_textgenerationwebui">
</div>
</div>
<div data-newbie-hidden class="range-block">
<div class="range-block-title" data-i18n="Min Length">
Min Length
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="min_length_textgenerationwebui" name="volume" min="0" max="2000" step="1" />
</div>
<div class="range-block-counter">
<input type="number" min="0" max="2000" step="1" data-for="min_length_textgenerationwebui" id="min_length_counter_textgenerationwebui">
<div data-newbie-hidden class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Min Length">
<small>Min Length
</div>
</small>
<input class="neo-range-slider" type="range" id="min_length_textgenerationwebui" name="volume" min="0" max="2000" step="1" />
<input class="neo-range-input" type="number" min="0" max="2000" step="1" data-for="min_length_textgenerationwebui" id="min_length_counter_textgenerationwebui">
</div>
</div>
</div>
@ -922,9 +845,7 @@
</div>
</div>
</div>
<hr>
</div>
<div data-newbie-hidden id="advanced-ai-config-block" class="width100p">
<div data-newbie-hidden id="kobold_api-settings">
<div id="kobold-advanced-config">
@ -942,6 +863,20 @@
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Min P">
Min P
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="min_p" name="volume" min="0" max="1" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="1" step="0.01" data-for="min_p" id="min_p_counter">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Top A">
Top A
@ -1106,7 +1041,7 @@
<small>1</small>
</div>
<div data-id="2">
<span data-i18n="Top P">Top P</span>
<span data-i18n="Top P">Top P & Min P</span>
<small>2</small>
</div>
<div data-id="3">
@ -1350,298 +1285,187 @@
</div>
</div>
<div data-newbie-hidden id="textgenerationwebui_api-settings">
<div class="range-block">
<div class="range-block-title" data-i18n="Top K">
Top K
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="top_k_textgenerationwebui" name="volume" min="0" max="200" step="1">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="200" step="1" data-for="top_k_textgenerationwebui" id="top_k_counter_textgenerationwebui">
<div class="flex-container gap10h5v justifyCenter">
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Top K">
<small>Top K</small>
<input class="neo-range-slider" type="range" id="top_k_textgenerationwebui" name="volume" min="0" max="200" step="1">
<input class="neo-range-input" type="number" min="0" max="200" step="1" data-for="top_k_textgenerationwebui" id="top_k_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Top P">
<small>Top P</small>
<input class="neo-range-slider" type="range" id="top_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
<input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_p_textgenerationwebui" id="top_p_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Typical P">
<small>Typical P</small>
<input class="neo-range-slider" type="range" id="typical_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
<input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="typical_p_textgenerationwebui" id="typical_p_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Top A">
<small>Top A</small>
<input class="neo-range-slider" type="range" id="top_a_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
<input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="top_a_textgenerationwebui" id="top_a_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Tail Free Sampling">
<small>Tail Free Sampling</small>
<input class="neo-range-slider" type="range" id="tfs_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
<input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="tfs_textgenerationwebui" id="tfs_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Epsilon Cutoff">
<small>Epsilon Cutoff</small>
<input class="neo-range-slider" type="range" id="epsilon_cutoff_textgenerationwebui" name="volume" min="0" max="9" step="0.01">
<input class="neo-range-input" type="number" min="0" max="9" step="0.01" data-for="epsilon_cutoff_textgenerationwebui" id="epsilon_cutoff_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0" data-i18n="Eta Cutoff">
<small>Eta Cutoff</small>
<input class="neo-range-slider" type="range" id="eta_cutoff_textgenerationwebui" name="volume" min="0" max="20" step="0.01">
<input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="eta_cutoff_textgenerationwebui" id="eta_cutoff_counter_textgenerationwebui">
</div>
<div name="checkboxes" class="flex-container flexFlowColumn flexBasis48p flexGrow flexShrink ">
<div class="justifyCenter">
<label class="checkbox_label" for="do_sample_textgenerationwebui">
<input type="checkbox" id="do_sample_textgenerationwebui" />
<small data-i18n="Do Sample">Do Sample</small>
</label>
<label class="checkbox_label" for="add_bos_token_textgenerationwebui">
<input type="checkbox" id="add_bos_token_textgenerationwebui" />
<small data-i18n="Add BOS Token">Add BOS Token
<div class="fa-solid fa-circle-info opacity50p " data-i18n="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative." title="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative."></div>
</small>
</label>
<label class="checkbox_label" for="ban_eos_token_textgenerationwebui">
<input type="checkbox" id="ban_eos_token_textgenerationwebui" />
<small data-i18n="Ban EOS Token">Ban EOS Token
<div class="fa-solid fa-circle-info opacity50p " data-i18n="Ban the eos_token. This forces the model to never end the generation prematurely" title="Ban the eos_token. This forces the model to never end the generation prematurely."></div>
</small>
</label>
<label class="checkbox_label" for="skip_special_tokens_textgenerationwebui">
<input type="checkbox" id="skip_special_tokens_textgenerationwebui" />
<small data-i18n="Skip Special Tokens">Skip Special Tokens</small>
</label>
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Top P">
Top P
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="top_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="1" step="0.01" data-for="top_p_textgenerationwebui" id="top_p_counter_textgenerationwebui">
<div name="miroStatBlock">
<h4 class="wide100p textAlignCenter" data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat
<div class=" fa-solid fa-circle-info opacity50p " title="Mode=1 is only for llama.cpp&#13;More helpful tips coming soon."></div>
</h4>
<div class="flex-container flexFlowRow gap10px flexShrink">
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0" data-i18n="Mirostat Mode">
<small>Mode</small>
<input class="neo-range-slider" type="range" id="mirostat_mode_textgenerationwebui" name="volume" min="0" max="2" step="1" />
<input class="neo-range-input" type="number" min="0" max="2" step="1" data-for="mirostat_mode_textgenerationwebui" id="mirostat_mode_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0" data-i18n="Mirostat Tau">
<small>Tau</small>
<input class="neo-range-slider" type="range" id="mirostat_tau_textgenerationwebui" name="volume" min="0" max="20" step="0.01" />
<input class="neo-range-input" type="number" min="0" max="20" step="0.01" data-for="mirostat_tau_textgenerationwebui" id="mirostat_tau_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0" data-i18n="Mirostat Eta">
<small>Eta</small>
<input class="neo-range-slider" type="range" id="mirostat_eta_textgenerationwebui" name="volume" min="0" max="1" step="0.01" />
<input class="neo-range-input" type="number" min="0" max="1" step="0.01" data-for="mirostat_eta_textgenerationwebui" id="mirostat_eta_counter_textgenerationwebui">
</div>
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Typical P">
Typical P
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="typical_p_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="1" step="0.01" data-for="typical_p_textgenerationwebui" id="typical_p_counter_textgenerationwebui">
<div name="contrastiveSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexGrow flexShrink ">
<h4 class="textAlignCenter" data-i18n="Contrastive search">Contrast Search
<div class=" fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</h4>
<div class="alignitemscenter flex-container flexFlowColumn gap0">
<small>Penalty Alpha</small>
<input class="neo-range-slider" type="range" id="penalty_alpha_textgenerationwebui" name="volume" min="0" max="5" step="0.05" />
<input class="neo-range-input" type="number" min="0" max="5" step="0.05" data-for="penalty_alpha_textgenerationwebui" id="penalty_alpha_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title">
Top A
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="top_a_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
<div name="beamSearchBlock" class="alignitemscenter flex-container flexFlowColumn flexGrow flexShrink justifyCenter">
<h4 class="textAlignCenter" span data-i18n="Beam search">Beam Search
<div class=" fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</h4>
<div class="flex-container flexFlowRow gap10px ">
<div class="alignitemscenter flex-container flexFlowColumn gap0" data-i18n="Number of Beams">
<small>Number of Beams</small>
<input class="neo-range-slider" type="range" id="num_beams_textgenerationwebui" name="volume" min="1" max="20" step="1" />
<input class="neo-range-input" type="number" min="1" max="20" step="1" data-for="num_beams_textgenerationwebui" id="num_beams_counter_textgenerationwebui">
</div>
<div class="alignitemscenter flex-container flexFlowColumn gap0">
<small data-i18n="Length Penalty">Length Penalty</small>
<input class="neo-range-slider" type="range" id="length_penalty_textgenerationwebui" name="volume" min="-5" max="5" step="0.1" />
<input class="neo-range-input" type="number" min="-5" max="5" step="0.1" data-for="length_penalty_textgenerationwebui" id="length_penalty_counter_textgenerationwebui">
</div>
</div>
<div class="range-block-counter">
<input type="number" min="0" max="1" step="0.01" data-for="top_a_textgenerationwebui" id="top_a_counter_textgenerationwebui">
<div class="justifyCenter widthFitContent marginTopBot5">
<label class="checkbox_label" for="early_stopping_textgenerationwebui">
<input type="checkbox" id="early_stopping_textgenerationwebui" />
<small data-i18n="Early Stopping">Early Stopping</small>
</label>
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Tail Free Sampling">
Tail Free Sampling
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="tfs_textgenerationwebui" name="volume" min="0" max="1" step="0.01">
<hr class="width100p">
<div class="">
<h4 class="range-block-title justifyLeft">
<span data-i18n="Banned Tokens">Banned Tokens</span>
<span data-i18n="LLaMA models">(LLaMA models)</span>
<div class="margin5 fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</h4>
<small class="" data-i18n="Sequences you don't want to appear in the output. One per line.">
Sequences you don't want to appear in the output. One per line. Text or [token ids].
</small>
<div class="wide100p">
<textarea id="banned_tokens_textgenerationwebui" class="text_pole textarea_compact" name="banned_tokens_textgenerationwebui" rows="3" placeholder="Example:&#10;some text&#10;[42, 69, 1337]"></textarea>
</div>
<div class="range-block-counter">
<input type="number" min="0" max="1" step="0.01" data-for="tfs_textgenerationwebui" id="tfs_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Epsilon Cutoff">
Epsilon Cutoff
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="epsilon_cutoff_textgenerationwebui" name="volume" min="0" max="9" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="9" step="0.01" data-for="epsilon_cutoff_textgenerationwebui" id="epsilon_cutoff_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Eta Cutoff">
Eta Cutoff
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="eta_cutoff_textgenerationwebui" name="volume" min="0" max="20" step="0.01">
</div>
<div class="range-block-counter">
<input type="number" min="0" max="20" step="0.01" data-for="eta_cutoff_textgenerationwebui" id="eta_cutoff_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<label class="checkbox_label" for="do_sample_textgenerationwebui">
<input type="checkbox" id="do_sample_textgenerationwebui" />
<span data-i18n="Do Sample">Do Sample</span>
</label>
</div>
<div class="range-block">
<label class="checkbox_label" for="add_bos_token_textgenerationwebui">
<input type="checkbox" id="add_bos_token_textgenerationwebui" />
<span data-i18n="Add BOS Token">Add BOS Token</span>
</label>
<div class="toggle-description justifyLeft" data-i18n="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative.">
Add the bos_token to the beginning of prompts. Disabling this can make the
replies more creative.
</div>
</div>
<div class="range-block">
<label class="checkbox_label" for="ban_eos_token_textgenerationwebui">
<input type="checkbox" id="ban_eos_token_textgenerationwebui" />
<span data-i18n="Ban EOS Token">Ban EOS Token</span>
</label>
<div class="toggle-description justifyLeft" data-i18n="Ban the eos_token. This forces the model to never end the generation prematurely">
Ban the eos_token. This forces the model to never end the generation
prematurely.
</div>
</div>
<div class="range-block">
<label class="checkbox_label" for="skip_special_tokens_textgenerationwebui">
<input type="checkbox" id="skip_special_tokens_textgenerationwebui" />
<span data-i18n="Skip Special Tokens">Skip Special Tokens</span>
</label>
</div>
<hr>
<div class="range-block">
<h4 class="range-block-title justifyLeft">
<span data-i18n="Banned Tokens">Banned Tokens</span>
<span data-i18n="LLaMA models">(LLaMA models)</span>
</h4>
<div class="toggle-description justifyLeft" data-i18n="Sequences you don't want to appear in the output. One per line.">
Sequences you don't want to appear in the output. One per line. Text or [token ids].
</div>
<div class="wide100p">
<textarea id="banned_tokens_textgenerationwebui" class="text_pole textarea_compact" name="banned_tokens_textgenerationwebui" rows="3" placeholder="Example:&#10;some text&#10;[42, 69, 1337]"></textarea>
</div>
<small>
<i class="fa-solid fa-lightbulb"></i>
&nbsp;
<span data-i18n="Most tokens have a leading space.">
Most tokens have a leading space.
</span>
</small>
</div>
<hr>
<div class="range-block">
<h4 class="range-block-title justifyLeft" data-i18n="CFG Scale">
CFG Scale
</h4>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="guidance_scale_textgenerationwebui" name="volume" min="0.1" max="4" step="0.05">
</div>
<div class="range-block-counter">
<input type="number" min="0.1" max="4" step="0.05" data-for="guidance_scale_textgenerationwebui" id="guidance_scale_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title justifyLeft">
<span data-i18n="Negative Prompt">Negative Prompt</span>
</div>
<div class="wide100p">
<textarea id="negative_prompt_textgenerationwebui" class="text_pole textarea_compact" name="negative_prompt" rows="3" data-i18n="[placeholder]Add text here that would make the AI generate things you don't want in your outputs." placeholder="Add text here that would make the AI generate things you don't want in your outputs."></textarea>
</div>
<small data-i18n="Used if CFG Scale is unset globally, per chat or character">
Used if CFG Scale is unset globally, per chat or character
</small>
</div>
<hr>
<h4><span data-i18n="Beam search">Beam search</span></h4>
<div class="range-block">
<div class="range-block-title" data-i18n="Number of Beams">
Number of Beams
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="num_beams_textgenerationwebui" name="volume" min="1" max="20" step="1" />
</div>
<div class="range-block-counter">
<input type="number" min="1" max="20" step="1" data-for="num_beams_textgenerationwebui" id="num_beams_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title">
<span data-i18n="Length Penalty">Length Penalty</span>
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="length_penalty_textgenerationwebui" name="volume" min="-5" max="5" step="0.1" />
</div>
<div class="range-block-counter">
<input type="number" min="-5" max="5" step="0.1" data-for="length_penalty_textgenerationwebui" id="length_penalty_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<label class="checkbox_label" for="early_stopping_textgenerationwebui">
<input type="checkbox" id="early_stopping_textgenerationwebui" />
<span data-i18n="Early Stopping">Early Stopping</span>
</label>
</div>
<hr>
<h4 data-i18n="Contrastive search">Contrastive search</h4>
<div class="range-block">
<div class="range-block-title" data-i18n="Penalty Alpha">
Penalty Alpha
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="penalty_alpha_textgenerationwebui" name="volume" min="0" max="5" step="0.05" />
</div>
<div class="range-block-counter">
<input type="number" min="0" max="5" step="0.05" data-for="penalty_alpha_textgenerationwebui" id="penalty_alpha_counter_textgenerationwebui">
</div>
</div>
</div>
<hr>
<h4 data-i18n="Mirostat (mode=1 is only for llama.cpp)">Mirostat (mode=1 is only for llama.cpp)</h4>
<div class="range-block">
<div class="range-block-title" data-i18n="Mirostat Mode">
Mirostat Mode
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="mirostat_mode_textgenerationwebui" name="volume" min="0" max="2" step="1" />
</div>
<div class="range-block-counter">
<input type="number" min="0" max="2" step="1" data-for="mirostat_mode_textgenerationwebui" id="mirostat_mode_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Mirostat Tau">
Mirostat Tau
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="mirostat_tau_textgenerationwebui" name="volume" min="0" max="20" step="0.01" />
</div>
<div class="range-block-counter">
<input type="number" min="0" max="20" step="0.01" data-for="mirostat_tau_textgenerationwebui" id="mirostat_tau_counter_textgenerationwebui">
</div>
</div>
</div>
<div class="range-block">
<div class="range-block-title" data-i18n="Mirostat Eta">
Mirostat Eta
</div>
<div class="range-block-range-and-counter">
<div class="range-block-range">
<input type="range" id="mirostat_eta_textgenerationwebui" name="volume" min="0" max="1" step="0.01" />
</div>
<div class="range-block-counter">
<input type="number" min="0" max="1" step="0.01" data-for="mirostat_eta_textgenerationwebui" id="mirostat_eta_counter_textgenerationwebui">
</div>
</div>
</div>
<hr>
<div id="grammar_block_ooba">
<h4 data-i18n="Grammar">Grammar</h4>
<div class="range-block">
<textarea id="grammar_string_textgenerationwebui" rows="2" class="text_pole textarea_compact monospace"></textarea>
<div class="toggle-description justifyLeft">
<span data-i18n="Type in the desired custom grammar (GBNF).">
Type in the desired custom grammar (<a href="https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md" target="_blank">GBNF</a>).
<small>
<i class="fa-solid fa-lightbulb"></i>
&nbsp;
<span data-i18n="Most tokens have a leading space.">
Most tokens have a leading space.
</span>
</small>
</div>
<hr class="width100p">
<div class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexShrink gap0" data-i18n="CFG Scale">
<div>
CFG Scale
<div class="margin5 fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</div>
<input class="neo-range-slider" type="range" id="guidance_scale_textgenerationwebui" name="volume" min="0.1" max="4" step="0.05">
<input class="neo-range-input" type="number" min="0.1" max="4" step="0.05" data-for="guidance_scale_textgenerationwebui" id="guidance_scale_counter_textgenerationwebui">
</div>
<div class="range-block">
<div class="range-block-title justifyLeft">
<span data-i18n="Negative Prompt">Negative Prompt</span>
</div>
<div class="wide100p">
<textarea id="negative_prompt_textgenerationwebui" class="text_pole textarea_compact" name="negative_prompt" rows="3" data-i18n="[placeholder]Add text here that would make the AI generate things you don't want in your outputs." placeholder="Add text here that would make the AI generate things you don't want in your outputs."></textarea>
</div>
<small data-i18n="Used if CFG Scale is unset globally, per chat or character">
Used if CFG Scale is unset globally, per chat or character
</small>
</div>
<hr class="width100p">
<div id="grammar_block_ooba">
<h4 data-i18n="Grammar">Grammar
<div class="margin5 fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</h4>
<div class="range-block">
<textarea id="grammar_string_textgenerationwebui" rows="2" class="text_pole textarea_compact monospace"></textarea>
<div class="toggle-description justifyLeft">
<span data-i18n="Type in the desired custom grammar (GBNF).">
Type in the desired custom grammar (<a href="https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md" target="_blank">GBNF</a>).
</span>
</div>
</div>
</div>
</div>
<hr>
<div class="range-block">
<div class="range-block-title" data-i18n="Seed">
Seed
<div class="range-block">
<div class="range-block-title" data-i18n="Seed">
Seed
<div class="margin5 fa-solid fa-circle-info opacity50p " title="Helpful tip coming soon."></div>
</div>
<input type="number" id="seed_textgenerationwebui" class="text_pole wide100p" maxlength="100" />
</div>
<input type="number" id="seed_textgenerationwebui" class="text_pole wide100p" maxlength="100" />
</div>
</div>
<div id="openai_settings">
<div class="">
<div class="range-block">
@ -1864,7 +1688,7 @@
<div id="api_loading_novel" class="api-load-icon fa-solid fa-hourglass fa-spin"></div>
<h4><span data-i18n="Novel AI Model">Novel AI Model</span>
<a href="https://docs.sillytavern.app/usage/api-connections/novelai/#models" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<select id="model_novel_select">
@ -2233,7 +2057,7 @@
<h3 class="margin0" data-i18n="Advanced Formatting">
Advanced Formatting
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h3>
<div class="flex-container">
@ -2318,7 +2142,7 @@
<div>
<h4 data-i18n="Instruct Mode">Instruct Mode
<a href="https://docs.sillytavern.app/usage/core-concepts/instructmode/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<div>
@ -2510,7 +2334,7 @@
<div data-newbie-hidden>
<h4><span data-i18n="Tokenizer">Tokenizer</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#tokenizer" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<select id="tokenizer">
@ -2528,7 +2352,7 @@
<div class="range-block-title justifyLeft">
<span data-i18n="Token Padding">Token Padding</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#token-padding" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</div>
<input id="token_padding" class="text_pole textarea_compact" type="number" min="-2048" max="2048" />
@ -2566,7 +2390,7 @@
Custom Stopping Strings
</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/advancedformatting/#custom-stopping-strings" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<div>
@ -2631,7 +2455,7 @@
<h3 class="margin0">
<span data-i18n="Worlds/Lorebooks">Worlds/Lorebooks</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/worldinfo/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h3>
</div>
@ -3015,7 +2839,7 @@
<span>
<span data-i18n="Message Sound">Message Sound</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/uicustomization/#message-sound" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</span>
</label>
@ -3166,7 +2990,7 @@
<input id="render_formulas" type="checkbox" />
<span data-i18n="Render Formulas">Render Formulas</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/uicustomization/#formulas-rendering" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</label>
<label data-newbie-hidden class="checkbox_label" for="allow_name2_display">
@ -3521,7 +3345,7 @@
<div id="description_div" class="marginBot5">
<span data-i18n="Character Description">Description</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#character-description" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</div>
@ -3534,7 +3358,7 @@
<span>
<span data-i18n="First message">First message</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#first-message" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</span>
<div class="menu_button menu_button_icon open_alternate_greetings margin0" title="Click to set additional greeting messages" data-i18n="[title]Click to set additional greeting messages">
@ -3581,7 +3405,7 @@
<span>
<span data-i18n="Group Controls">Group Controls</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/groupchats/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</span>
<div class="fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
@ -3822,7 +3646,7 @@
<div id="personality_div">
<h4>
<span data-i18n="Personality summary">Personality summary</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#personality-summary" class="notes-link" target="_blank"><span class="note-link-span">?</span></a>
<a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#personality-summary" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a>
</h4>
<textarea id="personality_textarea" name="personality" data-i18n="[placeholder](A brief description of the personality)" placeholder="(A brief description of the personality)" form="form_create" class="text_pole" autocomplete="off" rows="1" maxlength="50000"></textarea>
<div class="extension_token_counter">
@ -3834,7 +3658,7 @@
<h4>
<span data-i18n="Scenario">Scenario</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#scenario" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
<span class="fa-solid fa-circle-question note-link-span"></span>
</a>
</h4>
<textarea id="scenario_pole" name="scenario" data-i18n="[placeholder](Circumstances and context of the interaction)" placeholder="(Circumstances and context of the interaction)" class="text_pole" maxlength="50000" value="" autocomplete="off" form="form_create" rows="1"></textarea>
@ -3880,12 +3704,45 @@
<div id="mes_example_div" class="flex-container flexFlowColumn">
<div>
<h4><span data-i18n="Examples of dialogue">Examples of dialogue</span></h4>
<h5 data-i18n="Important to set the character's writing style.">Important to set the character's writing style. <a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#examples-of-dialogue" class="notes-link" target="_blank"><span class="note-link-span">?</span></a></h5>
<h5 data-i18n="Important to set the character's writing style.">Important to set the character's writing style. <a href="https://docs.sillytavern.app/usage/core-concepts/characterdesign/#examples-of-dialogue" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a></h5>
</div>
<textarea id="mes_example_textarea" class="flexGrow" name="mes_example" data-i18n="[placeholder](Examples of chat dialog. Begin each example with START on a new line.)" placeholder="(Examples of chat dialog. Begin each example with &lt;START&gt; on a new line.)" form="form_create" maxlength="50000" rows="6"></textarea>
<div class="extension_token_counter">
Tokens: <span data-token-counter="mes_example_textarea">counting...</span>
</div>
<!-- PLACEHOLDER CODE FOR NEW EXAMPLE CHAT HANDLING
<div name="exampleChatsBlockTemplate" class="flex-container flexFlowColumn">
<div class="flex-container alignitemscenter">
<textarea class="flexShrink flexGrow wideMinContent" rows="1" placeholder="Name for this example chat"></textarea>
<div class="fa-solid fa-plus menu_button" title="Add a new message to this example chat block"></div>
</div>
<div class="flex-container whitespacenowrap">
<div class="flex-container flexFlowColumn">
<select>
<option>{{user}}</option>
<option>{{char}}</option>
<option>Custom</option>
</select>
<textarea rows="1" placeholder="Custom Entity"></textarea>
</div>
<textarea class="flexShrink flexGrow wideMinContent" placeholder="Content of the example chat."></textarea>
</div>
<div class="flex-container whitespacenowrap">
<div class="flex-container flexFlowColumn">
<select>
<option>{{user}}</option>
<option>{{char}}</option>
<option>Custom</option>
</select>
<textarea rows="1" placeholder="Custom Entity"></textarea>
</div>
<textarea class="flexShrink flexGrow wideMinContent" placeholder="Content of the example chat."></textarea>
</div>
</div>
-->
</div>
<div id="character_popup_ok" class="menu_button" data-i18n="Save">Save</div>
@ -3905,7 +3762,7 @@
</div>
<div id="selectChatPopupHeaderText" class="TxtLrgBoldCenter">
<span id="ChatHistoryCharName"></span><span data-i18n="Chat History">Chat History</span>
<a href="https://docs.sillytavern.app/usage/core-concepts/chatfilemanagement/#chat-import" class="notes-link" target="_blank"><span class="note-link-span">?</span></a>
<a href="https://docs.sillytavern.app/usage/core-concepts/chatfilemanagement/#chat-import" class="notes-link" target="_blank"><span class="fa-solid fa-circle-question note-link-span"></span></a>
</div>
<input type="text" id="select_chat_search" class="menu_button" placeholder="Search..." autocomplete="off">
@ -5097,4 +4954,4 @@
</script>
</body>
</html>
</html>

View File

@ -2619,7 +2619,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
// Determine token limit
let this_max_context = getMaxContextSize();
if (!dryRun) {
if (!dryRun && type !== 'quiet') {
console.debug('Running extension interceptors');
const aborted = await runGenerationInterceptors(coreChat, this_max_context);
@ -4751,6 +4751,11 @@ function changeMainAPI() {
activeItem.amountGenElem.find('input').prop("disabled", false);
activeItem.amountGenElem.css("opacity", 1.0);
}
if (selectedVal === "textgenerationwebui") {
$("#streaming_textgenerationwebui_block").css('display', 'block')
} else {
$("#streaming_textgenerationwebui_block").css('display', 'none')
}
if (selectedVal === "novel") {
$("#ai_module_block_novel").css("display", "block");

View File

@ -69,6 +69,18 @@ const triggerWords = {
[generationMode.BACKGROUND]: ['background'],
}
const messageTrigger = {
activationRegex: /\b(send|mail|imagine|generate|make|create|draw|paint|render)\b.*\b(pic|picture|image|drawing|painting|photo|photograph)\b(?:\s+of)?(?:\s+(?:a|an|the)?)?(.+)/i,
specialCases: {
[generationMode.CHARACTER]: ['you', 'yourself'],
[generationMode.USER]: ['me', 'myself'],
[generationMode.SCENARIO]: ['story', 'scenario', 'whole story'],
[generationMode.NOW]: ['last message'],
[generationMode.FACE]: ['your face', 'your portrait', 'your selfie'],
[generationMode.BACKGROUND]: ['background', 'scene background', 'scene', 'scenery', 'surroundings', 'environment'],
},
}
const promptTemplates = {
/*OLD: [generationMode.CHARACTER]: "Pause your roleplay and provide comma-delimited list of phrases and keywords which describe {{char}}'s physical appearance and clothing. Ignore {{char}}'s personality traits, and chat history when crafting this description. End your response once the comma-delimited list is complete. Do not roleplay when writing this description, and do not attempt to continue the story.", */
[generationMode.CHARACTER]: "[In the next response I want you to provide only a detailed comma-delimited list of keywords and phrases which describe {{char}}. The list must include all of the following items in this order: name, species and race, gender, age, clothing, occupation, physical features and appearances. Do not include descriptions of non-visual qualities such as personality, movements, scents, mental traits, or anything which could not be seen in a still photograph. Do not write in full sentences. Prefix your description with the phrase 'full body portrait,']",
@ -172,6 +184,7 @@ const defaultSettings = {
// Refine mode
refine_mode: false,
expand: false,
interactive_mode: false,
prompts: promptTemplates,
@ -207,6 +220,62 @@ const defaultSettings = {
styles: defaultStyles,
}
function processTriggers(chat, _, abort) {
if (!extension_settings.sd.interactive_mode) {
return;
}
const lastMessage = chat[chat.length - 1];
if (!lastMessage) {
return;
}
const message = lastMessage.mes;
const isUser = lastMessage.is_user;
if (!message || !isUser) {
return;
}
const messageLower = message.toLowerCase();
try {
const activationRegex = new RegExp(messageTrigger.activationRegex, 'i');
const activationMatch = messageLower.match(activationRegex);
if (!activationMatch) {
return;
}
let subject = activationMatch[3].trim();
if (!subject) {
return;
}
console.log(`SD: Triggered by "${message}", detected subject: ${subject}"`);
for (const [specialMode, triggers] of Object.entries(messageTrigger.specialCases)) {
for (const trigger of triggers) {
if (subject === trigger) {
subject = triggerWords[specialMode][0];
console.log(`SD: Detected special case "${trigger}", switching to mode ${specialMode}`);
break;
}
}
}
abort(true);
setTimeout(() => generatePicture('sd', subject, message), 1);
} catch {
console.log('SD: Failed to process triggers.');
return;
}
}
window['SD_ProcessTriggers'] = processTriggers;
function getSdRequestBody() {
switch (extension_settings.sd.source) {
case sources.vlad:
@ -281,6 +350,7 @@ async function loadSettings() {
$('#sd_auto_auth').val(extension_settings.sd.auto_auth);
$('#sd_vlad_url').val(extension_settings.sd.vlad_url);
$('#sd_vlad_auth').val(extension_settings.sd.vlad_auth);
$('#sd_interactive_mode').prop('checked', extension_settings.sd.interactive_mode);
for (const style of extension_settings.sd.styles) {
const option = document.createElement('option');
@ -328,6 +398,11 @@ function addPromptTemplates() {
}
}
function onInteractiveModeInput() {
extension_settings.sd.interactive_mode = !!$(this).prop('checked');
saveSettingsDebounced();
}
function onStyleSelect() {
const selectedStyle = String($('#sd_style').find(':selected').val());
const styleObject = extension_settings.sd.styles.find(x => x.name === selectedStyle);
@ -1187,6 +1262,42 @@ async function generatePicture(_, trigger, message, callback) {
// sadly, groups is not an array, but is a dict with keys being index numbers, so we have to filter it
const characterName = context.characterId ? context.characters[context.characterId].name : context.groups[Object.keys(context.groups).filter(x => context.groups[x].id === context.groupId)[0]]?.id?.toString();
if (generationType == generationMode.BACKGROUND) {
const callbackOriginal = callback;
callback = async function (prompt, imagePath, generationType) {
const imgUrl = `url("${encodeURI(imagePath)}")`;
eventSource.emit(event_types.FORCE_SET_BACKGROUND, { url: imgUrl, path: imagePath });
if (typeof callbackOriginal === 'function') {
callbackOriginal(prompt, imagePath, generationType);
} else {
sendMessage(prompt, imagePath, generationType);
}
}
}
const dimensions = setTypeSpecificDimensions(generationType);
try {
const prompt = await getPrompt(generationType, message, trigger, quiet_prompt);
console.log('Processed Stable Diffusion prompt:', prompt);
context.deactivateSendButtons();
hideSwipeButtons();
await sendGenerationRequest(generationType, prompt, characterName, callback);
} catch (err) {
console.trace(err);
throw new Error('SD prompt text generation failed.')
}
finally {
restoreOriginalDimensions(dimensions);
context.activateSendButtons();
showSwipeButtons();
}
}
function setTypeSpecificDimensions(generationType) {
const prevSDHeight = extension_settings.sd.height;
const prevSDWidth = extension_settings.sd.width;
const aspectRatio = extension_settings.sd.width / extension_settings.sd.height;
@ -1203,37 +1314,14 @@ async function generatePicture(_, trigger, message, callback) {
// Round to nearest multiple of 64
extension_settings.sd.width = Math.round(extension_settings.sd.height * 1.8 / 64) * 64;
}
const callbackOriginal = callback;
callback = async function (prompt, imagePath) {
const imgUrl = `url("${encodeURI(imagePath)}")`;
eventSource.emit(event_types.FORCE_SET_BACKGROUND, { url: imgUrl, path: imagePath });
if (typeof callbackOriginal === 'function') {
callbackOriginal(prompt, imagePath);
} else {
sendMessage(prompt, imagePath);
}
}
}
try {
const prompt = await getPrompt(generationType, message, trigger, quiet_prompt);
console.log('Processed Stable Diffusion prompt:', prompt);
return { height: prevSDHeight, width: prevSDWidth };
}
context.deactivateSendButtons();
hideSwipeButtons();
await sendGenerationRequest(generationType, prompt, characterName, callback);
} catch (err) {
console.trace(err);
throw new Error('SD prompt text generation failed.')
}
finally {
extension_settings.sd.height = prevSDHeight;
extension_settings.sd.width = prevSDWidth;
context.activateSendButtons();
showSwipeButtons();
}
function restoreOriginalDimensions(savedParams) {
extension_settings.sd.height = savedParams.height;
extension_settings.sd.width = savedParams.width;
}
async function getPrompt(generationType, message, trigger, quiet_prompt) {
@ -1264,7 +1352,7 @@ async function generatePrompt(quiet_prompt) {
}
async function sendGenerationRequest(generationType, prompt, characterName = null, callback) {
const prefix = generationType !== generationMode.BACKGROUND
const prefix = (generationType !== generationMode.BACKGROUND && generationType !== generationMode.FREE)
? combinePrefixes(extension_settings.sd.prompt_prefix, getCharacterPrefix())
: extension_settings.sd.prompt_prefix;
@ -1308,7 +1396,7 @@ async function sendGenerationRequest(generationType, prompt, characterName = nul
const filename = `${characterName}_${humanizedDateTime()}`;
const base64Image = await saveBase64AsFile(result.data, characterName, filename, result.format);
callback ? callback(prompt, base64Image) : sendMessage(prompt, base64Image);
callback ? callback(prompt, base64Image, generationType) : sendMessage(prompt, base64Image, generationType);
}
/**
@ -1514,7 +1602,7 @@ function getNovelParams() {
return { steps, width, height };
}
async function sendMessage(prompt, image) {
async function sendMessage(prompt, image, generationType) {
const context = getContext();
const messageText = `[${context.name2} sends a picture that contains: ${prompt}]`;
const message = {
@ -1526,6 +1614,7 @@ async function sendMessage(prompt, image) {
extra: {
image: image,
title: prompt,
generationType: generationType,
},
};
context.chat.push(message);
@ -1643,14 +1732,18 @@ async function sdMessageButton(e) {
return;
}
let dimensions = null;
try {
setBusyIcon(true);
if (hasSavedImage) {
const prompt = await refinePrompt(message.extra.title, false);
message.extra.title = prompt;
const generationType = message?.extra?.generationType ?? generationMode.FREE;
console.log('Regenerating an image, using existing prompt:', prompt);
await sendGenerationRequest(generationMode.FREE, prompt, characterFileName, saveGeneratedImage);
dimensions = setTypeSpecificDimensions(generationType);
await sendGenerationRequest(generationType, prompt, characterFileName, saveGeneratedImage);
}
else {
console.log("doing /sd raw last");
@ -1662,9 +1755,13 @@ async function sdMessageButton(e) {
}
finally {
setBusyIcon(false);
if (dimensions) {
restoreOriginalDimensions(dimensions);
}
}
function saveGeneratedImage(prompt, image) {
function saveGeneratedImage(prompt, image, generationType) {
// Some message sources may not create the extra object
if (typeof message.extra !== 'object') {
message.extra = {};
@ -1674,6 +1771,7 @@ async function sdMessageButton(e) {
message.extra.inline_image = message.extra.image && !message.extra.inline_image ? false : true;
message.extra.image = image;
message.extra.title = prompt;
message.extra.generationType = generationType;
appendImageToMessage(message, $mes);
context.saveChat();
@ -1737,6 +1835,7 @@ jQuery(async () => {
$('#sd_style').on('change', onStyleSelect);
$('#sd_save_style').on('click', onSaveStyleClick);
$('#sd_character_prompt_block').hide();
$('#sd_interactive_mode').on('input', onInteractiveModeInput);
$('.sd_settings .inline-drawer-toggle').on('click', function () {
initScrollHeight($("#sd_prompt_prefix"));

View File

@ -5,6 +5,7 @@
"optional": [
"sd"
],
"generate_interceptor": "SD_ProcessTriggers",
"js": "index.js",
"css": "style.css",
"author": "Cohee#1207",

View File

@ -1,25 +1,27 @@
<div class="sd_settings">
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>Stable Diffusion</b>
<b>
Stable Diffusion
<a href="https://docs.sillytavern.app/extras/extensions/stable-diffusion/" class="notes-link" target="_blank">
<span class="note-link-span">?</span>
</a>
</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">
<small><i>Use slash commands or the bottom Paintbrush button to generate images. Type <span class="monospace">/help</span> in chat for more details</i></small>
<br>
<label for="sd_refine_mode" class="checkbox_label" title="Allow to edit prompts manually before sending them to generation API">
<input id="sd_refine_mode" type="checkbox" />
Edit prompts before generation
</label>
<label for="sd_interactive_mode" class="checkbox_label" title="Automatically generate images when sending messages like 'send me a picture of cat'.">
<input id="sd_interactive_mode" type="checkbox" />
Interactive mode
</label>
<label for="sd_expand" class="checkbox_label" title="Automatically extend prompts using text generation model">
<input id="sd_expand" type="checkbox" />
Auto-enhance prompts
</label>
<small>
This option uses an additional GPT-2 text generation model to add more details to the prompt generated by the main API.
Works best for SDXL image models. May not work well with other models, it is recommended to manually edit prompts in this case.
</small>
<label for="sd_source">Source</label>
<select id="sd_source">
<option value="extras">Extras API (local / remote)</option>

View File

@ -15,6 +15,7 @@ export const kai_settings = {
rep_pen: 1,
rep_pen_range: 0,
top_p: 1,
min_p: 0,
top_a: 1,
top_k: 0,
typical: 1,
@ -113,6 +114,7 @@ export function getKoboldGenerationData(finalPrompt, settings, maxLength, maxCon
top_a: kai_settings.top_a,
top_k: kai_settings.top_k,
top_p: kai_settings.top_p,
min_p: kai_settings.min_p,
typical: kai_settings.typical,
s1: sampler_order[0],
s2: sampler_order[1],
@ -207,6 +209,13 @@ const sliders = [
format: (val) => val,
setValue: (val) => { kai_settings.top_p = Number(val); },
},
{
name: "min_p",
sliderId: "#min_p",
counterId: "#min_p_counter",
format: (val) => val,
setValue: (val) => { kai_settings.min_p = Number(val); },
},
{
name: "top_a",
sliderId: "#top_a",

View File

@ -2277,6 +2277,35 @@ input[type='checkbox']:not(#nav-toggle):not(#rm_button_panel_pin):not(#lm_button
width: 70px;
}
.neo-range-input {
display: block;
cursor: text;
background-color: var(--black30a);
border: 1px solid var(--SmartThemeBorderColor);
border-radius: 0 0 5px 5px;
padding: 2px;
padding-left: 1em;
padding-top: 5px;
text-align: center;
width: 100%;
}
.neo-range-slider {
-webkit-appearance: none !important;
appearance: none !important;
margin: 0 !important;
margin-top: 7px !important;
padding: 0 !important;
width: 100% !important;
height: 5px !important;
background: var(--white50a) !important;
border-radius: 7px 7px 0 0 !important;
background-size: 70% 100% !important;
background-repeat: no-repeat !important;
box-shadow: inset 0 0 2px black !important;
cursor: ew-resize !important;
}
.range-block-range {
margin: 0;
flex: 5;
@ -2313,22 +2342,23 @@ input[type="range"]::-webkit-slider-thumb {
.note-link-span {
color: var(--SmartThemeQuoteColor);
border: 1px solid var(--SmartThemeQuoteColor);
border-radius: 10px;
line-height: var(--mainFontSize);
font-size: var(--mainFontSize);
font-weight: 700;
width: calc(var(--mainFontSize) + 0.2rem);
height: calc(var(--mainFontSize) + 0.2rem);
display: inline-block;
opacity: 0.5;
margin: 0 5px;
text-align: center;
border-radius: 100%;
box-shadow: 0 0 3px black;
transition: all 250ms;
}
.note-link-span:hover {
.topRightInset {
position: absolute;
top: 6px;
right: 23px;
}
.note-link-span:hover,
.note-link-span-lrg:hover {
opacity: 1;
}
@ -3049,7 +3079,8 @@ a {
#extensions_settings .inline-drawer-toggle.inline-drawer-header,
#extensions_settings2 .inline-drawer-toggle.inline-drawer-header,
#user-settings-block h4 {
#user-settings-block h4,
.standoutHeader {
background-image: linear-gradient(348deg, var(--white30a)2%, var(--grey30a)10%, var(--black70a)95%, var(--SmartThemeQuoteColor)100%);
margin-bottom: 5px;
border-radius: 10px;
@ -3400,9 +3431,6 @@ a {
flex-wrap: wrap;
}
#max_context_unlocked_warning {
flex-basis: 100%;
}
#max_context_unlocked:not(:checked)+div {
display: none;
@ -3617,4 +3645,4 @@ a {
height: 100vh;
z-index: 9999;
}
}
}

View File

@ -393,6 +393,7 @@ app.post("/generate", jsonParser, async function (request, response_generate) {
top_a: request.body.top_a,
top_k: request.body.top_k,
top_p: request.body.top_p,
min_p: request.body.min_p,
typical: request.body.typical,
sampler_order: sampler_order,
singleline: !!request.body.singleline,

View File

@ -897,6 +897,8 @@ export interface ModelGenerationInputKobold {
top_k?: number;
/** Top-p sampling value. */
top_p?: number;
/** Min-p sampling value. */
min_p?: number;
/** Typical sampling value. */
typical?: number;
/** Array of integers representing the sampler order to be used */