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:
parent
5d51794607
commit
9d57b8afd8
@ -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,)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user