Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform various unary operations on numerical input for mathematical transformations and computations in AI art projects.
The CM_NumberUnaryOperation JK
node is designed to perform a variety of unary operations on a single numerical input. This node is particularly useful for mathematical transformations and computations that involve a single number, such as taking the square root, calculating the sine, or applying other mathematical functions. By leveraging this node, you can streamline your workflow and apply complex mathematical operations with ease, enhancing the flexibility and power of your AI art projects. The node's primary function is to take a numerical input and apply a specified unary operation, returning the result as a single number.
The op
parameter specifies the unary operation to be applied to the input number. It is a selection from a predefined list of operations, such as sqrt
for square root, sin
for sine, and other mathematical functions. This parameter determines the type of transformation that will be applied to the input number. The available options are defined by the FLOAT_UNARY_OPERATIONS
dictionary. There are no minimum or maximum values for this parameter, as it is a categorical selection. The default value is typically the first operation in the list.
The a
parameter is the numerical input to which the unary operation will be applied. This parameter accepts any number, and its value will be transformed according to the selected operation. The impact of this parameter is directly related to the chosen operation; for example, if sqrt
is selected, the node will return the square root of a
. The minimum and maximum values for this parameter depend on the specific operation being applied. The default value is defined by DEFAULT_NUMBER
.
The NUMBER
output parameter represents the result of the unary operation applied to the input number a
. This output is a single numerical value that reflects the transformation specified by the op
parameter. For instance, if the op
parameter is set to sqrt
and a
is 16, the NUMBER
output will be 4. This output is crucial for further computations or for directly influencing other nodes in your workflow.
a
is within a valid range for the selected operation to avoid errors. For example, the square root operation requires a non-negative input.op
parameter is set to a valid operation from the FLOAT_UNARY_OPERATIONS
dictionary.a
is not within the acceptable range for the selected operation, such as providing a negative number for a square root operation.a
is within the valid range for the chosen operation. For example, use non-negative numbers for the square root operation.a
is not a numerical value.a
is a valid number and not a string or other data type.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.