Visit ComfyUI Online for ready-to-use ComfyUI environment
Versatile node for mathematical operations using Python AST, supporting basic arithmetic and advanced functions for precise calculations.
SimpleMath+ is a versatile node designed to perform a variety of mathematical operations on input values. It leverages Python's Abstract Syntax Trees (AST) to parse and evaluate mathematical expressions, allowing you to perform complex calculations with ease. This node supports basic arithmetic operations such as addition, subtraction, multiplication, and division, as well as more advanced functions like exponentiation, modulo, and bitwise operations. Additionally, it can handle custom functions like min, max, round, sum, and len, providing a comprehensive toolkit for mathematical computations. SimpleMath+ is particularly useful for AI artists who need to manipulate numerical data within their workflows, offering a straightforward and efficient way to achieve precise mathematical results.
This parameter represents the first variable in the mathematical expression. It can be any numerical value that you want to include in your calculations. The value of a
will be substituted wherever the variable a
appears in the expression.
This parameter represents the second variable in the mathematical expression. Similar to a
, it can be any numerical value and will be used wherever the variable b
appears in the expression.
This parameter is the mathematical expression to be evaluated. It should be a string containing a valid mathematical expression that can include numbers, variables (a
and b
), operators, and supported functions. For example, "a + b * 2"
or "max(a, b)"
.
This output parameter provides the result of the evaluated mathematical expression, rounded to the nearest integer. It is useful when you need a whole number result for further processing or display purposes.
This output parameter provides the exact result of the evaluated mathematical expression without any rounding. It is useful when you need the precise value for further calculations or analysis.
value
parameter is a valid string and includes only supported operators and functions.a
and b
parameters to dynamically change the values in your expression without modifying the expression string itself.rounded_result
output when you need an integer value and the exact_result
output when precision is crucial.value
parameter contains invalid syntax or unsupported characters.a
is used in the expression but not provided as an input parameter.a
parameter if it is used in the expression.b
is used in the expression but not provided as an input parameter.b
parameter if it is used in the expression.© Copyright 2024 RunComfy. All Rights Reserved.