mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-19 17:25:07 +02:00
updated lite
This commit is contained in:
+60
-8
@@ -7,7 +7,7 @@ Just copy this single static HTML file anywhere and open it in a browser, or fro
|
||||
Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite.
|
||||
If you are submitting a pull request for Lite, PLEASE use the above repo, not the KoboldCpp one.
|
||||
Kobold Lite is under the AGPL v3.0 License unless otherwise exempted. Please do not remove this line.
|
||||
Current version: 125
|
||||
Current version: 126
|
||||
-Concedo
|
||||
-->
|
||||
|
||||
@@ -3412,6 +3412,7 @@ Current version: 125
|
||||
const a1111_models_endpoint = "/sdapi/v1/sd-models";
|
||||
const a1111_options_endpoint = "/sdapi/v1/options";
|
||||
const a1111_txt2img_endpoint = "/sdapi/v1/txt2img";
|
||||
const a1111_img2img_endpoint = "/sdapi/v1/img2img";
|
||||
const a1111_interrogate_endpoint = "/sdapi/v1/interrogate";
|
||||
|
||||
const xtts_gen_endpoint = "/tts_to_audio/";
|
||||
@@ -3563,6 +3564,7 @@ Current version: 125
|
||||
img_allownsfw: true,
|
||||
img_cfgscale: 7,
|
||||
img_allowhd: false,
|
||||
img_img2imgstr: 0.6,
|
||||
img_steps: 20,
|
||||
img_sampler: "Euler a",
|
||||
img_aspect:0, //0=square,1=portrait,2=landscape
|
||||
@@ -4260,6 +4262,14 @@ Current version: 125
|
||||
}
|
||||
}
|
||||
|
||||
let ep = a1111_txt2img_endpoint;
|
||||
if(req_payload.source_image!="")
|
||||
{
|
||||
ep = a1111_img2img_endpoint;
|
||||
a1111_t2i_payload.init_images = [req_payload.source_image];
|
||||
a1111_t2i_payload.denoising_strength = req_payload.params.denoising_strength;
|
||||
}
|
||||
|
||||
if(localsettings.save_remote_images)
|
||||
{
|
||||
a1111_t2i_payload["save_images"] = true;
|
||||
@@ -4268,7 +4278,7 @@ Current version: 125
|
||||
//remove all null fields
|
||||
a1111_t2i_payload = Object.fromEntries(Object.entries(a1111_t2i_payload).filter(([_, v]) => v != null));
|
||||
|
||||
let gen_endpoint = localsettings.saved_a1111_url + a1111_txt2img_endpoint;
|
||||
let gen_endpoint = localsettings.saved_a1111_url + ep;
|
||||
console.log(a1111_t2i_payload);
|
||||
fetch(gen_endpoint, {
|
||||
method: 'POST',
|
||||
@@ -8022,6 +8032,7 @@ Current version: 125
|
||||
document.getElementById("save_images").checked = localsettings.save_images;
|
||||
document.getElementById("save_remote_images").checked = localsettings.save_remote_images;
|
||||
document.getElementById("img_cfgscale").value = localsettings.img_cfgscale;
|
||||
document.getElementById("img_img2imgstr").value = localsettings.img_img2imgstr;
|
||||
document.getElementById("img_aspect").value = localsettings.img_aspect;
|
||||
document.getElementById("img_sampler").value = localsettings.img_sampler;
|
||||
document.getElementById("img_steps").value = localsettings.img_steps;
|
||||
@@ -8244,6 +8255,7 @@ Current version: 125
|
||||
update_genimg_button_visiblility();
|
||||
|
||||
localsettings.img_cfgscale = parseFloat(document.getElementById("img_cfgscale").value);
|
||||
localsettings.img_img2imgstr = parseFloat(document.getElementById("img_img2imgstr").value);
|
||||
localsettings.img_aspect = parseInt(document.getElementById("img_aspect").value);
|
||||
localsettings.img_sampler = document.getElementById("img_sampler").value;
|
||||
localsettings.img_steps = parseInt(document.getElementById("img_steps").value);
|
||||
@@ -8255,6 +8267,11 @@ Current version: 125
|
||||
{
|
||||
localsettings.img_cfgscale = defaultsettings.img_cfgscale;
|
||||
}
|
||||
if(isNaN(localsettings.img_img2imgstr))
|
||||
{
|
||||
localsettings.img_img2imgstr = defaultsettings.img_img2imgstr;
|
||||
}
|
||||
localsettings.img_img2imgstr = cleannum(localsettings.img_img2imgstr, 0.0, 1.0);
|
||||
if(isNaN(localsettings.img_aspect))
|
||||
{
|
||||
localsettings.img_aspect = defaultsettings.img_aspect;
|
||||
@@ -8959,9 +8976,9 @@ Current version: 125
|
||||
show_abort_button(false);
|
||||
}
|
||||
|
||||
function do_manual_gen_image(sentence)
|
||||
function do_manual_gen_image(sentence, base64img="") //b64 for img2img
|
||||
{
|
||||
generate_new_image(sentence);
|
||||
generate_new_image(sentence, base64img);
|
||||
document.getElementById("btn_genimg").disabled = true;
|
||||
document.getElementById("btn_genimg2").disabled = true;
|
||||
//disable it for 8 sec to prevent spam
|
||||
@@ -10415,7 +10432,16 @@ Current version: 125
|
||||
return inputtext;
|
||||
}
|
||||
|
||||
function generate_new_image(sentence) {
|
||||
function generate_new_image(sentence, base64img="") {
|
||||
|
||||
if(base64img!="")
|
||||
{
|
||||
let parts = base64img.split(',');
|
||||
if (parts.length === 2 && parts[0].startsWith('data:image')) {
|
||||
base64img = parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(localsettings.image_styles && localsettings.image_styles!="")
|
||||
{
|
||||
@@ -10498,9 +10524,15 @@ Current version: 125
|
||||
"replacement_filter": true,
|
||||
"r2": false
|
||||
}
|
||||
if(base64img!="")
|
||||
{
|
||||
genimg_payload["source_image"] = base64img;
|
||||
genimg_payload["params"]["denoising_strength"] = localsettings.img_img2imgstr;
|
||||
}
|
||||
|
||||
if(localsettings.generate_images_mode==1) //horde
|
||||
{
|
||||
|
||||
fetch(stablehorde_submit_endpoint, {
|
||||
method: 'POST', // or 'PUT'
|
||||
headers: {
|
||||
@@ -10742,6 +10774,7 @@ Current version: 125
|
||||
AI Vision: `+visionstatus+` <span class="helpicon">?<span class="helptext">This allows the AI to visually recognize this image and react to it. On KoboldCpp, LLaVA models can be used. Otherwise, uses Horde or Local A1111 for image interrogation if enabled.</span></span>
|
||||
`+togglebtn+`
|
||||
<br><button type="button" class="btn btn-primary" style="width: 140px; padding: 2px; margin: 3px; font-size:12px;" onclick="show_orig_prompt()">View Original Prompt</button>
|
||||
<button type="button" class="btn btn-primary" style="width: 110px; padding: 2px; margin: 3px; font-size:12px;" onclick="add_img2img()">Create Img2Img</button>
|
||||
`;
|
||||
document.getElementById("aivisionmode").value = savedmeta.visionmode;
|
||||
}
|
||||
@@ -10756,6 +10789,19 @@ Current version: 125
|
||||
{
|
||||
msgbox(latest_orig_prompt,"Original Prompt");
|
||||
}
|
||||
function add_img2img()
|
||||
{
|
||||
inputBox("Enter prompt to create a new image, based on this source image.","Create Img2Img","","Enter Img2Img Prompt",()=>{
|
||||
let userinput = getInputBoxValue();
|
||||
if(userinput.trim()!="")
|
||||
{
|
||||
var sentence = userinput.trim().substring(0, 380);
|
||||
let b64 = document.getElementById("zoomedimg").src;
|
||||
do_manual_gen_image(sentence, b64);
|
||||
document.getElementById("zoomedimgcontainer").classList.add("hidden");
|
||||
}
|
||||
},false);
|
||||
}
|
||||
function click_image(target,imghash)
|
||||
{
|
||||
if(target)
|
||||
@@ -13620,7 +13666,7 @@ Current version: 125
|
||||
|
||||
<div class="popupcontainer flex hidden" id="customendpointcontainer">
|
||||
<div class="popupbg flex"></div>
|
||||
<div class="nspopup flexsize higher">
|
||||
<div class="nspopup flexsize evenhigher">
|
||||
<div class="popuptitlebar">
|
||||
<div class="popuptitletext">Select your AI provider</div>
|
||||
</div>
|
||||
@@ -14668,7 +14714,7 @@ Current version: 125
|
||||
|
||||
<div class="popupcontainer flex hidden" id="imagestylecontainer">
|
||||
<div class="popupbg flex"></div>
|
||||
<div class="nspopup fixsize moderate">
|
||||
<div class="nspopup flexsizesmall higher">
|
||||
<div class="popuptitlebar">
|
||||
<div class="popuptitletext">Image Generation Settings</div>
|
||||
</div>
|
||||
@@ -14697,7 +14743,7 @@ Current version: 125
|
||||
</select>
|
||||
</div>
|
||||
<div class="inlinelabel">
|
||||
<div class="justifyleft" style="padding:4px">Aspect Ratio<span class="helpicon">?
|
||||
<div class="justifyleft" style="padding:4px">Aspect Ratio <span class="helpicon">?
|
||||
<span class="helptext">Square is recommended. Changing aspect ratio will affect the resolution used to generate. This may impact quality or memory usage.</span>
|
||||
</span>: </div>
|
||||
<select style="padding:1px; height:23px; width: 100px;" class="form-control" id="img_aspect">
|
||||
@@ -14706,6 +14752,12 @@ Current version: 125
|
||||
<option value="2">Landscape</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="inlinelabel">
|
||||
<div class="justifyleft" style="padding:4px">Img2Img Strength <span class="helpicon">?
|
||||
<span class="helptext">Higher values lead to a more different image.</span>
|
||||
</span>: </div>
|
||||
<input type="text" inputmode="decimal" id="img_img2imgstr" style="width:60px">
|
||||
</div>
|
||||
<div class="inlinelabel">
|
||||
<div class="justifyleft" style="padding:4px">Save Higher-Res <span class="helpicon">?
|
||||
<span class="helptext">This option will result in larger save files which may be slower. Changing this setting only applies to NEW images.</span>
|
||||
|
||||
Reference in New Issue
Block a user