ComfyUI > Nodes > ComfyUI-LogicUtils > Manual Choice String

ComfyUI Node: Manual Choice String

Class Name

ManualChoiceString

Category
Logic Gates
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

Install this extension via the ComfyUI Manager by searching for ComfyUI-LogicUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-LogicUtils in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Manual Choice String Description

Parses input strings by separator to extract a specific segment based on a given index.

Manual Choice String:

The ManualChoiceString node is designed to parse a given input string using a specified separator and return a specific choice based on an index you provide. This node is particularly useful when you have a string containing multiple segments separated by a character, and you need to extract a particular segment based on its position. By allowing you to specify both the separator and the index, this node offers flexibility in handling various string formats, making it a valuable tool for tasks that involve string manipulation and extraction. Its primary goal is to simplify the process of selecting a specific part of a string, which can be especially beneficial in scenarios where strings are used to store multiple values or options.

Manual Choice String Input Parameters:

input_string

The input_string parameter is the main string that you want to parse and extract a choice from. It should contain multiple segments separated by a specific character, which you will define using the separator parameter. The default value is "a$b$c", which means that if you do not provide a different string, this default will be used. This parameter is crucial as it contains the data from which a specific segment will be selected.

separator

The separator parameter defines the character used to split the input_string into different segments. By default, this is set to "$", but you can change it to any character that suits your string format. The separator is essential because it determines how the string is divided, and thus, directly impacts which segments are available for selection.

index

The index parameter specifies the position of the segment you want to extract from the split string. It is an integer value with a default of 0, meaning it will select the first segment by default. The minimum value is 0, and the maximum is (2**63-1), allowing for a wide range of index values. This parameter is important because it allows you to target a specific segment within the string, based on its position.

Manual Choice String Output Parameters:

STRING

The output of the ManualChoiceString node is a single STRING value. This output represents the segment of the input_string that was selected based on the specified index. The importance of this output lies in its ability to provide you with a specific part of the string, which can then be used in further processing or decision-making tasks. It simplifies the extraction process by directly giving you the desired segment without additional parsing.

Manual Choice String Usage Tips:

  • Ensure that the separator you choose is present in the input_string; otherwise, the entire string will be treated as a single segment.
  • Use the index parameter carefully to avoid out-of-range errors, especially when working with strings of varying lengths.

Manual Choice String Common Errors and Solutions:

IndexError: list index out of range

  • Explanation: This error occurs when the index parameter is set to a value that exceeds the number of segments in the input_string.
  • Solution: Verify the number of segments in your input_string after splitting it with the separator, and ensure that the index is within this range.

ValueError: invalid literal for int() with base 10

  • Explanation: This error might occur if the input_string contains non-numeric segments and you attempt to convert them to an integer.
  • Solution: Ensure that the segments you are working with are compatible with the expected output type, or adjust your string content accordingly.

Manual Choice String Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-LogicUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.