mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-04 03:17:11 +08:00
Removed switch node, removed NOT mode from logic gate
This commit is contained in:
parent
b46cf23259
commit
011d94f9b5
@ -12,17 +12,15 @@ class BooleanLogicGate:
|
|||||||
"required": {
|
"required": {
|
||||||
"value1": ("BOOLEAN", {"default": True}),
|
"value1": ("BOOLEAN", {"default": True}),
|
||||||
"value2": ("BOOLEAN", {"default": True}),
|
"value2": ("BOOLEAN", {"default": True}),
|
||||||
"mode": (["NOT", "AND", "OR", "NAND", "NOR", "XOR", "XNOR"],)
|
"mode": (["AND", "OR", "NAND", "NOR", "XOR", "XNOR"],)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("BOOLEAN",)
|
RETURN_TYPES = ("BOOLEAN",)
|
||||||
RETURN_NAMES = ("output",)
|
|
||||||
CATEGORY = "utils/logic"
|
CATEGORY = "utils/logic"
|
||||||
FUNCTION = "apply_operation"
|
FUNCTION = "apply_operation"
|
||||||
|
|
||||||
_OPS = {
|
_OPS = {
|
||||||
"NOT": lambda a, b: not a,
|
|
||||||
"AND": lambda a, b: a and b,
|
"AND": lambda a, b: a and b,
|
||||||
"OR": lambda a, b: a or b,
|
"OR": lambda a, b: a or b,
|
||||||
"NAND": lambda a, b: not (a and b),
|
"NAND": lambda a, b: not (a and b),
|
||||||
@ -46,7 +44,6 @@ class CompareValues:
|
|||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("BOOLEAN",)
|
RETURN_TYPES = ("BOOLEAN",)
|
||||||
RETURN_NAMES = ("output",)
|
|
||||||
CATEGORY = "utils/logic"
|
CATEGORY = "utils/logic"
|
||||||
FUNCTION = "compare"
|
FUNCTION = "compare"
|
||||||
|
|
||||||
@ -69,21 +66,6 @@ class CompareValues:
|
|||||||
|
|
||||||
return (self._OPS[mode](valueA, valueB),)
|
return (self._OPS[mode](valueA, valueB),)
|
||||||
|
|
||||||
class BooleanSwitch:
|
|
||||||
@classmethod
|
|
||||||
def INPUT_TYPES(cls):
|
|
||||||
return {
|
|
||||||
"required": {"switch": ("BOOLEAN", {"default": True})},
|
|
||||||
"optional": {"on_true": (any,), "on_false": (any,)}
|
|
||||||
}
|
|
||||||
|
|
||||||
RETURN_TYPES = (any,)
|
|
||||||
CATEGORY = "utils/logic"
|
|
||||||
FUNCTION = "switch"
|
|
||||||
|
|
||||||
def switch(self, switch: bool, on_true=None, on_false=None) -> tuple:
|
|
||||||
return ((on_true if switch else on_false),)
|
|
||||||
|
|
||||||
class OutputExists:
|
class OutputExists:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(cls):
|
def INPUT_TYPES(cls):
|
||||||
@ -99,13 +81,11 @@ class OutputExists:
|
|||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"BooleanLogicGate": BooleanLogicGate,
|
"BooleanLogicGate": BooleanLogicGate,
|
||||||
"CompareValues": CompareValues,
|
"CompareValues": CompareValues,
|
||||||
"BooleanSwitch": BooleanSwitch,
|
|
||||||
"OutputExists": OutputExists,
|
"OutputExists": OutputExists,
|
||||||
}
|
}
|
||||||
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
"BooleanLogicGate": "Boolean Logic Gate",
|
"BooleanLogicGate": "Boolean Logic Gate",
|
||||||
"CompareValues": "Compare Values",
|
"CompareValues": "Compare Values",
|
||||||
"BooleanSwitch": "Boolean Switch",
|
|
||||||
"OutputExists": "Output Exists",
|
"OutputExists": "Output Exists",
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user