From a274cd5c13b3dcb7bb7cba93c631743941e1d21a Mon Sep 17 00:00:00 2001 From: Jacob Segal Date: Fri, 28 Jul 2023 22:41:43 -0700 Subject: [PATCH] Reorganize all demo components Rather than creating a bunch of top-level categories, I'm using sub-categories. --- .../components.py | 6 +++--- .../conditions.py | 10 +++++----- .../flow_control.py | 6 +++--- .../execution-inversion-demo-comfyui/nodes.py | 12 +++++------ .../utility_nodes.py | 20 +++++++++---------- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/custom_nodes/execution-inversion-demo-comfyui/components.py b/custom_nodes/execution-inversion-demo-comfyui/components.py index a78232e96..f6d5b904a 100644 --- a/custom_nodes/execution-inversion-demo-comfyui/components.py +++ b/custom_nodes/execution-inversion-demo-comfyui/components.py @@ -38,7 +38,7 @@ class ComponentInput: RETURN_TYPES = ("*",) FUNCTION = "component_input" - CATEGORY = "Component Creation" + CATEGORY = "InversionDemo Nodes/Component Creation" def component_input(self, name, data_type, extra_args, explicit_input_order, optional, default_value = None): return (default_value,) @@ -61,7 +61,7 @@ class ComponentOutput: RETURN_TYPES = ("*",) FUNCTION = "component_output" - CATEGORY = "Component Creation" + CATEGORY = "InversionDemo Nodes/Component Creation" def component_output(self, index, data_type, name, value): return (value,) @@ -82,7 +82,7 @@ class ComponentMetadata: RETURN_TYPES = () FUNCTION = "nop" - CATEGORY = "Component Creation" + CATEGORY = "InversionDemo Nodes/Component Creation" def nop(self, name): return {} diff --git a/custom_nodes/execution-inversion-demo-comfyui/conditions.py b/custom_nodes/execution-inversion-demo-comfyui/conditions.py index a7c71a362..a0281a5ab 100644 --- a/custom_nodes/execution-inversion-demo-comfyui/conditions.py +++ b/custom_nodes/execution-inversion-demo-comfyui/conditions.py @@ -18,7 +18,7 @@ class IntConditions: RETURN_TYPES = ("BOOL",) FUNCTION = "int_condition" - CATEGORY = "Conditions" + CATEGORY = "InversionDemo Nodes/Logic" def int_condition(self, a, b, operation): if operation == "==": @@ -52,7 +52,7 @@ class FloatConditions: RETURN_TYPES = ("BOOL",) FUNCTION = "float_condition" - CATEGORY = "Conditions" + CATEGORY = "InversionDemo Nodes/Logic" def float_condition(self, a, b, operation): if operation == "==": @@ -86,7 +86,7 @@ class StringConditions: RETURN_TYPES = ("BOOL",) FUNCTION = "string_condition" - CATEGORY = "Conditions" + CATEGORY = "InversionDemo Nodes/Logic" def string_condition(self, a, b, operation, case_sensitive): if not case_sensitive: @@ -127,7 +127,7 @@ class ToBoolNode: RETURN_TYPES = ("BOOL",) FUNCTION = "to_bool" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Logic" def to_bool(self, value, invert = False): if isinstance(value, torch.Tensor): @@ -164,7 +164,7 @@ class BoolOperationNode: RETURN_TYPES = ("BOOL",) FUNCTION = "bool_operation" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Logic" def bool_operation(self, a, b, op): if op == "a AND b": diff --git a/custom_nodes/execution-inversion-demo-comfyui/flow_control.py b/custom_nodes/execution-inversion-demo-comfyui/flow_control.py index 39daa2eb3..6dc23c810 100644 --- a/custom_nodes/execution-inversion-demo-comfyui/flow_control.py +++ b/custom_nodes/execution-inversion-demo-comfyui/flow_control.py @@ -22,7 +22,7 @@ class WhileLoopOpen: RETURN_NAMES = tuple(["FLOW_CONTROL"] + ["value%d" % i for i in range(NUM_FLOW_SOCKETS)]) FUNCTION = "while_loop_open" - CATEGORY = "Flow Control" + CATEGORY = "InversionDemo Nodes/Flow" def while_loop_open(self, condition, **kwargs): values = [] @@ -56,7 +56,7 @@ class WhileLoopClose: RETURN_NAMES = tuple(["value%d" % i for i in range(NUM_FLOW_SOCKETS)]) FUNCTION = "while_loop_close" - CATEGORY = "Flow Control" + CATEGORY = "InversionDemo Nodes/Flow" def explore_dependencies(self, node_id, dynprompt, upstream): node_info = dynprompt.get_node(node_id) @@ -143,7 +143,7 @@ class ExecutionBlockerNode: RETURN_NAMES = ("output",) FUNCTION = "execution_blocker" - CATEGORY = "Flow Control" + CATEGORY = "InversionDemo Nodes/Flow" def execution_blocker(self, input, block, verbose): if block: diff --git a/custom_nodes/execution-inversion-demo-comfyui/nodes.py b/custom_nodes/execution-inversion-demo-comfyui/nodes.py index 874d2c95d..5482228b0 100644 --- a/custom_nodes/execution-inversion-demo-comfyui/nodes.py +++ b/custom_nodes/execution-inversion-demo-comfyui/nodes.py @@ -19,7 +19,7 @@ class InversionDemoAdvancedPromptNode: RETURN_TYPES = ("MODEL", "CLIP", "CONDITIONING") FUNCTION = "advanced_prompt" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Demo" def parse_prompt(self, prompt): # Get all string pieces matching the pattern "" @@ -68,7 +68,7 @@ class InversionDemoFakeAdvancedPromptNode: RETURN_TYPES = ("MODEL", "CLIP", "CONDITIONING") FUNCTION = "advanced_prompt" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Debug" def advanced_prompt(self, prompt, clip, model): tokens = clip.tokenize(prompt) @@ -92,7 +92,7 @@ class InversionDemoLazySwitch: RETURN_TYPES = ("*",) FUNCTION = "switch" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Logic" def check_lazy_status(self, switch, on_false = None, on_true = None): if switch and on_true is None: @@ -130,7 +130,7 @@ class InversionDemoLazyConditional: RETURN_TYPES = ("*",) FUNCTION = "conditional" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Logic" def check_lazy_status(self, **kwargs): for i in range(0,NUM_IF_ELSE_NODES): @@ -186,7 +186,7 @@ class InversionDemoLazyIndexSwitch: RETURN_TYPES = ("*",) FUNCTION = "index_switch" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Logic" def check_lazy_status(self, index, **kwargs): key = "value%d" % index @@ -214,7 +214,7 @@ class InversionDemoLazyMixImages: RETURN_TYPES = ("IMAGE",) FUNCTION = "mix" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Demo" def check_lazy_status(self, mask, image1 = None, image2 = None): mask_min = mask.min() diff --git a/custom_nodes/execution-inversion-demo-comfyui/utility_nodes.py b/custom_nodes/execution-inversion-demo-comfyui/utility_nodes.py index 4ee2b2ae4..08724b866 100644 --- a/custom_nodes/execution-inversion-demo-comfyui/utility_nodes.py +++ b/custom_nodes/execution-inversion-demo-comfyui/utility_nodes.py @@ -19,7 +19,7 @@ class AccumulateNode: RETURN_TYPES = ("ACCUMULATION",) FUNCTION = "accumulate" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Lists" def accumulate(self, to_add, accumulation = None): if accumulation is None: @@ -43,7 +43,7 @@ class AccumulationHeadNode: RETURN_TYPES = ("ACCUMULATION", "*",) FUNCTION = "accumulation_head" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Lists" def accumulation_head(self, accumulation): accum = accumulation["accum"] @@ -67,7 +67,7 @@ class AccumulationTailNode: RETURN_TYPES = ("ACCUMULATION", "*",) FUNCTION = "accumulation_tail" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Lists" def accumulation_tail(self, accumulation): accum = accumulation["accum"] @@ -93,7 +93,7 @@ class AccumulationToListNode: FUNCTION = "accumulation_to_list" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Lists" def accumulation_to_list(self, accumulation): return (accumulation["accum"],) @@ -115,7 +115,7 @@ class ListToAccumulationNode: FUNCTION = "list_to_accumulation" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Lists" def accumulation_to_list(self, list): return ({"accum": list},) @@ -137,7 +137,7 @@ class IntMathOperation: RETURN_TYPES = ("INT",) FUNCTION = "int_math_operation" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Logic" def int_math_operation(self, a, b, operation): if operation == "add": @@ -177,7 +177,7 @@ class ForLoopOpen: RETURN_NAMES = tuple(["flow_control", "remaining"] + ["value%d" % i for i in range(1, NUM_FLOW_SOCKETS)]) FUNCTION = "for_loop_open" - CATEGORY = "Flow Control" + CATEGORY = "InversionDemo Nodes/Flow" def for_loop_open(self, remaining, **kwargs): graph = GraphBuilder() @@ -210,7 +210,7 @@ class ForLoopClose: RETURN_NAMES = tuple(["value%d" % i for i in range(1, NUM_FLOW_SOCKETS)]) FUNCTION = "for_loop_close" - CATEGORY = "Flow Control" + CATEGORY = "InversionDemo Nodes/Flow" def for_loop_close(self, flow_control, old_remaining, **kwargs): graph = GraphBuilder() @@ -245,7 +245,7 @@ class DebugPrint: RETURN_TYPES = ("*",) FUNCTION = "debug_print" - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Debug" def debugtype(self, value): if isinstance(value, list): @@ -297,7 +297,7 @@ class MakeListNode: FUNCTION = "make_list" OUTPUT_IS_LIST = (True,) - CATEGORY = "InversionDemo Nodes" + CATEGORY = "InversionDemo Nodes/Lists" def make_list(self, **kwargs): result = []