Visit ComfyUI Online for ready-to-use ComfyUI environment
Select specific text lines or blocks from input strings for manipulation based on markers or line numbers.
The ImpactStringSelector node is designed to help you select specific lines or blocks of text from a given string input. This node is particularly useful when you need to extract or manipulate text data based on line numbers or specific markers. It can handle both single-line and multi-line text inputs, making it versatile for various text processing tasks. The node's primary function is to allow you to choose a particular line or block of text from the input string, which can be especially beneficial in scenarios where you need to dynamically select and use different parts of a text based on certain conditions or indices.
This parameter accepts the input text from which you want to select specific lines or blocks. It supports multi-line text, allowing you to input large text blocks. The text is split into lines based on newline characters. This parameter is essential as it provides the raw data that the node will process.
This boolean parameter determines whether the node should treat the input text as a single block or multiple blocks separated by lines starting with the #
character. When set to True
, the node will consider lines starting with #
as the beginning of a new block and will concatenate lines until the next #
or the end of the text. The default value is False
, meaning the text is treated as individual lines by default. This parameter helps in organizing and selecting text blocks more efficiently.
This integer parameter specifies the index of the line or block you want to select from the input text. The index is zero-based, meaning 0
refers to the first line or block. If the specified index exceeds the number of available lines or blocks, the node will use the modulo operation to wrap around and select a valid index. The default value is 0
, ensuring that the first line or block is selected by default. This parameter is crucial for dynamically choosing different parts of the text based on your needs.
The output is a single string that represents the selected line or block of text from the input. This output can be used in subsequent nodes or processes where specific text data is required. The output is directly influenced by the input parameters, particularly the select
and multiline
parameters, which determine which part of the input text is chosen.
multiline
parameter is set to False
and use the select
parameter to specify the line index.#
, set the multiline
parameter to True
to enable block selection. Use the select
parameter to choose the desired block.select
parameter value.select
parameter value exceeds the number of available lines or blocks in the input text.select
parameter value is within the valid range of indices. You can also use the modulo operation to wrap around the index.select
parameter is not a valid integer.select
parameter is set to a valid integer value. If using a variable, ensure it is properly converted to an integer before passing it to the node.© Copyright 2024 RunComfy. All Rights Reserved.