diff --git a/embd_res/klite.embd b/embd_res/klite.embd
index 2d008b942..025968e42 100644
--- a/embd_res/klite.embd
+++ b/embd_res/klite.embd
@@ -760,6 +760,10 @@ Current version indicated by LITEVER below.
}
}
+ #chat_msg_body {
+ padding-bottom: 1.5rem;
+ }
+
/* Viewports */
#maineditbody
@@ -4550,6 +4554,7 @@ Current version indicated by LITEVER below.
adaptivep_target: -1.0,
adaptivep_decay: 0.9,
sampler_order: [6, 0, 1, 3, 4, 2, 5],
+ custom_sampler_fields: {},
};
const defaultsettings = JSON.parse(JSON.stringify(localsettings));
@@ -12813,6 +12818,30 @@ Current version indicated by LITEVER below.
document.getElementById("secondepsamplecontainer").classList.remove("hidden");
}
+ var pendingcustomfieldssampler = {};
+ function show_customfields_sampler()
+ {
+ inputBoxOkCancel("Insert JSON object containing custom fields to send. These values will be added to every generation payload.","Extra Custom Fields",JSON.stringify(pendingcustomfieldssampler),"Paste JSON Here",()=>{
+ let userinput = getInputBoxValue().trim();
+ try
+ {
+ pendingcustomfieldssampler = {};
+ if(userinput!="")
+ {
+ pendingcustomfieldssampler = JSON.parse(userinput);
+ }
+ document.getElementById("custom_field_overview").innerText = (pendingcustomfieldssampler && Object.keys(pendingcustomfieldssampler).length>0)?(`${Object.keys(pendingcustomfieldssampler).length} items`):"OFF";
+ sampler_setting_tweaked();
+ } catch (e) {
+ console.log("Custom fields incorrectly formatted: "+e);
+ }
+
+ },
+ ()=>{
+ //do nothing on cancel
+ },false,true);
+ }
+
function explain_horde()
{
msgbox("The AI Horde generates text using crowdsourced GPUs by volunteer workers. By default your inputs are not logged, but as Horde workers are open source, they can be modified to do so.
In all cases, the sender will *always be anonymous*, however you are still advised to avoid sending privacy sensitive information.
","Disclaimer",true);
@@ -15797,6 +15826,7 @@ Current version indicated by LITEVER below.
document.getElementById("nsigma").value = localsettings.nsigma;
document.getElementById("dynatemp_overview").innerText = (localsettings.dynatemp_range!=0?"ON":"OFF");
document.getElementById("second_ep_overview").innerText = (localsettings.second_ep_qty>0 && localsettings.second_ep_url?"ON":"OFF");
+ document.getElementById("custom_field_overview").innerText = (localsettings.custom_sampler_fields && Object.keys(localsettings.custom_sampler_fields).length>0)?(`${Object.keys(localsettings.custom_sampler_fields).length} items`):"OFF";
document.getElementById("presence_penalty").value = localsettings.presence_penalty;
document.getElementById("sampler_seed").value = localsettings.sampler_seed;
document.getElementById("top_k").value = document.getElementById("top_k_slide").value = localsettings.top_k;
@@ -15934,6 +15964,7 @@ Current version indicated by LITEVER below.
document.getElementById("imagestyleinput").value = localsettings.image_styles;
document.getElementById("negpromptinput").value = localsettings.image_negprompt;
pendinggrammar = localsettings.grammar;
+ pendingcustomfieldssampler = JSON.parse(JSON.stringify(localsettings.custom_sampler_fields));
//prepare the input for sampler order
let samplerstr = localsettings.sampler_order.toString();
@@ -16138,6 +16169,7 @@ Current version indicated by LITEVER below.
document.getElementById("miro_tau").value = found.miro_tau == null? defaultsettings.miro_tau : found.miro_tau;
document.getElementById("miro_eta").value = found.miro_eta == null? defaultsettings.miro_eta : found.miro_eta;
pendinggrammar = found.grammar == null? defaultsettings.grammar : found.grammar;
+ pendingcustomfieldssampler = found.custom_sampler_fields == null? defaultsettings.custom_sampler_fields : found.custom_sampler_fields;
document.getElementById("dynatemp_range").value = found.dynatemp_range;
document.getElementById("dynatemp_exponent").value = found.dynatemp_exponent;
document.getElementById("dynatemp_overview").innerText = (document.getElementById("dynatemp_range").value!=0?"ON":"OFF");
@@ -16145,6 +16177,7 @@ Current version indicated by LITEVER below.
document.getElementById("second_ep_model").value = found.second_ep_model == null? defaultsettings.second_ep_model : found.second_ep_model;
document.getElementById("second_ep_url").value = found.second_ep_url == null? defaultsettings.second_ep_url : found.second_ep_url;
document.getElementById("second_ep_overview").innerText = (document.getElementById("second_ep_qty").value>0 && document.getElementById("second_ep_url").value!=""?"ON":"OFF");
+ document.getElementById("custom_field_overview").innerText = (pendingcustomfieldssampler && Object.keys(pendingcustomfieldssampler).length>0)?(`${Object.keys(pendingcustomfieldssampler).length} items`):"OFF";
} else {
document.getElementById("presetsdesc").innerText = "";
}
@@ -16281,6 +16314,7 @@ Current version indicated by LITEVER below.
miro_tau: parseFloat(document.getElementById("miro_tau").value),
miro_eta: parseFloat(document.getElementById("miro_eta").value),
grammar: pendinggrammar,
+ custom_sampler_fields: pendingcustomfieldssampler,
dynatemp_range: parseFloat(document.getElementById("dynatemp_range").value),
dynatemp_exponent: parseFloat(document.getElementById("dynatemp_exponent").value),
second_ep_qty: document.getElementById("second_ep_qty").value,
@@ -16427,6 +16461,7 @@ Current version indicated by LITEVER below.
document.getElementById("adaptivep_decay").value != (found.adaptivep_decay != null ? found.adaptivep_decay : defaultsettings.adaptivep_decay) ||
document.getElementById("nsigma").value != found.nsigma ||
pendinggrammar != (found.grammar ? found.grammar : defaultsettings.grammar) ||
+ JSON.stringify(pendingcustomfieldssampler) != (found.custom_sampler_fields ? JSON.stringify(found.custom_sampler_fields) : JSON.stringify(defaultsettings.custom_sampler_fields)) ||
document.getElementById("dynatemp_range").value != found.dynatemp_range ||
document.getElementById("dynatemp_exponent").value != found.dynatemp_exponent ||
document.getElementById("second_ep_qty").value != (found.second_ep_qty != null ? found.second_ep_qty : defaultsettings.second_ep_qty) ||
@@ -16847,6 +16882,7 @@ Current version indicated by LITEVER below.
localsettings.image_styles = document.getElementById("imagestyleinput").value;
localsettings.image_negprompt = document.getElementById("negpromptinput").value;
localsettings.grammar = pendinggrammar;
+ localsettings.custom_sampler_fields = pendingcustomfieldssampler;
localsettings.tokenstreammode = document.getElementById("tokenstreammode").value;
localsettings.img_autogen_type = document.getElementById("img_autogen_type").value;
localsettings.img_crop = (document.getElementById("img_crop").checked ? true : false);
@@ -17446,6 +17482,8 @@ Current version indicated by LITEVER below.
"models": selected_models.map((m) => { return m.name }),
};
+ Object.assign(submit_payload.params, localsettings.custom_sampler_fields);
+
if (localsettings.sampler_seed >= 1) {
submit_payload.params.sampler_seed = localsettings.sampler_seed;
}
@@ -17522,6 +17560,8 @@ Current version indicated by LITEVER below.
"models": selected_models.map((m) => { return m.name }),
};
+ Object.assign(submit_payload.params, localsettings.custom_sampler_fields);
+
if(localsettings.sampler_seed>=1)
{
submit_payload.params.sampler_seed = localsettings.sampler_seed;
@@ -20515,6 +20555,8 @@ Current version indicated by LITEVER below.
"models": selected_models.map((m) => { return m.name }),
};
+ Object.assign(submit_payload.params, localsettings.custom_sampler_fields);
+
if(is_using_kcpp_with_added_memory())
{
submit_payload.params.memory = truncated_memory;
@@ -21008,6 +21050,16 @@ Current version indicated by LITEVER below.
"temperature": submit_payload.params.temperature,
"top_p": submit_payload.params.top_p
}
+ if(document.getElementById("useoainonstandard").checked)
+ {
+ //send ALL non standard params
+ if(submit_payload.params.sampler_seed>=1)
+ {
+ oai_payload.seed = submit_payload.params.sampler_seed;
+ }
+ Object.assign(oai_payload, submit_payload.params);
+ }
+ Object.assign(oai_payload, localsettings.custom_sampler_fields);
if(localsettings.request_logprobs && !targetep.toLowerCase().includes("api.x.ai") && !targetep.toLowerCase().includes("api.mistral.ai"))
{
if(document.getElementById("useoaichatcompl").checked || targetep.toLowerCase().includes("api.x.ai"))
@@ -21034,18 +21086,10 @@ Current version indicated by LITEVER below.
if(!targetep.toLowerCase().includes("pollinations.ai") && !targetep.toLowerCase().includes("api.mistral.ai") && !targetep.toLowerCase().includes("api.x.ai"))
{
//mistral api does not support presence pen
- oai_payload.presence_penalty = scaled_rep_pen;
- }
- if(document.getElementById("useoainonstandard").checked)
- {
- //featherless api supports additional fields, include them
- oai_payload.top_k = (submit_payload.params.top_k<1?300:submit_payload.params.top_k);
- oai_payload.min_p = localsettings.min_p;
- if(submit_payload.params.sampler_seed>=1)
+ if(scaled_rep_pen>0)
{
- oai_payload.seed = submit_payload.params.sampler_seed;
+ oai_payload.presence_penalty = scaled_rep_pen;
}
- oai_payload.top_a = localsettings.top_a;
}
if(submit_payload.params.logit_bias && JSON.stringify(submit_payload.params.logit_bias) != '{}')
{
@@ -21312,6 +21356,7 @@ Current version indicated by LITEVER below.
"max_tokens": submit_payload.params.max_length,
"temperature": submit_payload.params.temperature,
};
+ Object.assign(claude_payload, localsettings.custom_sampler_fields);
claude_payload.messages.push({"role": "user", "content": submit_payload.prompt})
if(sysprompt)
{
@@ -21528,6 +21573,8 @@ Current version indicated by LITEVER below.
}
};
+ Object.assign(payload, localsettings.custom_sampler_fields);
+
if(document.getElementById("usegeminiweb").checked)
{
payload["tools"] = [{"google_search": {}}];
@@ -21710,6 +21757,8 @@ Current version indicated by LITEVER below.
submit_payload.params.smoothing_factor = localsettings.smoothing_factor;
// submit_payload.params.smoothing_curve = localsettings.smoothing_curve; //no idea if horde supports this, dont care to check
// submit_payload.params.nsigma = localsettings.nsigma;
+
+ Object.assign(submit_payload.params, localsettings.custom_sampler_fields);
}
last_request_str = JSON.stringify(submit_payload);
@@ -30130,6 +30179,15 @@ Current version indicated by LITEVER below.
+