Merge pull request #16 from StableLlama/fix_control_flow

Fix control flow node bugs
This commit is contained in:
StableLlama
2025-06-09 18:22:01 +02:00
committed by GitHub
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "basic_data_handling"
version = "0.4.1"
version = "0.4.2"
description = """Basic Python functions for manipulating data that every programmer is used to.
Comprehensive node collection for data manipulation in ComfyUI workflows.
@@ -188,7 +188,7 @@ class SwitchCase(ComfyNodeABC):
return needed
def execute(self, selector: int, **kwargs) -> tuple[Any]:
def execute(self, select: int, **kwargs) -> tuple[Any]:
# Build a case array from all case_X inputs
cases = []
for i in range(len(kwargs)):
@@ -199,8 +199,8 @@ class SwitchCase(ComfyNodeABC):
break
# Return the selected case if valid
if 0 <= selector < len(cases) and cases[selector] is not None:
return (cases[selector],)
if 0 <= select < len(cases) and cases[select] is not None:
return (cases[select],)
# If select is out of range or the selected case is None, return default
return (kwargs.get("default"),)
@@ -229,10 +229,6 @@ class DisableFlow(ComfyNodeABC):
DESCRIPTION = cleandoc(__doc__ or "")
FUNCTION = "execute"
@classmethod
def IS_CHANGED(s, value: Any):
return float("NaN") # not equal to anything -> trigger recalculation
def execute(self, value: Any, select: bool = True) -> tuple[Any]:
if select:
return (value,)
@@ -296,6 +292,10 @@ class ForceCalculation(ComfyNodeABC):
DESCRIPTION = cleandoc(__doc__ or "")
FUNCTION = "execute"
@classmethod
def IS_CHANGED(s, value: Any):
return float("NaN") # not equal to anything -> trigger recalculation
def execute(self, value: Any) -> tuple[Any, int]:
return (value,)