ComfyUI Node

XMath

Mathematical operation node supporting addition, subtraction, multiplication, division, power, and modulo operations with dual output format.

By Xz3r0-M·Created 7 months ago·Updated 22 days ago· 11
XMath
  • input_a
  • input_b
  • int_result
  • float_result
basic_a0.0
basic_b0.0
operationAddition (+)
use_input_atrue
use_input_btrue
swap_abfalse
Category♾️ Xz3r0/Workflow-Processing

Inputs (8)

NameTypeDefaultDescription
basic_aFLOAT0.0-10000000000–10000000000basic value A (FLOAT)
basic_bFLOAT0.0-10000000000–10000000000basic value B (FLOAT)
operationCOMBOAddition (+)Mathematical operation type
use_input_aBOOLEANtrueuse input value A (input_a takes precedence when enabled, fallbacks to basic_a if not connected to other node)
use_input_bBOOLEANtrueuse input value B (input_b takes precedence when enabled, fallbacks to basic_b if not connected to other node)
swap_abBOOLEANfalseswap a and b values
input_aoptCOMFY_MATCHTYPE_V3Optional numeric input A (allows INT or FLOAT independently from input B, takes priority when use_input_a is enabled)
input_boptCOMFY_MATCHTYPE_V3Optional numeric input B (allows INT or FLOAT independently from input A, takes priority when use_input_b is enabled)

Outputs (2)

NameTypeDescription
int_resultINTInteger result (truncated decimal part towards zero)
float_resultFLOATFloat result (exact value with decimal)