From 4e8c2e945d69ed87e2ecb95b30104e20f6fdb985 Mon Sep 17 00:00:00 2001 From: Abdullah Alfaraj Date: Mon, 27 Feb 2023 05:38:56 +0300 Subject: [PATCH] check for missing controlNet input for img2img mode --- sdapi_py_re.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sdapi_py_re.js b/sdapi_py_re.js index 94a3c5a..d4c0c97 100644 --- a/sdapi_py_re.js +++ b/sdapi_py_re.js @@ -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: {