forked from extern/easydiffusion
Merge pull request #514 from JeLuF/checkinput
Prevent empty fields in make image request
This commit is contained in:
commit
e96b9005ca
@ -823,8 +823,17 @@ function getCurrentUserRequest() {
|
||||
function makeImage() {
|
||||
if (!isServerAvailable()) {
|
||||
alert('The server is not available.')
|
||||
return
|
||||
}
|
||||
} 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, {
|
||||
@ -834,6 +843,7 @@ function makeImage() {
|
||||
|
||||
initialText.style.display = 'none'
|
||||
}
|
||||
}
|
||||
|
||||
function createTask(task) {
|
||||
let taskConfig = `<b>Seed:</b> ${task.seed}, <b>Sampler:</b> ${task.reqBody.sampler}, <b>Inference Steps:</b> ${task.reqBody.num_inference_steps}, <b>Guidance Scale:</b> ${task.reqBody.guidance_scale}, <b>Model:</b> ${task.reqBody.use_stable_diffusion_model}`
|
||||
|
Loading…
Reference in New Issue
Block a user