Visit ComfyUI Online for ready-to-use ComfyUI environment
Parse input string, extract integer element based on separator and index for dynamic value selection.
The LogicUtil_ManualChoiceInt
node is designed to parse a given input string, split it based on a specified separator, and return a specific element from the resulting list as an integer. This node is particularly useful when you need to extract and utilize specific numerical values from a delimited string. By allowing you to specify the separator and the index of the desired element, this node provides flexibility and precision in handling string data. This can be especially beneficial in scenarios where you need to dynamically select and process numerical values from a list of options.
The input_string
parameter is the string that will be parsed and split into multiple elements based on the specified separator. This string should contain numerical values separated by the chosen delimiter. The default value is "1$2$3"
, which means the string will be split into the elements 1
, 2
, and 3
when using the default separator $
.
The separator
parameter defines the character used to split the input_string
into individual elements. By default, this is set to "$"
, but you can change it to any character that suits your needs. This flexibility allows you to work with various formats of delimited strings.
The index
parameter specifies the position of the element you want to extract from the split string. It is an integer value with a default of 0
, meaning it will select the first element by default. The index
must be within the range of available elements in the split string, with a minimum value of 0
and a maximum value of 9999999999
.
The output parameter is an integer (INT
) that represents the element selected from the split string based on the specified index. This integer value is the result of converting the chosen string element to an integer, providing a numerical output that can be used in further processing or calculations.
input_string
contains only numerical values separated by the specified separator
to avoid conversion errors.index
parameter to dynamically select different elements from the string, which can be useful in scenarios where the position of the desired value may change.separator
parameter accordingly to correctly parse the input_string
.index
is outside the range of available elements in the split string.index
parameter is within the valid range of elements in the input_string
. Verify the length of the split string and adjust the index
accordingly.input_string
are valid numerical values. Check for any non-numeric characters or empty elements in the string and correct them.© Copyright 2024 RunComfy. All Rights Reserved.