ComfyUI  >  Nodes  >  ComfyMath >  NumberUnaryCondition

ComfyUI Node: NumberUnaryCondition

Class Name


evanspearman (Account age: 4247 days)
Latest Updated
Github Stars

How to Install ComfyMath

Install this extension via the ComfyUI Manager by searching for  ComfyMath
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyMath 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

NumberUnaryCondition Description

Evaluate numerical input against condition, return boolean result for dynamic AI art projects.


The CM_NumberUnaryCondition node is designed to evaluate a single numerical input against a specified condition, returning a boolean result. This node is particularly useful for scenarios where you need to check if a number meets certain criteria, such as being positive, negative, or within a specific range. By leveraging this node, you can easily incorporate conditional logic into your AI art projects, enabling more dynamic and responsive behaviors based on numerical data.

NumberUnaryCondition Input Parameters:


The op parameter specifies the unary condition to be applied to the input number. It is a string that must match one of the available unary conditions defined in the system. This parameter determines the type of check that will be performed on the input number. For example, it could check if the number is positive, negative, or zero. The available options for this parameter are predefined and can be selected from a list. There are no minimum or maximum values for this parameter, as it is a categorical selection. The default value is typically the first condition in the list.


The a parameter represents the numerical input that will be evaluated against the specified unary condition. This parameter accepts both integer and float values. The value of a is the subject of the condition check defined by the op parameter. For instance, if the condition is to check if the number is positive, a will be the number being checked. The default value for this parameter is 0.0, but it can be set to any numerical value as needed for your specific use case.

NumberUnaryCondition Output Parameters:


The output parameter BOOL is a boolean value that indicates the result of the unary condition check. If the input number a satisfies the condition specified by op, the output will be True; otherwise, it will be False. This output is crucial for decision-making processes in your AI art projects, allowing you to branch logic based on numerical evaluations.

NumberUnaryCondition Usage Tips:

  • Use the CM_NumberUnaryCondition node to create conditional branches in your AI art workflow, enabling different actions based on whether a number meets certain criteria.
  • Combine this node with other mathematical operations to create complex conditional logic, such as checking if a number is within a specific range by using multiple unary conditions.

NumberUnaryCondition Common Errors and Solutions:

Invalid operation specified

  • Explanation: The op parameter contains a value that is not recognized as a valid unary condition.
  • Solution: Ensure that the op parameter is set to one of the predefined unary conditions available in the system. Check the list of valid conditions and select an appropriate one.

Input value is not a number

  • Explanation: The a parameter contains a value that is not a valid number (integer or float).
  • Solution: Verify that the a parameter is set to a valid numerical value. Ensure that it is either an integer or a float and not a string or other data type.

NumberUnaryCondition Related Nodes

Go back to the extension to check out more related nodes.

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