forked from extern/easydiffusion
Warn when no controlnet model is chosen (#1503)
* Warn when no controlnet model is chosen * Update main.js
This commit is contained in:
parent
2baad73bb9
commit
23a0a48b81
@ -1461,6 +1461,9 @@ button#save-system-settings-btn {
|
|||||||
cursor: pointer;;
|
cursor: pointer;;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.validation-failed {
|
||||||
|
border: solid 2px red;
|
||||||
|
}
|
||||||
/* SCROLLBARS */
|
/* SCROLLBARS */
|
||||||
:root {
|
:root {
|
||||||
--scrollbar-width: 14px;
|
--scrollbar-width: 14px;
|
||||||
|
@ -821,12 +821,25 @@ function makeImage() {
|
|||||||
}
|
}
|
||||||
if (!randomSeedField.checked && seedField.value == "") {
|
if (!randomSeedField.checked && seedField.value == "") {
|
||||||
alert('The "Seed" field must not be empty.')
|
alert('The "Seed" field must not be empty.')
|
||||||
|
seedField.classList.add("validation-failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
seedField.classList.remove("validation-failed")
|
||||||
|
|
||||||
if (numInferenceStepsField.value == "") {
|
if (numInferenceStepsField.value == "") {
|
||||||
alert('The "Inference Steps" field must not be empty.')
|
alert('The "Inference Steps" field must not be empty.')
|
||||||
|
numInferenceStepsField.classList.add("validation-failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
numInferenceStepsField.classList.remove("validation-failed")
|
||||||
|
|
||||||
|
if (controlnetModelField.value === "" && IMAGE_REGEX.test(controlImagePreview.src)) {
|
||||||
|
alert("Please choose a ControlNet model, to use the ControlNet image.")
|
||||||
|
document.getElementById("controlnet_model").classList.add("validation-failed")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
document.getElementById("controlnet_model").classList.remove("validation-failed")
|
||||||
|
|
||||||
if (numOutputsTotalField.value == "" || numOutputsTotalField.value == 0) {
|
if (numOutputsTotalField.value == "" || numOutputsTotalField.value == 0) {
|
||||||
numOutputsTotalField.value = 1
|
numOutputsTotalField.value = 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user