mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-11 05:52:33 +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 = ("*",)
|
||||
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 {}
|
||||
|
||||
@ -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":
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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 "<lora:(name):(strength)(:(clip_strength))?>"
|
||||
@ -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()
|
||||
|
||||
@ -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 = []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user