π€ CR Text Operation
Quick string tweaks (uppercase, trim, reverse) inline
- STRING
- show_help
A tiny, boring, genuinely handy node: it takes a string and applies one simple transform - uppercase it, lowercase it, trim the whitespace, strip spaces, reverse it, and so on. That's it. When you've got text flowing through a graph (a prompt fragment, a filename, a label, a schedule string) and you need it in a particular shape, this saves you from doing it by hand.
It's from Comfyroll Studio (Suzie1 / RockOfFire), part of the pack's text-utilities collection that also includes Text Concatenate, Text Replace, and Text Length. None of them generate anything; they're the string-wrangling glue you end up needing once your graph starts passing text around.
How it works
You give it text and pick an operation, and it runs that one transform and outputs the result. No state, no side effects - same input and operation give the same output every time. It's the ComfyUI equivalent of a single line of Python string method.
The inputs that matter
text- the string to transform. Single-line here.operation- the transform to apply, one of seven:uppercase/lowercase- case conversion, the obvious two.capitalize- first letter up, rest down.invert_case- swap the case of every character.reverse- reverse the character order.trim- strip leading and trailing whitespace.remove_spaces- strip all spaces, not just the ends.
Output is the transformed STRING (plus the show_help link). Note the output is typed *, so it'll connect into most string-accepting inputs downstream without a fuss.
How to install it
- ComfyUI Manager: search
Comfyroll Studio, install, restart. - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git, then restart.
No models, no dependencies to speak of.
Common issues
There's very little to get wrong here - it's a one-line operation. The one thing worth flagging is trim versus remove_spaces: trim only removes whitespace at the start and end of the string, while remove_spaces deletes every space including the ones between words. If you remove_spaces on a multi-word prompt you'll glue all the words together, which is almost never what you want - reach for trim when you just want to clean up stray padding.
If you need something this node doesn't cover - find-and-replace, splitting, concatenation - that's a different Comfyroll text node (Text Replace, Split String, Text Concatenate); this one only does the seven fixed operations. And if it's missing from your menu, that's the Comfyroll pack failing to load, a pack-level issue rather than this node.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | β | |
| operation | COMBO | 7 options: uppercase, lowercase, capitalize, invert_case, reverse, trim, +1 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| STRING | * | β |
| show_help | STRING | β |