Add Integer and Versatile Multiple Inputs Nodes
This commit is contained in:
@@ -24,13 +24,30 @@ Repository: Otonx's Custom Nodes for ComfyUI.
|
||||
|
||||
---
|
||||
|
||||
### OTX Integer Multiple Inputs
|
||||
|
||||
**Description:** This node series is specialized for receiving multiple integer inputs, optimizing data input processes while ensuring consistent data type integration.
|
||||
|
||||
**Functionality:** The node provides several slots, each designed to accept integer values. Users have the flexibility to manually set each slot by directly typing in the integer values, streamlining the input process or connecting the inputs or outputs to other nodes,. Each slot acts as a dedicated integer input that can be seamlessly connected to downstream nodes.
|
||||
|
||||
**Utility:** It streamlines node setups by consolidating multiple integer input slots into a single node, reducing the need for individual integer nodes.
|
||||
|
||||
- **OTX Integer Multiple Inputs 4:** Features a 4-slot configuration for integer inputs.
|
||||
- **OTX Integer Multiple Inputs 5:** Features a 5-slot configuration for integer inputs.
|
||||
- **OTX Integer Multiple Inputs 6:** Features a 6-slot configuration for integer inputs.
|
||||
|
||||
---
|
||||
|
||||
### OTX Versatile Multiple Inputs
|
||||
|
||||
**Description:** A user-defined inputs node allowing for the definition of up to five values, each accompanied by its data type specification (INT, FLOAT, or STRING).
|
||||
**Description:** A dynamic node series designed for diverse data input configurations. It can accommodate varying data types, granting users the flexibility to define and manage multiple data inputs within a singular node.
|
||||
|
||||
**Functionality:** Users can define the data value and type for each of the five slots, ensuring accurate data type handling for downstream nodes.
|
||||
**Functionality:** Each slot within the node, implemented as a multiline textbox to handle longer strings, can be configured to accept one of three data types: INT, FLOAT, or STRING. In addition to connecting the inputs or outputs to other nodes, users can manually set data by typing into the multiline textboxes, ensuring both the value and its type are correctly configured for downstream processing.
|
||||
|
||||
**Utility:** Provides a flexible input mechanism, eliminating the need for multiple single-value nodes.
|
||||
**Utility:** This node series offers an integrated platform for diverse data inputs, negating the need for multiple nodes dedicated to distinct data types.
|
||||
|
||||
<img src="https://github.com/budihartono/comfyui_otonx_nodes/blob/main/docs/img/otx_versatile_inputs.png" width="40%" height="40%">
|
||||
- **OTX Versatile Multiple Inputs 4:** A 4-slot design, where each multiline textbox slot is configurable to INT, FLOAT, or STRING.
|
||||
- **OTX Versatile Multiple Inputs 5:** A 5-slot design, where each multiline textbox slot is configurable to INT, FLOAT, or STRING.
|
||||
- **OTX Versatile Multiple Inputs 6:** A 6-slot design, where each multiline textbox slot is configurable to INT, FLOAT, or STRING.
|
||||
|
||||
<img src="https://github.com/budihartono/comfyui_otonx_nodes/blob/main/docs/img/otx_versatile_inputs.png" width="40%" height="40%">
|
||||
+12
-2
@@ -3,11 +3,21 @@ from .otonx_nodes import *
|
||||
# ########################################################################################################################
|
||||
# # NODE MAPPING
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"OTX Versatile Multiple Inputs": OTX_VersatileMultipleInputs,
|
||||
"OTX Integer Multiple Inputs 4": OTX_IntegerMultipleInputs_4,
|
||||
"OTX Integer Multiple Inputs 5": OTX_IntegerMultipleInputs_5,
|
||||
"OTX Integer Multiple Inputs 6": OTX_IntegerMultipleInputs_6,
|
||||
"OTX Versatile Multiple Inputs 4": OTX_VersatileMultipleInputs_4,
|
||||
"OTX Versatile Multiple Inputs 5": OTX_VersatileMultipleInputs_5,
|
||||
"OTX Versatile Multiple Inputs 6": OTX_VersatileMultipleInputs_6,
|
||||
"OTX KSampler Feeder" : OTX_KSampler_Feeder,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"OTX Versatile Multiple Inputs": "OTX Versatile Multiple Inputs",
|
||||
"OTX Integer Multiple Inputs 4": "OTX Integer Multiple Inputs 4",
|
||||
"OTX Integer Multiple Inputs 5": "OTX Integer Multiple Inputs 5",
|
||||
"OTX Integer Multiple Inputs 6": "OTX Integer Multiple Inputs 6",
|
||||
"OTX Versatile Multiple Inputs 4": "OTX Versatile Multiple Inputs 4",
|
||||
"OTX Versatile Multiple Inputs 5": "OTX Versatile Multiple Inputs 5",
|
||||
"OTX Versatile Multiple Inputs 6": "OTX Versatile Multiple Inputs 6",
|
||||
"OTX KSampler Feeder": "OTX KSampler Feeder",
|
||||
}
|
||||
+219
-2
@@ -6,7 +6,144 @@ class AnyType(str):
|
||||
|
||||
any_type = AnyType("*")
|
||||
|
||||
class OTX_VersatileMultipleInputs:
|
||||
class OTX_IntegerMultipleInputs_4:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(self):
|
||||
return {
|
||||
"required": {
|
||||
"int_1": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_2": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_3": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_4": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
},
|
||||
}
|
||||
RETURN_TYPES = ("INT","INT","INT","INT",)
|
||||
|
||||
FUNCTION = "pass_parameters"
|
||||
|
||||
CATEGORY = "OtonxPack"
|
||||
|
||||
def pass_parameters(self, int_1, int_2, int_3, int_4):
|
||||
return int_1, int_2, int_3, int_4
|
||||
|
||||
class OTX_IntegerMultipleInputs_5:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(self):
|
||||
return {
|
||||
"required": {
|
||||
"int_1": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_2": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_3": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_4": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_5": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
},
|
||||
}
|
||||
RETURN_TYPES = ("INT","INT","INT","INT","INT",)
|
||||
|
||||
FUNCTION = "pass_parameters"
|
||||
|
||||
CATEGORY = "OtonxPack"
|
||||
|
||||
def pass_parameters(self, int_1, int_2, int_3, int_4, int_5):
|
||||
return int_1, int_2, int_3, int_4, int_5
|
||||
|
||||
class OTX_IntegerMultipleInputs_6:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(self):
|
||||
return {
|
||||
"required": {
|
||||
"int_1": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_2": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_3": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_4": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_5": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
"int_6": ("INT", {"default": 0, "min": 0, "max": 10000}),
|
||||
},
|
||||
}
|
||||
RETURN_TYPES = ("INT","INT","INT","INT","INT","INT",)
|
||||
|
||||
FUNCTION = "pass_parameters"
|
||||
|
||||
CATEGORY = "OtonxPack"
|
||||
|
||||
def pass_parameters(self, int_1, int_2, int_3, int_4, int_5, int_6):
|
||||
return int_1, int_2, int_3, int_4, int_5, int_6
|
||||
|
||||
|
||||
class OTX_VersatileMultipleInputs_4:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(self):
|
||||
return {
|
||||
"required": {
|
||||
"value_1": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_1": (list(('int', 'float', 'string')),),
|
||||
"value_2": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_2": (list(('int', 'float', 'string')),),
|
||||
"value_3": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_3": (list(('int', 'float', 'string')),),
|
||||
"value_4": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_4": (list(('int', 'float', 'string')),),
|
||||
},
|
||||
}
|
||||
RETURN_TYPES = (any_type, any_type, any_type, any_type,)
|
||||
RETURN_NAMES = ("value_1", "value_2", "value_3", "value_4")
|
||||
|
||||
FUNCTION = "pass_parameters"
|
||||
|
||||
CATEGORY = "OtonxPack"
|
||||
|
||||
def pass_parameters(self, value_1, value_2, value_3, value_4, valuetype_1, valuetype_2, valuetype_3, valuetype_4):
|
||||
# Convert value_1 based on valuetype_1
|
||||
if valuetype_1 == "INT":
|
||||
value_1 = int(value_1)
|
||||
elif valuetype_1 == "FLOAT":
|
||||
value_1 = float(value_1)
|
||||
elif valuetype_1 == "STRING":
|
||||
value_1 = str(value_1)
|
||||
|
||||
# Convert value_2 based on valuetype_2
|
||||
if valuetype_2 == "INT":
|
||||
value_2 = int(value_2)
|
||||
elif valuetype_2 == "FLOAT":
|
||||
value_2 = float(value_2)
|
||||
elif valuetype_2 == "STRING":
|
||||
value_2 = str(value_2)
|
||||
|
||||
# Convert value_3 based on valuetype_3
|
||||
if valuetype_3 == "INT":
|
||||
value_3 = int(value_3)
|
||||
elif valuetype_3 == "FLOAT":
|
||||
value_3 = float(value_3)
|
||||
elif valuetype_3 == "STRING":
|
||||
value_3 = str(value_3)
|
||||
|
||||
# Convert value_4 based on valuetype_4
|
||||
if valuetype_4 == "INT":
|
||||
value_4 = int(value_4)
|
||||
elif valuetype_4 == "FLOAT":
|
||||
value_4 = float(value_4)
|
||||
elif valuetype_4 == "STRING":
|
||||
value_4 = str(value_4)
|
||||
|
||||
return value_1, value_2, value_3, value_4
|
||||
|
||||
class OTX_VersatileMultipleInputs_5:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
@@ -76,6 +213,86 @@ class OTX_VersatileMultipleInputs:
|
||||
value_5 = str(value_5)
|
||||
return value_1, value_2, value_3, value_4, value_5
|
||||
|
||||
class OTX_VersatileMultipleInputs_6:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(self):
|
||||
return {
|
||||
"required": {
|
||||
"value_1": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_1": (list(('int', 'float', 'string')),),
|
||||
"value_2": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_2": (list(('int', 'float', 'string')),),
|
||||
"value_3": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_3": (list(('int', 'float', 'string')),),
|
||||
"value_4": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_4": (list(('int', 'float', 'string')),),
|
||||
"value_5": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_5": (list(('int', 'float', 'string')),),
|
||||
"value_6": ("STRING", {"default": "", "multiline": True}),
|
||||
"valuetype_6": (list(('int', 'float', 'string')),),
|
||||
},
|
||||
}
|
||||
RETURN_TYPES = (any_type, any_type, any_type, any_type, any_type, any_type,)
|
||||
RETURN_NAMES = ("value_1", "value_2", "value_3", "value_4", "value_5", "value_6")
|
||||
|
||||
FUNCTION = "pass_parameters"
|
||||
|
||||
CATEGORY = "OtonxPack"
|
||||
|
||||
def pass_parameters(self, value_1, value_2, value_3, value_4, value_5, value_6, valuetype_1, valuetype_2, valuetype_3, valuetype_4, valuetype_5, valuetype_6):
|
||||
# Convert value_1 based on valuetype_1
|
||||
if valuetype_1 == "INT":
|
||||
value_1 = int(value_1)
|
||||
elif valuetype_1 == "FLOAT":
|
||||
value_1 = float(value_1)
|
||||
elif valuetype_1 == "STRING":
|
||||
value_1 = str(value_1)
|
||||
|
||||
# Convert value_2 based on valuetype_2
|
||||
if valuetype_2 == "INT":
|
||||
value_2 = int(value_2)
|
||||
elif valuetype_2 == "FLOAT":
|
||||
value_2 = float(value_2)
|
||||
elif valuetype_2 == "STRING":
|
||||
value_2 = str(value_2)
|
||||
|
||||
# Convert value_3 based on valuetype_3
|
||||
if valuetype_3 == "INT":
|
||||
value_3 = int(value_3)
|
||||
elif valuetype_3 == "FLOAT":
|
||||
value_3 = float(value_3)
|
||||
elif valuetype_3 == "STRING":
|
||||
value_3 = str(value_3)
|
||||
|
||||
# Convert value_4 based on valuetype_4
|
||||
if valuetype_4 == "INT":
|
||||
value_4 = int(value_4)
|
||||
elif valuetype_4 == "FLOAT":
|
||||
value_4 = float(value_4)
|
||||
elif valuetype_4 == "STRING":
|
||||
value_4 = str(value_4)
|
||||
|
||||
# Convert value_5 based on valuetype_5
|
||||
if valuetype_5 == "INT":
|
||||
value_5 = int(value_5)
|
||||
elif valuetype_5 == "FLOAT":
|
||||
value_5 = float(value_5)
|
||||
elif valuetype_5 == "STRING":
|
||||
value_5 = str(value_5)
|
||||
|
||||
# Convert value_6 based on valuetype_6
|
||||
if valuetype_6 == "INT":
|
||||
value_6 = int(value_6)
|
||||
elif valuetype_6 == "FLOAT":
|
||||
value_6 = float(value_6)
|
||||
elif valuetype_6 == "STRING":
|
||||
value_6 = str(value_6)
|
||||
return value_1, value_2, value_3, value_4, value_5, value_6
|
||||
|
||||
|
||||
class OTX_KSampler_Feeder:
|
||||
|
||||
@@ -88,7 +305,7 @@ class OTX_KSampler_Feeder:
|
||||
"required": {
|
||||
"noise_seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff}),
|
||||
"steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
|
||||
"cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
|
||||
"cfg": ("FLOAT", {"default": 8.0, "min": 0.0, "max": 100.0}),
|
||||
"base_steps_portion": ("FLOAT", {"default": 0.8, "min": 0.0, "max": 1.0, "step": 0.1, "display": "number"}),
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user