ComfyUI > Nodes > WAS Node Suite > Number Operation

ComfyUI Node: Number Operation

Class Name

Number Operation

Category
WAS Suite/Number/Operations
Author
WASasquatch (Account age: 4688days)
Extension
WAS Node Suite
Latest Updated
2024-08-25
Github Stars
1.07K

How to Install WAS Node Suite

Install this extension via the ComfyUI Manager by searching for WAS Node Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WAS Node Suite in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Number Operation Description

Perform mathematical and logical operations on two input numbers, including arithmetic, exponentiation, modulus, and logical comparisons.

Number Operation:

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.

Number Operation Input Parameters:

number_a

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.

number_b

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.

operation

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.

Number Operation Output Parameters:

result

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).

float_result

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.

int_result

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.

Number Operation Usage Tips:

  • Use the 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.
  • Ensure that number_b is not zero when performing division or modulus operations to avoid errors.
  • Utilize the 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.

Number Operation Common Errors and Solutions:

Invalid number operation selected.

  • Explanation: This error occurs when an unsupported or incorrect operation is specified in the operation parameter.
  • Solution: Ensure that the operation parameter is set to one of the supported operations listed in the documentation.

Division by zero error

  • Explanation: This error occurs when number_b is zero during a division or modulus operation.
  • Solution: Check the value of number_b before performing the operation and ensure it is not zero.

Number Operation Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.