ComfyUI  >  Nodes  >  ComfyMath >  FloatUnaryCondition

ComfyUI Node: FloatUnaryCondition

Class Name

CM_FloatUnaryCondition

Category
math/float
Author
evanspearman (Account age: 4247 days)
Extension
ComfyMath
Latest Updated
8/27/2023
Github Stars
0.1K

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

FloatUnaryCondition Description

Evaluate floating-point number against condition, return boolean result for AI art workflows.

FloatUnaryCondition:

The CM_FloatUnaryCondition node is designed to evaluate a single floating-point number against a specified condition, returning a boolean result. This node is particularly useful for scenarios where you need to check properties of a float, such as whether it is zero, positive, negative, or meets other specific criteria. By leveraging this node, you can easily incorporate conditional logic into your AI art workflows, enabling more dynamic and responsive designs. The node simplifies the process of performing unary condition checks on floating-point numbers, making it accessible even to those without a deep technical background.

FloatUnaryCondition Input Parameters:

op

The op parameter specifies the unary condition to be applied to the input float. It accepts a list of predefined conditions such as IsZero, IsPositive, IsNegative, IsNonZero, IsPositiveInfinity, IsNegativeInfinity, IsNaN, IsFinite, IsInfinite, IsEven, and IsOdd. Each condition checks a specific property of the float and returns a boolean result. For example, IsZero checks if the float is zero, while IsPositive checks if it is greater than zero. This parameter is crucial as it determines the type of check performed on the input float.

a

The a parameter represents the floating-point number to be evaluated against the specified condition. This input is a single float value that will be checked according to the condition defined by the op parameter. The value of a can be any valid floating-point number, and its properties will be assessed based on the chosen condition. This parameter is essential as it provides the actual data for the condition check.

FloatUnaryCondition Output Parameters:

BOOL

The output parameter BOOL is a boolean value that indicates the result of the condition check. If the condition specified by the op parameter is met by the input float a, the output will be True; otherwise, it will be False. This boolean result can be used to drive further logic in your AI art workflows, enabling conditional branching and decision-making based on the properties of floating-point numbers.

FloatUnaryCondition Usage Tips:

  • Use the IsNaN condition to filter out invalid or undefined floating-point numbers in your data.
  • Combine multiple CM_FloatUnaryCondition nodes to create complex conditional logic, such as checking if a number is both positive and finite.

FloatUnaryCondition Common Errors and Solutions:

Invalid condition specified

  • Explanation: The op parameter was set to a condition that is not recognized.
  • Solution: Ensure that the op parameter is set to one of the predefined conditions such as IsZero, IsPositive, IsNegative, etc.

Input is not a float

  • Explanation: The a parameter was provided with a value that is not a floating-point number.
  • Solution: Verify that the input for the a parameter is a valid float. If necessary, convert the input to a float before passing it to the node.

FloatUnaryCondition Related Nodes

Go back to the extension to check out more related nodes.
ComfyMath
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.