The previous implementation converted all inputs through float before
producing the INT output (text -> float -> int). This loses precision
for integers beyond 2^53, since IEEE 754 doubles cannot represent them
exactly (e.g. "9007199254740993" became 9007199254740992).
Fix by:
- Attempting direct int(text) for string inputs, falling back to
int(float_val) only for decimal/scientific strings
- Preserving the original value for native int inputs instead of
round-tripping through float
- Moving the non-finite check before int conversion to properly
reject inf/nan strings with a clear error message
* Add Number Convert node for unified numeric type conversion
Consolidates fragmented IntToFloat/FloatToInt nodes (previously only
available via third-party packs like ComfyMath, FillNodes, etc.) into
a single core node.
- Single input accepting INT, FLOAT, STRING, and BOOL types
- Two outputs: FLOAT and INT
- Conversion: bool→0/1, string→parsed number, float↔int standard cast
- Follows Math Expression node patterns (comfy_api, io.Schema, etc.)
Refs: COM-16925
* Register nodes_number_convert.py in extras_files list
Without this entry in nodes.py, the Number Convert node file
would not be discovered and loaded at startup.
* Add isfinite guard, exception chaining, and unit tests for Number Convert node
- Add math.isfinite() check to prevent int() crash on inf/nan string inputs
- Use 'from None' for cleaner exception chaining on string parse failure
- Add 21 unit tests covering all input types and error paths