ComfyUI > Nodes > ComfyUI_StringEssentials > String Conditional Append

ComfyUI Node: String Conditional Append

Class Name

StringConditionalAppend

Category
utils/StringEssentials
Author
bradsec (Account age: 4314days)
Extension
ComfyUI_StringEssentials
Latest Updated
2026-03-09
Github Stars
0.03K

How to Install ComfyUI_StringEssentials

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

String Conditional Append Description

Conditionally appends strings to input, ensuring substrings are present, with customizable options.

String Conditional Append:

The StringConditionalAppend node is designed to enhance your string manipulation capabilities by conditionally appending specified strings to an input string. This node is particularly useful when you need to ensure that certain substrings are present in your text, appending them only if they are not already included. It offers flexibility in terms of case sensitivity and the position where the strings should be appended, either at the beginning or the end of the input string. By using this node, you can automate the process of checking and appending strings, which can be especially beneficial in scenarios where maintaining specific text patterns or formats is crucial. The node's ability to handle multiple strings and customize separators further adds to its versatility, making it a valuable tool for AI artists who need to manage and manipulate text data efficiently.

String Conditional Append Input Parameters:

input_string

This parameter represents the initial string that you want to process. It is the base text to which other strings may be appended if they are not already present. The input string is mandatory and serves as the foundation for the node's operations.

strings_to_check

This parameter allows you to specify the strings that you want to ensure are present in the input_string. You can enter multiple strings, each on a new line. The node will check each of these strings against the input_string and append them if they are not found. This parameter is crucial for defining the substrings you want to conditionally append.

position

This parameter determines where the strings should be appended if they are not found in the input_string. You can choose between "end" and "beginning". The default value is "end", meaning the strings will be added to the end of the input_string unless specified otherwise. This setting allows you to control the placement of the appended strings.

match_case

This boolean parameter specifies whether the search for the strings should be case-sensitive. If set to True, the node will consider case differences when checking for the presence of strings. The default value is False, meaning the search is case-insensitive by default. This parameter is important for ensuring that the node behaves according to your case sensitivity requirements.

separator

This parameter defines the character(s) used to separate the input_string from the appended strings. The default separator is ", ", but you can customize it to any string that suits your needs. This parameter is useful for maintaining readability and formatting in the resulting string.

String Conditional Append Output Parameters:

output_string

This output parameter provides the final string after the conditional append operation. It includes the original input_string with any necessary strings appended according to the specified conditions. This output is essential for obtaining the processed text that meets your requirements.

was_appended

This boolean output indicates whether any strings were appended to the input_string. It returns True if at least one string was added, and False if no changes were made. This output helps you understand whether the operation resulted in any modifications to the original string.

String Conditional Append Usage Tips:

  • Use the strings_to_check parameter to list all potential substrings you want to ensure are present in your text, especially when dealing with dynamic content that may vary.
  • Adjust the position parameter based on your formatting needs; appending at the beginning can be useful for adding prefixes, while appending at the end is ideal for suffixes.
  • Utilize the match_case parameter to control case sensitivity, which is particularly important when dealing with case-sensitive data or when the exact case of substrings matters.
  • Customize the separator to maintain the desired readability and formatting of your output string, especially when appending multiple strings.

String Conditional Append Common Errors and Solutions:

No strings to check provided

  • Explanation: This error occurs when the strings_to_check parameter is empty or not provided, resulting in no operation being performed.
  • Solution: Ensure that you provide at least one string in the strings_to_check parameter to enable the node to perform its function.

Invalid position value

  • Explanation: This error arises when an invalid value is set for the position parameter, which should be either "end" or "beginning".
  • Solution: Verify that the position parameter is set to either "end" or "beginning" to ensure correct operation.

Separator not defined

  • Explanation: If the separator parameter is not defined, the appended strings may not be properly separated from the input_string.
  • Solution: Define a suitable separator to ensure that the appended strings are clearly distinguished from the original text.

String Conditional Append Related Nodes

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