Update nodes_primitive.py (#7716)

Allow FLOAT and INT types to support negative numbers. 
Caps the numbers at the user's own system min and max.
This commit is contained in:
Alexander G. Morano 2025-04-21 18:51:31 -04:00 committed by GitHub
parent 5d51794607
commit 9d57b8afd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
# Primitive nodes that are evaluated at backend. # Primitive nodes that are evaluated at backend.
from __future__ import annotations from __future__ import annotations
import sys
from comfy.comfy_types.node_typing import ComfyNodeABC, InputTypeDict, IO from comfy.comfy_types.node_typing import ComfyNodeABC, InputTypeDict, IO
@ -23,7 +25,7 @@ class Int(ComfyNodeABC):
@classmethod @classmethod
def INPUT_TYPES(cls) -> InputTypeDict: def INPUT_TYPES(cls) -> InputTypeDict:
return { return {
"required": {"value": (IO.INT, {"control_after_generate": True})}, "required": {"value": (IO.INT, {"min": -sys.maxsize, "max": sys.maxsize, "control_after_generate": True})},
} }
RETURN_TYPES = (IO.INT,) RETURN_TYPES = (IO.INT,)
@ -38,7 +40,7 @@ class Float(ComfyNodeABC):
@classmethod @classmethod
def INPUT_TYPES(cls) -> InputTypeDict: def INPUT_TYPES(cls) -> InputTypeDict:
return { return {
"required": {"value": (IO.FLOAT, {})}, "required": {"value": (IO.FLOAT, {"min": -sys.maxsize, "max": sys.maxsize})},
} }
RETURN_TYPES = (IO.FLOAT,) RETURN_TYPES = (IO.FLOAT,)