check for missing controlNet input for img2img mode

pull/124/head
Abdullah Alfaraj 2023-02-27 05:38:56 +03:00
parent c75ee5b5c5
commit 4e8c2e945d
1 changed files with 14 additions and 0 deletions

View File

@ -651,6 +651,20 @@ async function requestControlNetImg2Img(plugin_settings) {
const control_net_settings =
control_net.mapPluginSettingsToControlNet(plugin_settings)
if (!control_net_settings['controlnet_input_image'][0]) {
app.showAlert('you need to add a valid ControlNet input image')
throw 'you need to add a valid ControlNet input image'
}
if (!control_net_settings['controlnet_module']) {
app.showAlert('you need to select a valid ControlNet Module')
throw 'you need to select a valid ControlNet Module'
}
if (!control_net_settings['controlnet_model']) {
app.showAlert('you need to select a valid ControlNet Model')
throw 'you need to select a valid ControlNet Model'
}
let request = await fetch(full_url, {
method: 'POST',
headers: {