Visit ComfyUI Online for ready-to-use ComfyUI environment
Generate fixed numerical value based on type and input, supports integers, floats, booleans for workflow consistency and compatibility.
The Constant Number node is designed to generate a fixed numerical value based on the specified type and input. This node is particularly useful when you need a consistent and unchanging number for various operations within your workflow. It supports different types of numbers, including integers, floats, and booleans, providing flexibility depending on your needs. By converting and returning the number in multiple formats, it ensures compatibility with other nodes and operations, making it a versatile tool in your AI art creation process.
This parameter specifies the type of number you want to generate. It can be set to integer
, float
, or bool
. The type determines how the input number is processed and returned. For example, choosing integer
will ensure the number is treated as an integer, while float
will treat it as a floating-point number, and bool
will convert it to a boolean value based on its magnitude.
This is the primary numerical input for the node. Depending on the number_type
selected, this value will be converted and returned in the appropriate format. For instance, if number_type
is set to integer
, the input will be converted to an integer. This parameter allows you to input the desired constant number directly.
This optional parameter allows you to input the number as a text string. If provided, the node will convert this text to the specified number_type
. This can be useful if you need to input numbers dynamically or from text-based sources. If not provided, the node will use the number
parameter directly.
This output provides the constant number as an integer. It is useful when subsequent nodes or operations require an integer input.
This output provides the constant number as a float. It ensures that the number can be used in operations that require floating-point precision.
This output provides the constant number as a boolean. It converts the number to a boolean based on its magnitude, where values greater than 0.5 are considered True
and others as False
.
number_type
parameter to ensure the generated number is in the correct format for your specific needs.number_as_text
parameter when you need to input numbers dynamically or from text-based sources.number_type
is provided.number_type
parameter is set to one of the supported types: integer
, float
, or bool
.number_as_text
parameter contains a non-numeric string that cannot be converted to a float.number_as_text
parameter contains a valid numeric string.number
parameter is not provided and number_as_text
is also not set.number
or number_as_text
parameter is provided with a valid numeric value.© Copyright 2024 RunComfy. All Rights Reserved.