ComfyUI > Nodes > comfyui-mixlab-nodes > Text Split By Delimiter

ComfyUI Node: Text Split By Delimiter

Class Name

TextSplitByDelimiter

Category
♾️Mixlab/Text
Author
shadowcz007 (Account age: 3323days)
Extension
comfyui-mixlab-nodes
Latest Updated
2024-06-23
Github Stars
0.9K

How to Install comfyui-mixlab-nodes

Install this extension via the ComfyUI Manager by searching for comfyui-mixlab-nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfyui-mixlab-nodes 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Text Split By Delimiter Description

Efficiently split text into segments based on delimiter for easier data processing in AI art projects.

Text Split By Delimiter:

The TextSplitByDelimiter node is designed to help you efficiently split a block of text into smaller segments based on a specified delimiter. This can be particularly useful when you need to process or analyze text data in chunks, such as when working with lists, paragraphs, or any other text that needs to be divided into manageable parts. By using this node, you can easily break down large text inputs into smaller, more manageable pieces, making it easier to handle and manipulate text data for various applications in your AI art projects.

Text Split By Delimiter Input Parameters:

text

This parameter takes the input text that you want to split. It supports multiline text, allowing you to input large blocks of text that need to be divided. The text is processed as a string, and the node will use the specified delimiter to split this text into smaller segments.

delimiter

This parameter specifies the character or string that will be used to split the input text. By default, the delimiter is set to a comma (,), but you can customize it to any character or string that suits your needs. For example, you can use newline characters (\n), spaces ( ), or any other delimiter that is appropriate for your text data.

start_index

This parameter defines the starting index from which the text splitting should begin. It allows you to skip a certain number of initial segments if needed. The default value is 0, meaning the splitting will start from the beginning of the text. You can adjust this value to start splitting from a different position in the text.

skip_every

This parameter allows you to specify how many segments to skip after each split. For example, if you set this value to 1, the node will skip every other segment. The default value is 0, meaning no segments will be skipped. This can be useful if you want to exclude certain segments from the output.

max_count

This parameter sets the maximum number of segments to be returned after splitting the text. The default value is 10, but you can adjust it to any number that fits your requirements. This helps in limiting the number of segments, especially when dealing with large text inputs.

Text Split By Delimiter Output Parameters:

STRING

The output of this node is a list of strings, where each string is a segment of the original text that has been split based on the specified delimiter. The segments are returned in the order they appear in the input text, starting from the specified start index and considering any segments to be skipped as per the skip_every parameter.

Text Split By Delimiter Usage Tips:

  • To split a paragraph into individual sentences, use a period (.) as the delimiter.
  • If you need to process CSV data, set the delimiter to a comma (,).
  • Use the start_index parameter to skip headers or introductory text that you do not need to process.
  • Adjust the max_count parameter to limit the number of segments, which can be useful for large text inputs.

Text Split By Delimiter Common Errors and Solutions:

"Delimiter not found in text"

  • Explanation: The specified delimiter does not exist in the input text, resulting in no splits.
  • Solution: Ensure that the delimiter you have specified is present in the input text. Double-check for any typos or incorrect characters.

"Invalid start index"

  • Explanation: The start_index parameter is set to a value that is out of range for the input text.
  • Solution: Adjust the start_index to a valid position within the range of the input text length.

"Max count exceeded"

  • Explanation: The number of segments after splitting exceeds the max_count parameter.
  • Solution: Increase the max_count parameter to accommodate more segments or refine your delimiter to produce fewer segments.

Text Split By Delimiter Related Nodes

Go back to the extension to check out more related nodes.
comfyui-mixlab-nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.