ComfyUI > Nodes > ComfyUI-JDCN > JDCN_StringManipulator

ComfyUI Node: JDCN_StringManipulator

Class Name

JDCN_StringManipulator

Category
🔵 JDCN 🔵
Author
daxcay (Account age: 93days)
Extension
ComfyUI-JDCN
Latest Updated
2024-06-13
Github Stars
0.06K

How to Install ComfyUI-JDCN

Install this extension via the ComfyUI Manager by searching for ComfyUI-JDCN
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-JDCN 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

JDCN_StringManipulator Description

Advanced string manipulation node for AI artists, offering customizable text splitting and joining capabilities with various modes and ordering options.

JDCN_StringManipulator:

The JDCN_StringManipulator node is designed to provide advanced string manipulation capabilities, allowing you to split, select, and join text based on various criteria. This node is particularly useful for AI artists who need to process and transform text data in creative ways. By leveraging different separators and joiners, you can customize how text is divided and recombined, making it easier to manage and manipulate large blocks of text. The node supports multiple modes of operation, including fixed, incremental, decremental, and random index changes, as well as different ordering options for selecting text segments. This flexibility makes it a powerful tool for text-based data manipulation in your AI art projects.

JDCN_StringManipulator Input Parameters:

text

This parameter accepts the input text that you want to manipulate. It supports multiline input and has a default value of "concept". The text will be split based on the specified separator.

index

This integer parameter specifies the starting index for text selection. It has a default value of 0 and a minimum value of 0. The index determines where the selection of text segments begins.

index_change

This parameter defines how the index should be modified. It offers four options: fixed, increment, decrement, and random. The choice of index change affects how the text segments are selected during processing.

order

This parameter specifies the order in which text segments are selected. It offers three options: toptobottom, bottomtotop, and random. The order determines the sequence in which text segments are processed.

separator

This parameter defines the character used to split the input text. It offers a variety of options, including Comma, Semicolon, Pipe, Hyphen, Colon, Period, Question Mark, Exclamation Mark, Space, Tab, Newline, Carriage Return, Form Feed, Vertical Tab, and Custom. If Custom is selected, the custom_separator parameter will be used.

custom_separator

This string parameter specifies a custom separator to be used if the separator parameter is set to Custom. The default value is "NA".

batch_size

This integer parameter defines the number of text segments to be selected in each batch. It has a default value of 1 and a minimum value of 1. The batch size determines how many segments are processed at a time.

joiner

This parameter defines the character used to join the selected text segments. It offers the same options as the separator parameter. If Custom is selected, the custom_joiner parameter will be used.

custom_joiner

This string parameter specifies a custom joiner to be used if the joiner parameter is set to Custom. The default value is "NA".

space_before_join

This boolean parameter determines whether a space should be added before the joiner character. It has a default value of False.

JDCN_StringManipulator Output Parameters:

text

This output parameter returns the manipulated text after the selected segments have been joined together. It reflects the final result of the string manipulation process.

index_from

This output parameter returns the starting index used for selecting text segments. It helps you understand where the selection began.

index_to

This output parameter returns the ending index after the batch of text segments has been selected. It indicates the range of the selected segments.

batch_size

This output parameter returns the batch size used during the text manipulation process. It confirms the number of segments that were processed at a time.

JDCN_StringManipulator Usage Tips:

  • To split text based on a custom character, set the separator parameter to Custom and provide the desired character in the custom_separator parameter.
  • Use the order parameter to control the sequence of text segment selection, which can be useful for creating varied text patterns.
  • If you need to join text segments with a specific character, set the joiner parameter to Custom and provide the desired character in the custom_joiner parameter.
  • Enable the space_before_join parameter to add a space before the joiner character, which can improve readability in some cases.

JDCN_StringManipulator Common Errors and Solutions:

Index error

  • Explanation: This error occurs when the specified index is out of range for the available text segments.
  • Solution: Ensure that the index parameter is within the valid range of the text segments. Adjust the index or batch_size parameters to avoid exceeding the text length.

Custom separator not found

  • Explanation: This error occurs when the separator is set to Custom, but the custom_separator parameter is not provided or is invalid.
  • Solution: Provide a valid custom separator in the custom_separator parameter when using the Custom option for the separator.

Custom joiner not found

  • Explanation: This error occurs when the joiner is set to Custom, but the custom_joiner parameter is not provided or is invalid.
  • Solution: Provide a valid custom joiner in the custom_joiner parameter when using the Custom option for the joiner.

JDCN_StringManipulator Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-JDCN
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.