mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-13 23:12:35 +08:00
Reorganize all demo components
Rather than creating a bunch of top-level categories, I'm using sub-categories.
This commit is contained in:
parent
5d72965863
commit
a274cd5c13
@ -38,7 +38,7 @@ class ComponentInput:
|
|||||||
RETURN_TYPES = ("*",)
|
RETURN_TYPES = ("*",)
|
||||||
FUNCTION = "component_input"
|
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):
|
def component_input(self, name, data_type, extra_args, explicit_input_order, optional, default_value = None):
|
||||||
return (default_value,)
|
return (default_value,)
|
||||||
@ -61,7 +61,7 @@ class ComponentOutput:
|
|||||||
RETURN_TYPES = ("*",)
|
RETURN_TYPES = ("*",)
|
||||||
FUNCTION = "component_output"
|
FUNCTION = "component_output"
|
||||||
|
|
||||||
CATEGORY = "Component Creation"
|
CATEGORY = "InversionDemo Nodes/Component Creation"
|
||||||
|
|
||||||
def component_output(self, index, data_type, name, value):
|
def component_output(self, index, data_type, name, value):
|
||||||
return (value,)
|
return (value,)
|
||||||
@ -82,7 +82,7 @@ class ComponentMetadata:
|
|||||||
RETURN_TYPES = ()
|
RETURN_TYPES = ()
|
||||||
FUNCTION = "nop"
|
FUNCTION = "nop"
|
||||||
|
|
||||||
CATEGORY = "Component Creation"
|
CATEGORY = "InversionDemo Nodes/Component Creation"
|
||||||
|
|
||||||
def nop(self, name):
|
def nop(self, name):
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class IntConditions:
|
|||||||
RETURN_TYPES = ("BOOL",)
|
RETURN_TYPES = ("BOOL",)
|
||||||
FUNCTION = "int_condition"
|
FUNCTION = "int_condition"
|
||||||
|
|
||||||
CATEGORY = "Conditions"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def int_condition(self, a, b, operation):
|
def int_condition(self, a, b, operation):
|
||||||
if operation == "==":
|
if operation == "==":
|
||||||
@ -52,7 +52,7 @@ class FloatConditions:
|
|||||||
RETURN_TYPES = ("BOOL",)
|
RETURN_TYPES = ("BOOL",)
|
||||||
FUNCTION = "float_condition"
|
FUNCTION = "float_condition"
|
||||||
|
|
||||||
CATEGORY = "Conditions"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def float_condition(self, a, b, operation):
|
def float_condition(self, a, b, operation):
|
||||||
if operation == "==":
|
if operation == "==":
|
||||||
@ -86,7 +86,7 @@ class StringConditions:
|
|||||||
RETURN_TYPES = ("BOOL",)
|
RETURN_TYPES = ("BOOL",)
|
||||||
FUNCTION = "string_condition"
|
FUNCTION = "string_condition"
|
||||||
|
|
||||||
CATEGORY = "Conditions"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def string_condition(self, a, b, operation, case_sensitive):
|
def string_condition(self, a, b, operation, case_sensitive):
|
||||||
if not case_sensitive:
|
if not case_sensitive:
|
||||||
@ -127,7 +127,7 @@ class ToBoolNode:
|
|||||||
RETURN_TYPES = ("BOOL",)
|
RETURN_TYPES = ("BOOL",)
|
||||||
FUNCTION = "to_bool"
|
FUNCTION = "to_bool"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def to_bool(self, value, invert = False):
|
def to_bool(self, value, invert = False):
|
||||||
if isinstance(value, torch.Tensor):
|
if isinstance(value, torch.Tensor):
|
||||||
@ -164,7 +164,7 @@ class BoolOperationNode:
|
|||||||
RETURN_TYPES = ("BOOL",)
|
RETURN_TYPES = ("BOOL",)
|
||||||
FUNCTION = "bool_operation"
|
FUNCTION = "bool_operation"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def bool_operation(self, a, b, op):
|
def bool_operation(self, a, b, op):
|
||||||
if op == "a AND b":
|
if op == "a AND b":
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class WhileLoopOpen:
|
|||||||
RETURN_NAMES = tuple(["FLOW_CONTROL"] + ["value%d" % i for i in range(NUM_FLOW_SOCKETS)])
|
RETURN_NAMES = tuple(["FLOW_CONTROL"] + ["value%d" % i for i in range(NUM_FLOW_SOCKETS)])
|
||||||
FUNCTION = "while_loop_open"
|
FUNCTION = "while_loop_open"
|
||||||
|
|
||||||
CATEGORY = "Flow Control"
|
CATEGORY = "InversionDemo Nodes/Flow"
|
||||||
|
|
||||||
def while_loop_open(self, condition, **kwargs):
|
def while_loop_open(self, condition, **kwargs):
|
||||||
values = []
|
values = []
|
||||||
@ -56,7 +56,7 @@ class WhileLoopClose:
|
|||||||
RETURN_NAMES = tuple(["value%d" % i for i in range(NUM_FLOW_SOCKETS)])
|
RETURN_NAMES = tuple(["value%d" % i for i in range(NUM_FLOW_SOCKETS)])
|
||||||
FUNCTION = "while_loop_close"
|
FUNCTION = "while_loop_close"
|
||||||
|
|
||||||
CATEGORY = "Flow Control"
|
CATEGORY = "InversionDemo Nodes/Flow"
|
||||||
|
|
||||||
def explore_dependencies(self, node_id, dynprompt, upstream):
|
def explore_dependencies(self, node_id, dynprompt, upstream):
|
||||||
node_info = dynprompt.get_node(node_id)
|
node_info = dynprompt.get_node(node_id)
|
||||||
@ -143,7 +143,7 @@ class ExecutionBlockerNode:
|
|||||||
RETURN_NAMES = ("output",)
|
RETURN_NAMES = ("output",)
|
||||||
FUNCTION = "execution_blocker"
|
FUNCTION = "execution_blocker"
|
||||||
|
|
||||||
CATEGORY = "Flow Control"
|
CATEGORY = "InversionDemo Nodes/Flow"
|
||||||
|
|
||||||
def execution_blocker(self, input, block, verbose):
|
def execution_blocker(self, input, block, verbose):
|
||||||
if block:
|
if block:
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class InversionDemoAdvancedPromptNode:
|
|||||||
RETURN_TYPES = ("MODEL", "CLIP", "CONDITIONING")
|
RETURN_TYPES = ("MODEL", "CLIP", "CONDITIONING")
|
||||||
FUNCTION = "advanced_prompt"
|
FUNCTION = "advanced_prompt"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Demo"
|
||||||
|
|
||||||
def parse_prompt(self, prompt):
|
def parse_prompt(self, prompt):
|
||||||
# Get all string pieces matching the pattern "<lora:(name):(strength)(:(clip_strength))?>"
|
# Get all string pieces matching the pattern "<lora:(name):(strength)(:(clip_strength))?>"
|
||||||
@ -68,7 +68,7 @@ class InversionDemoFakeAdvancedPromptNode:
|
|||||||
RETURN_TYPES = ("MODEL", "CLIP", "CONDITIONING")
|
RETURN_TYPES = ("MODEL", "CLIP", "CONDITIONING")
|
||||||
FUNCTION = "advanced_prompt"
|
FUNCTION = "advanced_prompt"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Debug"
|
||||||
|
|
||||||
def advanced_prompt(self, prompt, clip, model):
|
def advanced_prompt(self, prompt, clip, model):
|
||||||
tokens = clip.tokenize(prompt)
|
tokens = clip.tokenize(prompt)
|
||||||
@ -92,7 +92,7 @@ class InversionDemoLazySwitch:
|
|||||||
RETURN_TYPES = ("*",)
|
RETURN_TYPES = ("*",)
|
||||||
FUNCTION = "switch"
|
FUNCTION = "switch"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def check_lazy_status(self, switch, on_false = None, on_true = None):
|
def check_lazy_status(self, switch, on_false = None, on_true = None):
|
||||||
if switch and on_true is None:
|
if switch and on_true is None:
|
||||||
@ -130,7 +130,7 @@ class InversionDemoLazyConditional:
|
|||||||
RETURN_TYPES = ("*",)
|
RETURN_TYPES = ("*",)
|
||||||
FUNCTION = "conditional"
|
FUNCTION = "conditional"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def check_lazy_status(self, **kwargs):
|
def check_lazy_status(self, **kwargs):
|
||||||
for i in range(0,NUM_IF_ELSE_NODES):
|
for i in range(0,NUM_IF_ELSE_NODES):
|
||||||
@ -186,7 +186,7 @@ class InversionDemoLazyIndexSwitch:
|
|||||||
RETURN_TYPES = ("*",)
|
RETURN_TYPES = ("*",)
|
||||||
FUNCTION = "index_switch"
|
FUNCTION = "index_switch"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def check_lazy_status(self, index, **kwargs):
|
def check_lazy_status(self, index, **kwargs):
|
||||||
key = "value%d" % index
|
key = "value%d" % index
|
||||||
@ -214,7 +214,7 @@ class InversionDemoLazyMixImages:
|
|||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
FUNCTION = "mix"
|
FUNCTION = "mix"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Demo"
|
||||||
|
|
||||||
def check_lazy_status(self, mask, image1 = None, image2 = None):
|
def check_lazy_status(self, mask, image1 = None, image2 = None):
|
||||||
mask_min = mask.min()
|
mask_min = mask.min()
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class AccumulateNode:
|
|||||||
RETURN_TYPES = ("ACCUMULATION",)
|
RETURN_TYPES = ("ACCUMULATION",)
|
||||||
FUNCTION = "accumulate"
|
FUNCTION = "accumulate"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Lists"
|
||||||
|
|
||||||
def accumulate(self, to_add, accumulation = None):
|
def accumulate(self, to_add, accumulation = None):
|
||||||
if accumulation is None:
|
if accumulation is None:
|
||||||
@ -43,7 +43,7 @@ class AccumulationHeadNode:
|
|||||||
RETURN_TYPES = ("ACCUMULATION", "*",)
|
RETURN_TYPES = ("ACCUMULATION", "*",)
|
||||||
FUNCTION = "accumulation_head"
|
FUNCTION = "accumulation_head"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Lists"
|
||||||
|
|
||||||
def accumulation_head(self, accumulation):
|
def accumulation_head(self, accumulation):
|
||||||
accum = accumulation["accum"]
|
accum = accumulation["accum"]
|
||||||
@ -67,7 +67,7 @@ class AccumulationTailNode:
|
|||||||
RETURN_TYPES = ("ACCUMULATION", "*",)
|
RETURN_TYPES = ("ACCUMULATION", "*",)
|
||||||
FUNCTION = "accumulation_tail"
|
FUNCTION = "accumulation_tail"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Lists"
|
||||||
|
|
||||||
def accumulation_tail(self, accumulation):
|
def accumulation_tail(self, accumulation):
|
||||||
accum = accumulation["accum"]
|
accum = accumulation["accum"]
|
||||||
@ -93,7 +93,7 @@ class AccumulationToListNode:
|
|||||||
|
|
||||||
FUNCTION = "accumulation_to_list"
|
FUNCTION = "accumulation_to_list"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Lists"
|
||||||
|
|
||||||
def accumulation_to_list(self, accumulation):
|
def accumulation_to_list(self, accumulation):
|
||||||
return (accumulation["accum"],)
|
return (accumulation["accum"],)
|
||||||
@ -115,7 +115,7 @@ class ListToAccumulationNode:
|
|||||||
|
|
||||||
FUNCTION = "list_to_accumulation"
|
FUNCTION = "list_to_accumulation"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Lists"
|
||||||
|
|
||||||
def accumulation_to_list(self, list):
|
def accumulation_to_list(self, list):
|
||||||
return ({"accum": list},)
|
return ({"accum": list},)
|
||||||
@ -137,7 +137,7 @@ class IntMathOperation:
|
|||||||
RETURN_TYPES = ("INT",)
|
RETURN_TYPES = ("INT",)
|
||||||
FUNCTION = "int_math_operation"
|
FUNCTION = "int_math_operation"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Logic"
|
||||||
|
|
||||||
def int_math_operation(self, a, b, operation):
|
def int_math_operation(self, a, b, operation):
|
||||||
if operation == "add":
|
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)])
|
RETURN_NAMES = tuple(["flow_control", "remaining"] + ["value%d" % i for i in range(1, NUM_FLOW_SOCKETS)])
|
||||||
FUNCTION = "for_loop_open"
|
FUNCTION = "for_loop_open"
|
||||||
|
|
||||||
CATEGORY = "Flow Control"
|
CATEGORY = "InversionDemo Nodes/Flow"
|
||||||
|
|
||||||
def for_loop_open(self, remaining, **kwargs):
|
def for_loop_open(self, remaining, **kwargs):
|
||||||
graph = GraphBuilder()
|
graph = GraphBuilder()
|
||||||
@ -210,7 +210,7 @@ class ForLoopClose:
|
|||||||
RETURN_NAMES = tuple(["value%d" % i for i in range(1, NUM_FLOW_SOCKETS)])
|
RETURN_NAMES = tuple(["value%d" % i for i in range(1, NUM_FLOW_SOCKETS)])
|
||||||
FUNCTION = "for_loop_close"
|
FUNCTION = "for_loop_close"
|
||||||
|
|
||||||
CATEGORY = "Flow Control"
|
CATEGORY = "InversionDemo Nodes/Flow"
|
||||||
|
|
||||||
def for_loop_close(self, flow_control, old_remaining, **kwargs):
|
def for_loop_close(self, flow_control, old_remaining, **kwargs):
|
||||||
graph = GraphBuilder()
|
graph = GraphBuilder()
|
||||||
@ -245,7 +245,7 @@ class DebugPrint:
|
|||||||
RETURN_TYPES = ("*",)
|
RETURN_TYPES = ("*",)
|
||||||
FUNCTION = "debug_print"
|
FUNCTION = "debug_print"
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Debug"
|
||||||
|
|
||||||
def debugtype(self, value):
|
def debugtype(self, value):
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
@ -297,7 +297,7 @@ class MakeListNode:
|
|||||||
FUNCTION = "make_list"
|
FUNCTION = "make_list"
|
||||||
OUTPUT_IS_LIST = (True,)
|
OUTPUT_IS_LIST = (True,)
|
||||||
|
|
||||||
CATEGORY = "InversionDemo Nodes"
|
CATEGORY = "InversionDemo Nodes/Lists"
|
||||||
|
|
||||||
def make_list(self, **kwargs):
|
def make_list(self, **kwargs):
|
||||||
result = []
|
result = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user