Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub
The ComfyMathExpression node evaluates a mathematical formula using a set of input values. You can write an expression using variable names (like a, b, c), and the node will calculate the result. It supports dynamically adding as many input values as needed for your calculation.

Inputs

ParameterData TypeRequiredRangeDescription
expressionSTRINGYesN/AThe mathematical formula to evaluate. You can use variable names that correspond to the input values (default: “a + b”).
valuesFLOAT, INT, BOOLEANNoN/AA set of numeric or boolean inputs that can be dynamically added. Each input is assigned a letter from the alphabet (a, b, c, …) to be used as a variable in the expression. At least one input value is required.
Parameter Constraints:
  • The expression parameter cannot be empty or contain only whitespace.
  • The expression must evaluate to a finite numeric result (INT or FLOAT). Boolean or other non-numeric results will cause an error.
  • The input values for the values parameter can be numbers (INT or FLOAT) or boolean values (TRUE/FALSE).
  • At least one input value must be provided in the values group.

Outputs

Output NameData TypeDescription
FLOATFLOATThe result of the mathematical expression as a floating-point number.
INTINTThe result of the mathematical expression as an integer.
BOOLBOOLEANThe result of the mathematical expression as a boolean value.

Source fingerprint (SHA-256): bf6221a7e1e955bdb56482de0a86a782494b2775fdd2edfde9fd20a9df0fe1a7