Compare commits

...

4 Commits

Author SHA1 Message Date
Silver
9a03926549
Merge 4916544c8d into 3c1a1a2df8 2026-02-03 06:44:05 +01:00
Silver
4916544c8d
Merge branch 'master' into patch-5 2026-01-01 00:45:32 +01:00
Silver
8a40614e7c
Merge branch 'comfyanonymous:master' into patch-5 2025-10-05 21:19:57 +02:00
Silver
ea1c370368
Make Float min and max use correct typing
Due to how floating point works with rounding, setting min to `-sys.maxsize` and max to `sys.maxsize` will result in following error:
```
* PrimitiveFloat 969:
  - Value -9.223372036854776e+18 smaller than min of -9223372036854775807: value
```

The error arises because the floating-point approximation (-9.223372036854776e+18) is slightly smaller (i.e., more negative) than the precise integer value of -sys.maxsize (-9223372036854775807). 

Alternative approach would be to use sys.float_info.min and sys.float_info.max instead but that range might seem a bit excessive for a primitive node.
2025-09-08 11:09:00 +02:00

View File

@ -66,7 +66,7 @@ class Float(io.ComfyNode):
display_name="Float",
category="utils/primitive",
inputs=[
io.Float.Input("value", min=-sys.maxsize, max=sys.maxsize, step=0.1),
io.Float.Input("value", min=float(-sys.maxsize), max=float(sys.maxsize), step=0.1),
],
outputs=[io.Float.Output()],
)