mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-25 01:34:38 +01:00
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;;
|
||||
}
|
||||
|
||||
.validation-failed {
|
||||
border: solid 2px red;
|
||||
}
|
||||
/* SCROLLBARS */
|
||||
:root {
|
||||
--scrollbar-width: 14px;
|
||||
|
@ -821,12 +821,25 @@ function makeImage() {
|
||||
}
|
||||
if (!randomSeedField.checked && seedField.value == "") {
|
||||
alert('The "Seed" field must not be empty.')
|
||||
seedField.classList.add("validation-failed")
|
||||
return
|
||||
}
|
||||
seedField.classList.remove("validation-failed")
|
||||
|
||||
if (numInferenceStepsField.value == "") {
|
||||
alert('The "Inference Steps" field must not be empty.')
|
||||
numInferenceStepsField.classList.add("validation-failed")
|
||||
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) {
|
||||
numOutputsTotalField.value = 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user