diff --git a/public/index.html b/public/index.html index 02bcc1f0f..dfc73fcf6 100644 --- a/public/index.html +++ b/public/index.html @@ -222,9 +222,8 @@
-
- select -
+ +
@@ -238,9 +237,8 @@
-
- select -
+ +
@@ -288,9 +286,8 @@
-
- select -
+ +
@@ -303,9 +300,8 @@
-
- select -
+ +
@@ -318,9 +314,8 @@
-
- select -
+ +
@@ -333,9 +328,8 @@
-
- select -
+ +
@@ -363,9 +357,8 @@
-
- select -
+ +
@@ -378,9 +371,8 @@
-
- select -
+ +
@@ -393,9 +385,8 @@
-
- select -
+ +
@@ -408,9 +399,8 @@
-
- select -
+ +
@@ -423,9 +413,8 @@
-
- select -
+ +
@@ -438,9 +427,8 @@
-
- select -
+ +
@@ -453,9 +441,8 @@
-
- select -
+ +
@@ -496,9 +483,8 @@
-
- select -
+ +
@@ -511,9 +497,8 @@
-
- select -
+ +
@@ -526,9 +511,8 @@
-
- select -
+ +
@@ -541,9 +525,8 @@
-
- select -
+ +
@@ -556,9 +539,8 @@
-
- select -
+ +
@@ -571,9 +553,8 @@
-
- select -
+ +
@@ -602,9 +583,8 @@
-
- select -
+ +
@@ -643,8 +623,8 @@
-
- select
+ +
@@ -657,9 +637,8 @@
-
- select -
+ +
@@ -672,9 +651,8 @@
-
- select -
+ +
@@ -687,9 +665,8 @@
-
- select -
+ +
@@ -702,9 +679,8 @@
-
- select -
+ +
@@ -717,9 +693,8 @@
-
- select -
+ +
@@ -935,9 +910,8 @@
-
- select -
+ +
@@ -950,9 +924,8 @@
-
- select -
+ +
@@ -965,9 +938,8 @@
-
- select -
+ +
@@ -980,9 +952,8 @@
-
- select -
+ +
@@ -995,9 +966,8 @@
-
- select -
+ +
@@ -1042,9 +1012,8 @@
-
- select -
+ +
@@ -1060,9 +1029,8 @@
-
- select -
+ +
@@ -1078,9 +1046,8 @@
-
- select -
+ +
@@ -1192,9 +1159,8 @@
-
- select -
+ +
@@ -1219,9 +1185,8 @@
-
- select -
+ +
@@ -1234,9 +1199,8 @@
-
- select -
+ +
@@ -1249,9 +1213,8 @@
-
- select -
+ +
@@ -1264,9 +1227,8 @@
-
- select -
+ +
@@ -1279,9 +1241,8 @@
-
- select -
+ +
@@ -1294,9 +1255,8 @@
-
- select -
+ +
@@ -1309,9 +1269,8 @@
-
- select -
+ +
@@ -1377,9 +1336,8 @@
-
- select -
+ +
@@ -1392,9 +1350,8 @@
-
- select -
+ +
@@ -1407,9 +1364,8 @@
-
- select -
+ +
@@ -1422,9 +1378,8 @@
-
- select -
+ +
@@ -1437,9 +1392,8 @@
-
- select -
+ +
@@ -1452,9 +1406,8 @@
-
- select -
+ +
@@ -1467,9 +1420,8 @@
-
- select -
+ +
@@ -1535,9 +1487,8 @@
-
- select -
+ +
@@ -1563,9 +1514,8 @@
-
- select -
+ +
@@ -1578,9 +1528,8 @@
-
- select -
+ +
@@ -1601,9 +1550,8 @@
-
- select -
+ +
@@ -1618,9 +1566,8 @@
-
- select -
+ +
@@ -1633,9 +1580,8 @@
-
- select -
+ +
@@ -1648,9 +1594,8 @@
-
- select -
+ +
@@ -2680,9 +2625,8 @@
-
- depth -
+ +
@@ -2696,9 +2640,8 @@
-
- budget -
+ +
@@ -2712,9 +2655,8 @@
-
- 0 -
+ +
@@ -2914,9 +2856,8 @@
-
- select -
+ +
@@ -2929,9 +2870,8 @@
-
- select -
+ +
@@ -2944,9 +2884,8 @@
-
- select -
+ +
@@ -2959,9 +2898,8 @@
-
- select -
+ +
@@ -4797,9 +4735,8 @@
-
- select -
+ +
@@ -4841,9 +4778,8 @@
-
- select -
+ +
@@ -4879,9 +4815,8 @@
-
- select -
+ +
@@ -5104,4 +5039,4 @@ - + \ No newline at end of file diff --git a/public/script.js b/public/script.js index 6e451527c..b627bce01 100644 --- a/public/script.js +++ b/public/script.js @@ -5025,10 +5025,10 @@ async function getSettings(type) { // Set context size after loading power user (may override the max value) $("#max_context").val(max_context); - $("#max_context_counter").text(`${max_context}`); + $("#max_context_counter").val(max_context); $("#amount_gen").val(amount_gen); - $("#amount_gen_counter").text(`${amount_gen}`); + $("#amount_gen_counter").val(amount_gen); //Load which API we are using if (settings.main_api == undefined) { @@ -5162,7 +5162,7 @@ export function setGenerationParamsFromPreset(preset) { if (preset.genamt !== undefined) { amount_gen = preset.genamt; $("#amount_gen").val(amount_gen); - $("#amount_gen_counter").text(`${amount_gen}`); + $("#amount_gen_counter").val(amount_gen); } if (preset.max_length !== undefined) { @@ -5171,7 +5171,7 @@ export function setGenerationParamsFromPreset(preset) { max_context = preset.max_length; $("#max_context").val(max_context); - $("#max_context_counter").text(`${max_context}`); + $("#max_context_counter").val(max_context); } } @@ -7922,7 +7922,7 @@ jQuery(async function () { const value = $(this).val(); const formattedValue = slider.format(value); slider.setValue(value); - $(slider.counterId).text(formattedValue); + $(slider.counterId).val(formattedValue); saveSettingsDebounced(); }); }); @@ -8723,46 +8723,67 @@ jQuery(async function () { } }); - $(document).on('input', '.range-block-counter div[contenteditable="true"]', function () { - const caretPosition = saveCaretPosition($(this).get(0)); - const myText = $(this).text().trim(); - $(this).text(myText); // trim line breaks and spaces - const masterSelector = $(this).data('for'); - const masterElement = document.getElementById(masterSelector); + $(document).on('input', '.range-block-counter input', function () { + setTimeout(() => { + const caretPosition = saveCaretPosition($(this).get(0)); + const myText = $(this).val().trim(); + $(this).val(myText); // trim line breaks and spaces + const masterSelector = $(this).data('for'); + const masterElement = document.getElementById(masterSelector); - if (masterElement == null) { - console.error('Master input element not found for the editable label', masterSelector); - return; - } + if (masterElement == null) { + console.error('Master input element not found for the editable label', masterSelector); + return; + } - const myValue = Number(myText); + const myValue = Number(myText); + const masterStep = Number(masterElement.getAttribute('step')) + const masterMin = Number($(masterElement).attr('min')); + const masterMax = Number($(masterElement).attr('max')); + const rawStepCompare = myValue / masterStep + const closestStep = Math.round(rawStepCompare) + const closestStepRaw = (closestStep) * masterStep + + //if text box val is not a number, reset slider val to its previous and wait for better input + if (Number.isNaN(myValue)) { + console.warn('Label input is not a valid number. Resetting the value to match slider', myText); + $(masterElement).trigger('input'); + restoreCaretPosition($(this).get(0), caretPosition); + return; + } + + //if textbox val is less than min, set slider to min + //PROBLEM: the moment slider gets set to min, textbox also auto-sets to min. + //if min = 0, this prevents further typing and locks input at 0 unless users pastes + //a multi-character number which is between min and max. adding delay was necessary. + if (myValue < masterMin) { + console.warn('Label input is less than minimum.', myText, '<', masterMin); + $(masterElement).val(masterMin).trigger('input').trigger('mouseup'); + $(masterElement).val(myValue) + restoreCaretPosition($(this).get(0), caretPosition); + return; + } + //Same as above but in reverse. Not a problem because max value has multiple + //characters which can be edited. + if (myValue > masterMax) { + console.warn('Label input is more than maximum.', myText, '>', masterMax); + $(masterElement).val(masterMax).trigger('input').trigger('mouseup'); + $(masterElement).val(myValue) + restoreCaretPosition($(this).get(0), caretPosition); + return; + } + + //round input value to nearest step if between min and max + if (!(myValue < masterMin) && !(myValue > masterMax)) { + console.debug(`Label value ${myText} is OK, setting slider to closest step (${closestStepRaw})`); + $(masterElement).val(closestStepRaw).trigger('input').trigger('mouseup'); + restoreCaretPosition($(this).get(0), caretPosition); + return; + } - if (Number.isNaN(myValue)) { - console.warn('Label input is not a valid number. Resetting the value', myText); - $(masterElement).trigger('input'); restoreCaretPosition($(this).get(0), caretPosition); - return; - } - - const masterMin = Number($(masterElement).attr('min')); - const masterMax = Number($(masterElement).attr('max')); - - if (myValue < masterMin) { - console.warn('Label input is less than minimum.', myText, '<', masterMin); - restoreCaretPosition($(this).get(0), caretPosition); - return; - } - - if (myValue > masterMax) { - console.warn('Label input is more than maximum.', myText, '>', masterMax); - restoreCaretPosition($(this).get(0), caretPosition); - return; - } - - console.debug('Label value OK, setting to the master input control', myText); - $(masterElement).val(myValue).trigger('input').trigger('mouseup'); - restoreCaretPosition($(this).get(0), caretPosition); - }); + }, 500); + }) $(".user_stats_button").on('click', function () { userStatsHandler(); diff --git a/public/scripts/kai-settings.js b/public/scripts/kai-settings.js index 26abf0c77..517e32b2f 100644 --- a/public/scripts/kai-settings.js +++ b/public/scripts/kai-settings.js @@ -72,7 +72,7 @@ export function loadKoboldSettings(preset) { const formattedValue = slider.format(value); slider.setValue(value); $(slider.sliderId).val(value); - $(slider.counterId).text(formattedValue); + $(slider.counterId).val(formattedValue); } // TODO: refactor checkboxes (if adding any more) @@ -375,7 +375,7 @@ jQuery(function () { const value = $(this).val(); const formattedValue = slider.format(value); slider.setValue(value); - $(slider.counterId).text(formattedValue); + $(slider.counterId).val(formattedValue); saveSettingsDebounced(); }); }); diff --git a/public/scripts/nai-settings.js b/public/scripts/nai-settings.js index c5575922a..5fee49b92 100644 --- a/public/scripts/nai-settings.js +++ b/public/scripts/nai-settings.js @@ -176,36 +176,36 @@ export function loadNovelSettings(settings) { function loadNovelSettingsUi(ui_settings) { $("#temp_novel").val(ui_settings.temperature); - $("#temp_counter_novel").text(Number(ui_settings.temperature).toFixed(2)); + $("#temp_counter_novel").val(Number(ui_settings.temperature).toFixed(2)); $("#rep_pen_novel").val(ui_settings.repetition_penalty); - $("#rep_pen_counter_novel").text(Number(ui_settings.repetition_penalty).toFixed(2)); + $("#rep_pen_counter_novel").val(Number(ui_settings.repetition_penalty).toFixed(2)); $("#rep_pen_size_novel").val(ui_settings.repetition_penalty_range); - $("#rep_pen_size_counter_novel").text(Number(ui_settings.repetition_penalty_range).toFixed(0)); + $("#rep_pen_size_counter_novel").val(Number(ui_settings.repetition_penalty_range).toFixed(0)); $("#rep_pen_slope_novel").val(ui_settings.repetition_penalty_slope); - $("#rep_pen_slope_counter_novel").text(Number(`${ui_settings.repetition_penalty_slope}`).toFixed(2)); + $("#rep_pen_slope_counter_novel").val(Number(`${ui_settings.repetition_penalty_slope}`).toFixed(2)); $("#rep_pen_freq_novel").val(ui_settings.repetition_penalty_frequency); - $("#rep_pen_freq_counter_novel").text(Number(ui_settings.repetition_penalty_frequency).toFixed(5)); + $("#rep_pen_freq_counter_novel").val(Number(ui_settings.repetition_penalty_frequency).toFixed(5)); $("#rep_pen_presence_novel").val(ui_settings.repetition_penalty_presence); - $("#rep_pen_presence_counter_novel").text(Number(ui_settings.repetition_penalty_presence).toFixed(3)); + $("#rep_pen_presence_counter_novel").val(Number(ui_settings.repetition_penalty_presence).toFixed(3)); $("#tail_free_sampling_novel").val(ui_settings.tail_free_sampling); - $("#tail_free_sampling_counter_novel").text(Number(ui_settings.tail_free_sampling).toFixed(3)); + $("#tail_free_sampling_counter_novel").val(Number(ui_settings.tail_free_sampling).toFixed(3)); $("#top_k_novel").val(ui_settings.top_k); - $("#top_k_counter_novel").text(Number(ui_settings.top_k).toFixed(0)); + $("#top_k_counter_novel").val(Number(ui_settings.top_k).toFixed(0)); $("#top_p_novel").val(ui_settings.top_p); - $("#top_p_counter_novel").text(Number(ui_settings.top_p).toFixed(2)); + $("#top_p_counter_novel").val(Number(ui_settings.top_p).toFixed(2)); $("#top_a_novel").val(ui_settings.top_a); - $("#top_a_counter_novel").text(Number(ui_settings.top_a).toFixed(2)); + $("#top_a_counter_novel").val(Number(ui_settings.top_a).toFixed(2)); $("#typical_p_novel").val(ui_settings.typical_p); - $("#typical_p_counter_novel").text(Number(ui_settings.typical_p).toFixed(3)); + $("#typical_p_counter_novel").val(Number(ui_settings.typical_p).toFixed(3)); $("#cfg_scale_novel").val(ui_settings.cfg_scale); - $("#cfg_scale_counter_novel").text(Number(ui_settings.cfg_scale).toFixed(2)); + $("#cfg_scale_counter_novel").val(Number(ui_settings.cfg_scale).toFixed(2)); $("#phrase_rep_pen_novel").val(ui_settings.phrase_rep_pen || "off"); $("#mirostat_lr_novel").val(ui_settings.mirostat_lr); - $("#mirostat_lr_counter_novel").text(Number(ui_settings.mirostat_lr).toFixed(2)); + $("#mirostat_lr_counter_novel").val(Number(ui_settings.mirostat_lr).toFixed(2)); $("#mirostat_tau_novel").val(ui_settings.mirostat_tau); - $("#mirostat_tau_counter_novel").text(Number(ui_settings.mirostat_tau).toFixed(2)); + $("#mirostat_tau_counter_novel").val(Number(ui_settings.mirostat_tau).toFixed(2)); $("#min_length_novel").val(ui_settings.min_length); - $("#min_length_counter_novel").text(Number(ui_settings.min_length).toFixed(0)); + $("#min_length_counter_novel").val(Number(ui_settings.min_length).toFixed(0)); $('#nai_preamble_textarea').val(ui_settings.preamble); $('#nai_prefix').val(ui_settings.prefix || "vanilla"); $('#nai_cfg_uc').val(ui_settings.cfg_uc || ""); @@ -244,7 +244,7 @@ const sliders = [ { sliderId: "#rep_pen_freq_novel", counterId: "#rep_pen_freq_counter_novel", - format: (val) => `${val}`, + format: (val) => Number(val).toFixed(5), setValue: (val) => { nai_settings.repetition_penalty_frequency = Number(val).toFixed(5); }, }, { @@ -740,7 +740,7 @@ jQuery(function () { const value = $(this).val(); const formattedValue = slider.format(value); slider.setValue(value); - $(slider.counterId).text(formattedValue); + $(slider.counterId).val(formattedValue); saveSettingsDebounced(); }); }); diff --git a/public/scripts/openai.js b/public/scripts/openai.js index ef55d0672..eb53ee38a 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -2070,7 +2070,7 @@ function loadOpenAISettings(data, settings) { $('#model_ai21_select').val(oai_settings.ai21_model); $(`#model_ai21_select option[value="${oai_settings.ai21_model}"`).attr('selected', true); $('#openai_max_context').val(oai_settings.openai_max_context); - $('#openai_max_context_counter').text(`${oai_settings.openai_max_context}`); + $('#openai_max_context_counter').val(`${oai_settings.openai_max_context}`); $('#model_openrouter_select').val(oai_settings.openrouter_model); $('#openai_max_tokens').val(oai_settings.openai_max_tokens); @@ -2099,22 +2099,22 @@ function loadOpenAISettings(data, settings) { $('#send_if_empty_textarea').val(oai_settings.send_if_empty); $('#temp_openai').val(oai_settings.temp_openai); - $('#temp_counter_openai').text(Number(oai_settings.temp_openai).toFixed(2)); + $('#temp_counter_openai').val(Number(oai_settings.temp_openai).toFixed(2)); $('#freq_pen_openai').val(oai_settings.freq_pen_openai); - $('#freq_pen_counter_openai').text(Number(oai_settings.freq_pen_openai).toFixed(2)); + $('#freq_pen_counter_openai').val(Number(oai_settings.freq_pen_openai).toFixed(2)); $('#pres_pen_openai').val(oai_settings.pres_pen_openai); - $('#pres_pen_counter_openai').text(Number(oai_settings.pres_pen_openai).toFixed(2)); + $('#pres_pen_counter_openai').val(Number(oai_settings.pres_pen_openai).toFixed(2)); $('#count_pen').val(oai_settings.count_pen); - $('#count_pen_counter').text(Number(oai_settings.count_pen).toFixed(2)); + $('#count_pen_counter').val(Number(oai_settings.count_pen).toFixed(2)); $('#top_p_openai').val(oai_settings.top_p_openai); - $('#top_p_counter_openai').text(Number(oai_settings.top_p_openai).toFixed(2)); + $('#top_p_counter_openai').val(Number(oai_settings.top_p_openai).toFixed(2)); $('#top_k_openai').val(oai_settings.top_k_openai); - $('#top_k_counter_openai').text(Number(oai_settings.top_k_openai).toFixed(0)); + $('#top_k_counter_openai').val(Number(oai_settings.top_k_openai).toFixed(0)); if (settings.reverse_proxy !== undefined) oai_settings.reverse_proxy = settings.reverse_proxy; $('#openai_reverse_proxy').val(oai_settings.reverse_proxy); @@ -3119,43 +3119,43 @@ $(document).ready(async function () { $(document).on('input', '#temp_openai', function () { oai_settings.temp_openai = Number($(this).val()); - $('#temp_counter_openai').text(Number($(this).val()).toFixed(2)); + $('#temp_counter_openai').val(Number($(this).val()).toFixed(2)); saveSettingsDebounced(); }); $(document).on('input', '#freq_pen_openai', function () { oai_settings.freq_pen_openai = Number($(this).val()); - $('#freq_pen_counter_openai').text(Number($(this).val()).toFixed(2)); + $('#freq_pen_counter_openai').val(Number($(this).val()).toFixed(2)); saveSettingsDebounced(); }); $(document).on('input', '#pres_pen_openai', function () { oai_settings.pres_pen_openai = Number($(this).val()); - $('#pres_pen_counter_openai').text(Number($(this).val()).toFixed(2)); + $('#pres_pen_counter_openai').val(Number($(this).val()).toFixed(2)); saveSettingsDebounced(); }); $(document).on('input', '#count_pen', function () { oai_settings.count_pen = Number($(this).val()); - $('#count_pen_counter').text(Number($(this).val()).toFixed(2)); + $('#count_pen_counter').val(Number($(this).val()).toFixed(2)); saveSettingsDebounced(); }); $(document).on('input', '#top_p_openai', function () { oai_settings.top_p_openai = Number($(this).val()); - $('#top_p_counter_openai').text(Number($(this).val()).toFixed(2)); + $('#top_p_counter_openai').val(Number($(this).val()).toFixed(2)); saveSettingsDebounced(); }); $(document).on('input', '#top_k_openai', function () { oai_settings.top_k_openai = Number($(this).val()); - $('#top_k_counter_openai').text(Number($(this).val()).toFixed(0)); + $('#top_k_counter_openai').val(Number($(this).val()).toFixed(0)); saveSettingsDebounced(); }); $(document).on('input', '#openai_max_context', function () { oai_settings.openai_max_context = Number($(this).val()); - $('#openai_max_context_counter').text(`${$(this).val()}`); + $('#openai_max_context_counter').val(`${$(this).val()}`); calculateOpenRouterCost(); saveSettingsDebounced(); }); diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index 4a8fb35a6..63a552c23 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -44,8 +44,10 @@ export { getContextSettings, }; -export const MAX_CONTEXT_DEFAULT = 4096; +export const MAX_CONTEXT_DEFAULT = 8192; const MAX_CONTEXT_UNLOCKED = 65536; +const unlockedMaxContextStep = 4096 +const unlockedMaxContestMin = 8192 const defaultStoryString = "{{#if system}}{{system}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{char}}'s personality: {{personality}}\n{{/if}}{{#if scenario}}Scenario: {{scenario}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}"; const defaultExampleSeparator = '***'; @@ -551,7 +553,7 @@ function applyChatWidth(type) { }) } - $('#chat_width_slider_counter').text(power_user.chat_width); + $('#chat_width_slider_counter').val(power_user.chat_width); } async function applyThemeColor(type) { @@ -612,7 +614,7 @@ async function applyCustomCSS() { async function applyBlurStrength() { power_user.blur_strength = Number(localStorage.getItem(storage_keys.blur_strength) ?? 1); document.documentElement.style.setProperty('--blurStrength', power_user.blur_strength); - $("#blur_strength_counter").text(power_user.blur_strength); + $("#blur_strength_counter").val(power_user.blur_strength); $("#blur_strength").val(power_user.blur_strength); @@ -621,7 +623,7 @@ async function applyBlurStrength() { async function applyShadowWidth() { power_user.shadow_width = Number(localStorage.getItem(storage_keys.shadow_width) ?? 2); document.documentElement.style.setProperty('--shadowWidth', power_user.shadow_width); - $("#shadow_width_counter").text(power_user.shadow_width); + $("#shadow_width_counter").val(power_user.shadow_width); $("#shadow_width").val(power_user.shadow_width); } @@ -639,7 +641,7 @@ async function applyFontScale(type) { }) } - $("#font_scale_counter").text(power_user.font_scale); + $("#font_scale_counter").val(power_user.font_scale); $("#font_scale").val(power_user.font_scale); } @@ -985,13 +987,13 @@ function loadPowerUserSettings(settings, data) { $("#token_padding").val(power_user.token_padding); $("#font_scale").val(power_user.font_scale); - $("#font_scale_counter").text(power_user.font_scale); + $("#font_scale_counter").val(power_user.font_scale); $("#blur_strength").val(power_user.blur_strength); - $("#blur_strength_counter").text(power_user.blur_strength); + $("#blur_strength_counter").val(power_user.blur_strength); $("#shadow_width").val(power_user.shadow_width); - $("#shadow_width_counter").text(power_user.shadow_width); + $("#shadow_width_counter").val(power_user.shadow_width); $("#main-text-color-picker").attr('color', power_user.main_text_color); $("#italics-color-picker").attr('color', power_user.italics_text_color); @@ -1085,9 +1087,13 @@ function loadMaxContextUnlocked() { function switchMaxContextSize() { const elements = [$('#max_context'), $('#rep_pen_range'), $('#rep_pen_range_textgenerationwebui')]; const maxValue = power_user.max_context_unlocked ? MAX_CONTEXT_UNLOCKED : MAX_CONTEXT_DEFAULT; + const minValue = power_user.max_context_unlocked ? unlockedMaxContestMin : 0; + const steps = power_user.max_context_unlocked ? unlockedMaxContextStep : 256; for (const element of elements) { element.attr('max', maxValue); + element.attr('step', steps); + element.attr('min', minValue); const value = Number(element.val()); if (value >= maxValue) { @@ -2052,7 +2058,7 @@ $(document).ready(() => { $(`input[name="font_scale"]`).on('input', async function (e) { power_user.font_scale = Number(e.target.value); - $("#font_scale_counter").text(power_user.font_scale); + $("#font_scale_counter").val(power_user.font_scale); localStorage.setItem(storage_keys.font_scale, power_user.font_scale); await applyFontScale(); saveSettingsDebounced(); @@ -2060,7 +2066,7 @@ $(document).ready(() => { $(`input[name="blur_strength"]`).on('input', async function (e) { power_user.blur_strength = Number(e.target.value); - $("#blur_strength_counter").text(power_user.blur_strength); + $("#blur_strength_counter").val(power_user.blur_strength); localStorage.setItem(storage_keys.blur_strength, power_user.blur_strength); await applyBlurStrength(); saveSettingsDebounced(); @@ -2068,7 +2074,7 @@ $(document).ready(() => { $(`input[name="shadow_width"]`).on('input', async function (e) { power_user.shadow_width = Number(e.target.value); - $("#shadow_width_counter").text(power_user.shadow_width); + $("#shadow_width_counter").val(power_user.shadow_width); localStorage.setItem(storage_keys.shadow_width, power_user.shadow_width); await applyShadowWidth(); saveSettingsDebounced(); diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 4dcfe091c..571e99e6b 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -286,7 +286,8 @@ jQuery(function () { } else { const value = Number($(this).val()); - $(`#${id}_counter_textgenerationwebui`).text(value.toFixed(2)); + $(`#${id}_counter_textgenerationwebui`).val(value.toFixed(2)); + $("#rep_pen_range_counter_textgenerationwebui").val(Math.floor(value)); textgenerationwebui_settings[id] = value; } @@ -312,7 +313,8 @@ function setSettingByName(i, value, trigger) { else { const val = parseFloat(value); $(`#${i}_textgenerationwebui`).val(val); - $(`#${i}_counter_textgenerationwebui`).text(val.toFixed(2)); + $(`#${i}_counter_textgenerationwebui`).val(val.toFixed(2)); + $("#rep_pen_range_counter_textgenerationwebui").val(Math.floor(val)); } if (trigger) { diff --git a/public/style.css b/public/style.css index 7afcc433a..11b4eeca6 100644 --- a/public/style.css +++ b/public/style.css @@ -2269,7 +2269,7 @@ input[type='checkbox']:not(#nav-toggle):not(#rm_button_panel_pin):not(#lm_button text-align: center; } -.range-block-counter div[contenteditable="true"] { +.range-block-counter input { display: block; cursor: text; background-color: var(--black30a); @@ -2278,6 +2278,7 @@ input[type='checkbox']:not(#nav-toggle):not(#rm_button_panel_pin):not(#lm_button padding: 2px; flex: 1; text-align: center; + width: 70px; } .range-block-range { @@ -3664,4 +3665,4 @@ a { height: 100vh; z-index: 9999; } -} +} \ No newline at end of file