ComfyUI Node
String Processor (Buff)
A ComfyUI node in utils with 5 inputs and 1 output.
String Processor (Buff)
- processed_string
◄input_string►
◄operationfirst_n_chars►
◄n1►
◄delimiter ►
◄custom_expression{s}.upper()►
Categoryutils
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| input_string | STRING | The input string to process. Can be multiple lines. | |
| operation | COMBO | first_n_chars | Select 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 |
| n | INT | 11–10000 | Number of characters or words to extract |
| delimiteropt | STRING | Character(s) used to separate words (only used for word operations) | |
| custom_expressionopt | STRING | {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)
| Name | Type | Description |
|---|---|---|
| processed_string | STRING | — |