ComfyUI Node Runs on cloud
Text Cleanup
Tidy a caption or prompt: change its letter case, collapse stray spaces and line breaks, fix the spacing around punctuation, settle how it ends and straighten curly quotes. Bracketed tokens such as [trigger] keep their case, and with every setting off the text passes through untouched.
Text Cleanup
- text
- changed
◄text►
◄casekeep►
◄whitespacetrue►
◄line_breakskeep►
◄punctuationtrue►
◄endingkeep►
◄quotesfalse►
CategoryWAS Suite/Text/Operations
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | The caption or prompt to tidy, as `a woman ,stands on a beach,,`. Wired from a STRING list, the node runs once per text. | |
| case | COMBO | keep | keep = as written; lower; upper; sentence = a capital starts each sentence; title = a capital starts each word. Bracketed tokens such as `[trigger]` keep their case, and sentence and title leave words like NASA or iPhone alone. |
| whitespace | BOOLEAN | true | true = runs of spaces and tabs become one space and every line is trimmed, as `a woman ` to `a woman`; false = spacing as written. |
| line_breaks | COMBO | keep | `keep` = lines as written; `one line` = every line joined with a space and blank lines dropped, for a caption file or an encoder that wants a single line. |
| punctuation | BOOLEAN | true | true = no space before , . ; : ! ?, one space after , ; : before a word, doubled commas and `. .` collapsed, and separators at either end of a line removed; false = punctuation as written. |
| ending | COMBO | keep | `keep` = as written; `period` = ends with a full stop unless it already ends in . ! or ?; `none` = closing full stops, commas and semicolons removed. |
| quotes | BOOLEAN | false | true = curly quotes and apostrophes become straight ones, as “it’s” to "it's"; false = kept as written. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | The tidied text. |
| changed | BOOLEAN | true when a setting changed the text; false when it came through exactly as it went in. |