From bca582bcbf516e45b2dbdf8f5932d79e813e71ed Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Fri, 6 Oct 2023 13:02:33 +0900 Subject: [PATCH] improve: direct `select_index` is allowed for switch's select --- modules/impact/config.py | 2 +- modules/impact/impact_server.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/impact/config.py b/modules/impact/config.py index 1743870..90b4809 100644 --- a/modules/impact/config.py +++ b/modules/impact/config.py @@ -2,7 +2,7 @@ import configparser import os -version = "V4.15.5" +version = "V4.15.6" dependency_version = 13 diff --git a/modules/impact/impact_server.py b/modules/impact/impact_server.py index 7841247..c8ff059 100644 --- a/modules/impact/impact_server.py +++ b/modules/impact/impact_server.py @@ -249,6 +249,11 @@ def onprompt_for_switch(json_data): input_node = json_data['prompt'][select_input[0]] if input_node['class_type'] == 'ImpactInt' and 'inputs' in input_node and 'value' in input_node['inputs']: onprompt_switch_info[k] = input_node['inputs']['value'] + if input_node['class_type'] == 'ImpactSwitch' and 'inputs' in input_node and 'select' in input_node['inputs']: + if isinstance(input_node['inputs']['select'], int): + onprompt_switch_info[k] = input_node['inputs']['select'] + else: + print(f"\n##### ##### #####\n[WARN] {cls}: For the 'select' operation, only 'select_index' of the 'ImpactSwitch', which is not an input, or 'ImpactInt' and 'Primitive' are allowed as inputs.\n##### ##### #####\n") else: onprompt_switch_info[k] = select_input