Visit ComfyUI Online for ready-to-use ComfyUI environment
Parse input string, split by separator, return specific float choice based on index from predefined list.
The LogicUtil_ManualChoiceFloat
node is designed to parse an input string, split it based on a specified separator, and return a specific choice as a float. This node is particularly useful when you need to select a floating-point number from a predefined list of values. By providing an index, you can control which value from the list is returned. This functionality is beneficial for scenarios where you need to dynamically choose between multiple floating-point values based on certain conditions or inputs.
The input_string
parameter is a string that contains multiple float values separated by a specific character. This string is parsed and split into individual float values based on the separator provided. The default value is "1.0$2.0$3.0"
, which means the string will be split into 1.0
, 2.0
, and 3.0
by default. This parameter allows you to define the list of float values from which a choice will be made.
The separator
parameter is a string that specifies the character used to split the input_string
into individual float values. The default value is "$"
. By changing this separator, you can customize how the input string is parsed. For example, if your input string uses commas to separate values, you can set the separator to ","
.
The index
parameter is an integer that determines which value from the split list will be returned. The index is zero-based, meaning an index of 0
will return the first value, an index of 1
will return the second value, and so on. The default value is 0
, with a minimum value of 0
and a maximum value of 9999999999
. This parameter allows you to select a specific float value from the list.
The output parameter is a float value that corresponds to the choice made based on the provided index. This float value is one of the values from the split input_string
. The output is crucial for scenarios where a specific floating-point number is needed from a predefined list, allowing for dynamic and flexible selection based on the input parameters.
input_string
is correctly formatted and contains valid float values separated by the specified separator
.index
parameter to dynamically select different float values based on your application's logic or conditions.separator
parameter accordingly to match the character used in your input_string
.index
is greater than the number of elements in the split input_string
.index
parameter is within the range of the number of elements in the input_string
. Verify the length of the split list and adjust the index
accordingly.input_string
cannot be converted to a float.input_string
to ensure all elements are valid float values. Remove or correct any non-numeric values in the string.© Copyright 2024 RunComfy. All Rights Reserved.