diff --git a/pyproject.toml b/pyproject.toml index aae12b3..19eadf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "basic_data_handling" -version = "0.3.0" +version = "0.3.1" description = """NOTE: Still in development! Expect breaking changes! Basic Python functions for manipulating data that every programmer is used to. Currently supported ComfyUI data types: BOOLEAN, FLOAT, INT, STRING and data lists. diff --git a/src/basic_data_handling/control_flow_nodes.py b/src/basic_data_handling/control_flow_nodes.py index 7d96b91..dc1f2bb 100644 --- a/src/basic_data_handling/control_flow_nodes.py +++ b/src/basic_data_handling/control_flow_nodes.py @@ -191,15 +191,43 @@ class SwitchCase(ComfyNodeABC): # If selector is out of range or the selected case is None, return default return (kwargs.get("default"),) +class ExecutionOrder(ComfyNodeABC): + """ + Force execution order in the workflow. + + This node is lightweight and does not affect the workflow. It is used to force + the execution order of nodes in the workflow. You only need to chain this node + with the other execution order nodes in the desired order and add any + output of the nodes you want to force execution order on. + """ + @classmethod + def INPUT_TYPES(cls): + return { + "optional": { + "E/O": ("E/O", {}), + "any node output": (IO.ANY, {}), + } + } + + RETURN_TYPES = ("E/O",) + CATEGORY = "Basic/flow control" + DESCRIPTION = cleandoc(__doc__ or "") + FUNCTION = "execute" + + def execute(self, **kwargs) -> tuple[Any]: + return (None,) + NODE_CLASS_MAPPINGS = { "Basic data handling: IfElse": IfElse, "Basic data handling: IfElifElse": IfElifElse, "Basic data handling: SwitchCase": SwitchCase, + "Basic data handling: ExecutionOrder": ExecutionOrder, } NODE_DISPLAY_NAME_MAPPINGS = { "Basic data handling: IfElse": "if/else", "Basic data handling: IfElifElse": "if/elif/.../else", "Basic data handling: SwitchCase": "switch/case", + "Basic data handling: ExecutionOrder": "force execution order", }