Visit ComfyUI Online for ready-to-use ComfyUI environment
Versatile node for evaluating Python expressions with multiple parameters, supporting complex logic and data manipulation.
The MultiParamFormula node is a versatile tool designed to evaluate expressions using multiple parameters of any type, making it highly adaptable for various computational tasks. This node allows you to input a Python expression and execute it, providing the flexibility to handle complex logic and operations. It supports both simple and advanced modes, where the advanced mode enables the execution of multi-line code, requiring the result to be assigned to a variable named result
. This feature is particularly beneficial for users who need to perform intricate calculations or data manipulations within their workflows. The node's ability to handle any data type as input and output makes it a powerful component for creating dynamic and responsive AI art applications.
The expression
parameter is a string that contains the Python code to be executed. It can be a simple one-liner or a multi-line script if the advanced mode is enabled. This parameter is crucial as it defines the logic and operations to be performed by the node. There are no strict limitations on the content of the expression, but it must be valid Python syntax. The default value is an empty string, and it supports multiline input to accommodate complex scripts.
The advanced
parameter is a toggle that determines whether the node operates in simple or advanced mode. In simple mode, the node evaluates single-line expressions, while in advanced mode, it can execute multi-line scripts. The options are "enable" and "disable," with "disable" being the default. Enabling advanced mode allows for more complex operations but requires the result to be explicitly assigned to a variable named result
.
The isView
parameter is a boolean that controls whether the node's output includes a user interface component. When set to true, the output will include a UI element displaying the result of the expression. The default value is true, providing a visual representation of the output by default.
The p0
and p1
parameters are optional inputs that can accept any data type. They serve as placeholders for the variables used within the expression. These parameters allow you to pass dynamic data into the node, which can then be manipulated or evaluated according to the logic defined in the expression. There are no default values, and they are only used if specified in the expression.
The p0
output parameter represents the result of the evaluated expression. It can be of any data type, depending on the logic and operations defined in the input expression. This flexibility allows the node to be used in a wide range of applications, from simple calculations to complex data transformations. The output is directly influenced by the expression and the input parameters provided.
result
variable to avoid errors.isView
parameter to visualize the output, which can be particularly helpful for debugging and verifying the results of your expressions.result
variable in advanced mode.result
variable.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.