Operation:
The Operation node is designed to perform basic arithmetic operations between two numerical inputs, which can be either integers or floating-point numbers. This node is particularly useful for AI artists who need to manipulate numerical data within their workflows, providing a straightforward way to execute addition, subtraction, multiplication, or division. By allowing the selection of the operation type and handling both integer and float inputs, the node offers flexibility and ease of use, making it an essential tool for tasks that require mathematical computations. Its primary goal is to simplify the process of performing arithmetic operations, ensuring that users can focus on their creative tasks without getting bogged down by complex calculations.
Operation Input Parameters:
A Type
This parameter specifies the type of the first input value, which can be either "Int" for integer or "Float" for floating-point numbers. The choice of type affects how the input value is interpreted and processed during the operation.
B Type
Similar to A Type, this parameter determines the type of the second input value, allowing you to choose between "Int" and "Float". This ensures that the second input is correctly handled according to its specified type.
A - Int
This parameter represents the integer value for the first input when A Type is set to "Int". It is used in the arithmetic operation if the first input is an integer.
A - Float
This parameter is the floating-point value for the first input when A Type is set to "Float". It is utilized in the operation if the first input is a float.
B - Int
This parameter denotes the integer value for the second input when B Type is set to "Int". It is involved in the operation if the second input is an integer.
B - Float
This parameter is the floating-point value for the second input when B Type is set to "Float". It is used in the operation if the second input is a float.
Operation
This parameter allows you to select the type of arithmetic operation to perform. The available options are "A+B" for addition, "A-B" for subtraction, "A*B" for multiplication, and "A/B" for division. The selected operation determines how the input values are combined to produce the result.
Operation Output Parameters:
Result
The output of the node is a single numerical value that represents the result of the specified arithmetic operation. This result can be either an integer or a floating-point number, depending on the types of the input values and the operation performed. The output is crucial for further processing or analysis within your workflow.
Operation Usage Tips:
- Ensure that the types of the input values (
A TypeandB Type) match the actual data you are providing to avoid unexpected results. - When performing division, be cautious of division by zero, which can lead to errors or undefined results. Consider adding checks or conditions to handle such cases.
Operation Common Errors and Solutions:
Invalid operation provided
- Explanation: This error occurs when the
Operationparameter is set to a value that is not recognized by the node. - Solution: Ensure that the
Operationparameter is set to one of the valid options: "A+B", "A-B", "A*B", or "A/B".
KeyError: 'A Type' or 'B Type'
- Explanation: This error indicates that the required input type parameters are missing from the input data.
- Solution: Verify that both
A TypeandB Typeparameters are correctly specified in the input data before executing the node.
