Visit ComfyUI Online for ready-to-use ComfyUI environment
Evaluate floating-point number against condition, return boolean result for AI art workflows.
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.
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.
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.
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.
IsNaN
condition to filter out invalid or undefined floating-point numbers in your data.CM_FloatUnaryCondition
nodes to create complex conditional logic, such as checking if a number is both positive and finite.op
parameter was set to a condition that is not recognized.op
parameter is set to one of the predefined conditions such as IsZero
, IsPositive
, IsNegative
, etc.a
parameter was provided with a value that is not a floating-point number.a
parameter is a valid float. If necessary, convert the input to a float before passing it to the node.© Copyright 2024 RunComfy. All Rights Reserved.