From 4b0893c87a5f47e8a2cecb6624ede740dff2aa92 Mon Sep 17 00:00:00 2001 From: Abdullah Alfaraj Date: Sat, 11 Mar 2023 01:03:21 +0300 Subject: [PATCH] setters for controlnet's model and module menus --- utility/tab/control_net.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/utility/tab/control_net.js b/utility/tab/control_net.js index b40046c..d2af8dc 100644 --- a/utility/tab/control_net.js +++ b/utility/tab/control_net.js @@ -21,19 +21,26 @@ class ControlNetUnit { const module = getSelectedModule(index) return module } - // static setModule(index) { - // html_manip.menu - // const module = getSelectedModule(index) - // return module - // } + static setModule(index, module_item) { + try { + const module_menu_id = 'mModulesMenuControlNet_' + index + html_manip.selectMenuItem(module_menu_id, module_item) + } catch (e) { + console.warn(e) + } + } static getModel(index) { const model = getSelectedModel(index) return model } - // static setModel(index) { - // const model = getSelectedModel(index) - // return model - // } + static setModel(index, model_item) { + try { + const model_menu_id = 'mModelsMenuControlNet_' + index + html_manip.selectMenuItem(model_menu_id, model_item) + } catch (e) { + console.warn(e) + } + } static getWeight(index = 0) { const weight = getWeight(index) return weight