prettier
Former-commit-id: 25e8a310d47a5e34e269b31e75699e99b1c8888b
This commit is contained in:
parent
43c6344507
commit
53635fc26f
1 changed files with 14 additions and 14 deletions
14
js/index.js
14
js/index.js
|
@ -784,8 +784,9 @@ function changeEnableErasing() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSampler() {
|
function changeSampler() {
|
||||||
if(!document.getElementById("samplerSelect").value == ""){ // must be done, since before getSamplers is done, the options are empty
|
if (!document.getElementById("samplerSelect").value == "") {
|
||||||
console.log(document.getElementById("samplerSelect").value == "")
|
// must be done, since before getSamplers is done, the options are empty
|
||||||
|
console.log(document.getElementById("samplerSelect").value == "");
|
||||||
stableDiffusionData.sampler_index =
|
stableDiffusionData.sampler_index =
|
||||||
document.getElementById("samplerSelect").value;
|
document.getElementById("samplerSelect").value;
|
||||||
localStorage.setItem("sampler", stableDiffusionData.sampler_index);
|
localStorage.setItem("sampler", stableDiffusionData.sampler_index);
|
||||||
|
@ -1088,7 +1089,7 @@ async function getModels(){
|
||||||
option.value = data[i].title;
|
option.value = data[i].title;
|
||||||
modelSelect.add(option);
|
modelSelect.add(option);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
/* To get the current model, we might need to call /config/ which returns a json file with EVERYTHING from the webui, 25k lines of json... i havent figured out any other way to get the model thats loaded
|
/* To get the current model, we might need to call /config/ which returns a json file with EVERYTHING from the webui, 25k lines of json... i havent figured out any other way to get the model thats loaded
|
||||||
response >> components >> second component(quicksettings with checkpoint chooser as default) >> value = the current model
|
response >> components >> second component(quicksettings with checkpoint chooser as default) >> value = the current model
|
||||||
|
@ -1102,7 +1103,7 @@ async function getModels(){
|
||||||
var model = data.components[1].props.value;
|
var model = data.components[1].props.value;
|
||||||
console.log("Current model: " + model);
|
console.log("Current model: " + model);
|
||||||
modelSelect.value = model;
|
modelSelect.value = model;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeModel() {
|
function changeModel() {
|
||||||
|
@ -1110,8 +1111,8 @@ function changeModel(){
|
||||||
console.log("changing model to " + document.getElementById("models").value);
|
console.log("changing model to " + document.getElementById("models").value);
|
||||||
var model_title = document.getElementById("models").value;
|
var model_title = document.getElementById("models").value;
|
||||||
var payload = {
|
var payload = {
|
||||||
"sd_model_checkpoint": model_title
|
sd_model_checkpoint: model_title,
|
||||||
}
|
};
|
||||||
var url = document.getElementById("host").value + "/sdapi/v1/options/";
|
var url = document.getElementById("host").value + "/sdapi/v1/options/";
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -1167,7 +1168,6 @@ function getSamplers(){
|
||||||
error
|
error
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
async function upscaleAndDownload() {
|
async function upscaleAndDownload() {
|
||||||
// Future improvements: some upscalers take a while to upscale, so we should show a loading bar or something, also a slider for the upscale amount
|
// Future improvements: some upscalers take a while to upscale, so we should show a loading bar or something, also a slider for the upscale amount
|
||||||
|
|
Loading…
Reference in a new issue