Visit ComfyUI Online for ready-to-use ComfyUI environment
Evaluate mathematical expressions dynamically within ComfyUI, supporting a wide range of operations for AI artists.
The MathExpression| Math Expression 🐍
node is designed to evaluate mathematical expressions dynamically within the ComfyUI framework. This node allows you to input complex mathematical formulas and compute their results, making it a powerful tool for AI artists who need to perform calculations on-the-fly. The node supports a wide range of mathematical operations, including basic arithmetic, comparisons, and logical operations. It can handle variables and constants, providing flexibility in defining expressions. The primary goal of this node is to simplify the process of integrating mathematical logic into your AI art workflows, enabling more sophisticated and precise control over your creative outputs.
The expression
parameter is a string that contains the mathematical formula you want to evaluate. This formula can include variables, constants, and a variety of operators such as addition, subtraction, multiplication, division, and more. The expression is parsed and evaluated in real-time, allowing for dynamic calculations based on the provided inputs. There are no strict minimum or maximum values for this parameter, but the expression must be syntactically correct and valid within the context of the supported operations.
The prompt
parameter is a string that provides additional context or information that might be used within the expression. This can be useful for incorporating dynamic data or references into your calculations. The prompt helps in customizing the evaluation process based on specific needs or scenarios.
The extra_pnginfo
parameter is a dictionary that can hold extra metadata or information that might be relevant to the evaluation of the expression. This can include various attributes or properties that the expression might reference. It allows for more complex and context-aware calculations.
The a
, b
, and c
parameters are optional variables that can be used within the expression. These variables can hold numerical values that the expression will use during its evaluation. They provide a way to pass dynamic data into the expression, making it more flexible and adaptable to different situations.
The ui
output parameter is a dictionary that contains the result of the evaluated expression. Specifically, it includes a key value
which holds a list with the computed result. This output is useful for displaying the result within the user interface or for further processing within the workflow.
The result
output parameter is a tuple that contains the evaluated result in both integer and float formats. This dual-format output ensures compatibility with various downstream processes that might require the result in a specific numerical type. It provides a straightforward way to access the computed value for further use.
a
, b
, and c
parameters to pass dynamic values into your expression, allowing for more flexible and adaptable calculations.extra_pnginfo
parameter to include additional context or metadata that might be relevant to your expression, enabling more complex and context-aware evaluations.<variable_name>
<function_name>
<operator_name>
not supported<variable_name>
.width.width
or .height
.<function_name>
requires <number>
arguments© Copyright 2024 RunComfy. All Rights Reserved.