Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform mathematical and logical operations on two input numbers, including arithmetic, exponentiation, modulus, and logical comparisons.
The Number Operation node is designed to perform a variety of mathematical and logical operations on two input numbers. This node is highly versatile, allowing you to execute basic arithmetic operations such as addition, subtraction, multiplication, and division, as well as more complex operations like exponentiation and modulus. Additionally, it supports logical comparisons including greater-than, less-than, and equality checks. This node is particularly useful for AI artists who need to manipulate numerical values dynamically within their workflows, providing a straightforward way to handle numerical data and perform essential calculations without requiring deep technical knowledge.
This parameter represents the first number to be used in the operation. It can be any numerical value, and its role is to serve as one of the operands in the chosen mathematical or logical operation. The value of number_a
directly impacts the result of the operation.
This parameter represents the second number to be used in the operation. Similar to number_a
, it can be any numerical value and acts as the second operand in the operation. The value of number_b
is crucial for operations that involve two numbers, such as addition, subtraction, and comparisons.
This parameter specifies the type of operation to be performed on number_a
and number_b
. The available options include:
addition
: Adds number_a
and number_b
.subtraction
: Subtracts number_b
from number_a
.multiplication
: Multiplies number_a
by number_b
.division
: Divides number_a
by number_b
.floor division
: Performs integer division of number_a
by number_b
.exponentiation
: Raises number_a
to the power of number_b
.modulus
: Computes the remainder of number_a
divided by number_b
.greater-than
: Checks if number_a
is greater than number_b
.greater-than or equals
: Checks if number_a
is greater than or equal to number_b
.less-than
: Checks if number_a
is less than number_b
.less-than or equals
: Checks if number_a
is less than or equal to number_b
.equals
: Checks if number_a
is equal to number_b
.does not equal
: Checks if number_a
is not equal to number_b
.This parameter represents the outcome of the specified operation between number_a
and number_b
. The type and value of result
depend on the chosen operation. For arithmetic operations, it will be a numerical value, while for logical comparisons, it will be a boolean value (1 for true, 0 for false).
This parameter provides the result of the operation as a floating-point number. This is particularly useful for operations where the result might be a non-integer value, ensuring precision in the output.
This parameter gives the result of the operation as an integer. This is useful for operations where an integer result is required or preferred, such as in logical comparisons or when working with whole numbers.
operation
parameter to select the appropriate mathematical or logical operation based on your needs. For example, choose addition
for summing two numbers or greater-than
for comparing them.number_b
is not zero when performing division or modulus operations to avoid errors.float_result
and int_result
outputs to get the result in the desired numerical format, depending on whether you need a floating-point or integer value.operation
parameter.operation
parameter is set to one of the supported operations listed in the documentation.number_b
is zero during a division or modulus operation.number_b
before performing the operation and ensure it is not zero.© Copyright 2024 RunComfy. All Rights Reserved.