Nodes/ComfyUI-Buff-Nodes/String Processor (Buff)
ComfyUI Node

String Processor (Buff)

A ComfyUI node in utils with 5 inputs and 1 output.

By BuffMcBigHuge·Created about a year ago·Updated 2 months ago· 2
String Processor (Buff)
    • processed_string
    input_string
    operationfirst_n_chars
    n1
    delimiter
    custom_expression{s}.upper()
    Categoryutils

    Inputs (5)

    NameTypeDefaultDescription
    input_stringSTRINGThe input string to process. Can be multiple lines.
    operationCOMBOfirst_n_charsSelect the operation to perform on the input string: • first_n_chars: Extract the first N characters from the input string • last_n_chars: Extract the last N characters from the input string • first_n_words: Extract the first N words from the input string (using delimiter) • last_n_words: Extract the last N words from the input string (using delimiter) • custom_expression: Use a custom Python expression to manipulate the string
    nINT11–10000Number of characters or words to extract
    delimiteroptSTRING Character(s) used to separate words (only used for word operations)
    custom_expressionoptSTRING{s}.upper()Custom Python expression to manipulate the input string. Use {s} as a placeholder for the input string. Examples: • {s}.upper() - Convert to uppercase • {s}.lower() - Convert to lowercase • {s}.replace('old', 'new') - Replace text • {s}[::-1] - Reverse the string • {s}.split(',')[0] - Get first item of CSV • ' '.join([w.capitalize() for w in {s}.split()]) - Title case • {s}.strip() - Remove whitespace from ends • {s} + ' (modified)' - Append text

    Outputs (1)

    NameTypeDescription
    processed_stringSTRING