mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-23 14:50:54 +01:00
Merge pull request #514 from JeLuF/checkinput
Prevent empty fields in make image request
This commit is contained in:
commit
e96b9005ca
@ -823,16 +823,26 @@ function getCurrentUserRequest() {
|
||||
function makeImage() {
|
||||
if (!isServerAvailable()) {
|
||||
alert('The server is not available.')
|
||||
return
|
||||
}
|
||||
const taskTemplate = getCurrentUserRequest()
|
||||
const newTaskRequests = []
|
||||
getPrompts().forEach((prompt) => newTaskRequests.push(Object.assign({}, taskTemplate, {
|
||||
reqBody: Object.assign({ prompt: prompt }, taskTemplate.reqBody)
|
||||
})))
|
||||
newTaskRequests.forEach(createTask)
|
||||
} else if (!randomSeedField.checked && seedField.value == '') {
|
||||
alert('The "Seed" field must not be empty.')
|
||||
} else if (numOutputsTotalField.value == '') {
|
||||
alert('The "Number of Images" field must not be empty.')
|
||||
} else if (numOutputsParallelField.value == '') {
|
||||
alert('The "Number of parallel Images" field must not be empty.')
|
||||
} else if (numInferenceStepsField.value == '') {
|
||||
alert('The "Inference Steps" field must not be empty.')
|
||||
} else if (guidanceScaleField.value == '') {
|
||||
alert('The Guidance Scale field must not be empty.')
|
||||
} else {
|
||||
const taskTemplate = getCurrentUserRequest()
|
||||
const newTaskRequests = []
|
||||
getPrompts().forEach((prompt) => newTaskRequests.push(Object.assign({}, taskTemplate, {
|
||||
reqBody: Object.assign({ prompt: prompt }, taskTemplate.reqBody)
|
||||
})))
|
||||
newTaskRequests.forEach(createTask)
|
||||
|
||||
initialText.style.display = 'none'
|
||||
initialText.style.display = 'none'
|
||||
}
|
||||
}
|
||||
|
||||
function createTask(task) {
|
||||
@ -1336,4 +1346,4 @@ window.addEventListener("beforeunload", function(e) {
|
||||
});
|
||||
|
||||
createCollapsibles()
|
||||
prettifyInputs(document);
|
||||
prettifyInputs(document);
|
||||
|
Loading…
Reference in New Issue
Block a user