Better internal names for BOOLEAN functions (breaking change)

Rename CATEGORY "Flow Control" to "flow control" and "data list" to "Data List" and "path" to "Path"
Add creation nodes for Data List, LIST and SET
Add creation nodes for FLOAT and INT, the later also with different bases
Optimize math input widgets to prevent rounding
This commit is contained in:
StableLlama
2025-05-17 23:30:32 +02:00
parent d506487d55
commit b8d2062e75
11 changed files with 642 additions and 182 deletions
+28 -1
View File
@@ -1,6 +1,31 @@
from inspect import cleandoc
from comfy.comfy_types.node_typing import IO, ComfyNodeABC
class FloatCreate(ComfyNodeABC):
"""
Create a FLOAT from a STRING widget.
The input string must be a valid floating-point number and will be
directly converted to a FLOAT without any further processing.
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"value": (IO.ANY, {"default": "0.0", "widgetType": "STRING"}),
}
}
RETURN_TYPES = (IO.FLOAT,)
CATEGORY = "Basic/FLOAT"
DESCRIPTION = cleandoc(__doc__ or "")
FUNCTION = "create"
def create(self, value: str) -> tuple[float]:
return (float(value),)
class FloatAdd(ComfyNodeABC):
"""
Adds two floating-point numbers.
@@ -276,6 +301,7 @@ class FloatRound(ComfyNodeABC):
NODE_CLASS_MAPPINGS = {
"Basic data handling: FloatCreate": FloatCreate,
"Basic data handling: FloatAdd": FloatAdd,
"Basic data handling: FloatSubtract": FloatSubtract,
"Basic data handling: FloatMultiply": FloatMultiply,
@@ -290,11 +316,12 @@ NODE_CLASS_MAPPINGS = {
}
NODE_DISPLAY_NAME_MAPPINGS = {
"Basic data handling: FloatCreate": "create FLOAT",
"Basic data handling: FloatAdd": "add",
"Basic data handling: FloatSubtract": "subtract",
"Basic data handling: FloatMultiply": "multiply",
"Basic data handling: FloatDivide": "divide",
"Basic data handling: FloatDivideSafe": "divide (division by zero safe)",
"Basic data handling: FloatDivideSafe": "divide (zero safe)",
"Basic data handling: FloatAsIntegerRatio": "integer ratio",
"Basic data handling: FloatFromHex": "from hex",
"Basic data handling: FloatHex": "to hex",