ComfyUI > Nodes > WAS Node Suite > Number Input Condition

ComfyUI Node: Number Input Condition

Class Name

Number Input Condition

Category
WAS Suite/Logic
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 Input Condition Description

Node compares numerical values based on conditions for dynamic AI art logic flows, enhancing flexibility and responsiveness.

Number Input Condition:

The Number Input Condition node is designed to compare two numerical values based on a specified condition and return a result accordingly. This node is particularly useful for creating dynamic logic flows in your AI art projects, allowing you to make decisions based on numerical comparisons. Whether you need to check if one number is greater than another, if they are equal, or if one is divisible by the other, this node provides a versatile set of comparison operations to suit various needs. By leveraging this node, you can introduce conditional logic into your workflows, enhancing the flexibility and responsiveness of your AI-generated art.

Number Input Condition Input Parameters:

number_a

This parameter represents the first numerical value to be compared. It can be any number and serves as one of the two primary inputs for the comparison operation. The value of number_a directly impacts the outcome of the comparison based on the selected condition.

number_b

This parameter represents the second numerical value to be compared against number_a. Similar to number_a, it can be any number and is crucial for determining the result of the comparison operation. The value of number_b is used in conjunction with number_a to evaluate the specified condition.

return_boolean

This parameter determines whether the node should return a boolean result (true or false) based on the comparison. If set to "true", the node will return a boolean value indicating the result of the comparison. If set to "false", the node will return one of the input numbers based on the comparison. The default value is "false".

comparison

This parameter specifies the type of comparison to be performed between number_a and number_b. The available options include "greater-than", "greater-than or equals", "less-than", "less-than or equals", "equals", "does not equal", "divisible by", "if A odd", "if A even", "and", "or", "if A prime", and "factor of". Each option defines a different condition for comparing the two numbers, and the selected option determines the logic used to evaluate the comparison.

Number Input Condition Output Parameters:

NUMBER

When return_boolean is set to "false", this output returns one of the input numbers (number_a or number_b) based on the specified comparison condition. The exact value returned depends on the outcome of the comparison.

FLOAT

This output provides the result of the comparison as a floating-point number. It is useful for scenarios where a floating-point representation of the result is required.

INT

This output provides the result of the comparison as an integer. It is useful for scenarios where an integer representation of the result is required.

Number Input Condition Usage Tips:

  • Use the comparison parameter to define the specific condition you want to evaluate between number_a and number_b. This allows you to create complex logic flows based on numerical comparisons.
  • Set return_boolean to "true" if you need a simple true/false result from the comparison. This can be useful for conditional branching in your workflows.
  • Experiment with different comparison options to understand how they affect the outcome. For example, use "greater-than" to check if number_a is larger than number_b, or "divisible by" to see if number_b is divisible by number_a.

Number Input Condition Common Errors and Solutions:

Invalid number operation selected.

  • Explanation: This error occurs when an invalid comparison operation is specified in the comparison parameter.
  • Solution: Ensure that the comparison parameter is set to one of the valid options: "greater-than", "greater-than or equals", "less-than", "less-than or equals", "equals", "does not equal", "divisible by", "if A odd", "if A even", "and", "or", "if A prime", or "factor of".

Division by zero error.

  • Explanation: This error occurs when attempting to perform a "divisible by" comparison with number_a set to zero.
  • Solution: Ensure that number_a is not zero when using the "divisible by" comparison to avoid division by zero errors.

Number Input Condition 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.