String Case Converter
Upper, lower, title, swapcase — without leaving the graph
- result
Sometimes a filename needs to be MODEL_XL, sometimes model_xl, and sometimes Model Xl. Doing that transformation in ComfyUI usually means a Python-expression node or an LLM call for something a one-line .upper() handles. String Case Converter is that one-liner, packaged: pick a case style, get the transformed string back.
It's a pure string utility - no files, no models, no state. It exists so your output filenames and prompt variables are consistently cased without you typing a regex.
How it works
Straightforward Python string methods under a dropdown. The case_type menu maps to five built-ins:
upper-HELLO WORLDlower-hello worldtitle-Hello World(every word's first letter capitalized)capitalize-Hello world(first letter only)swapcase- flips every letter's case, soHello→hELLO
An empty input returns an empty string rather than erroring.
Inputs and outputs
- text - the string to convert (multiline allowed).
- case_type - the dropdown above.
Output: result - the converted string.
Install
Standard pack install - ComfyUI Manager (search "ComfyUI-AutoFlow") or:
cd ComfyUI/custom_nodes
git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow
Restart after. No dependencies.
Where people get burned
capitalizevstitle. They look similar and aren't:titleuppercases the start of every word,capitalizeonly the very first letter. Pick the wrong one andhello worldbecomesHello worldinstead ofHello World.- Unicode surprises. These are Python's Unicode-aware methods.
title()has quirks with apostrophes ("don't"→"Don'T"), which is standard behavior but occasionally ugly in filenames. - It doesn't trim whitespace. Leading/trailing spaces survive the conversion. If that matters, trim upstream.
Honestly, this is the kind of node you install once, use for a filename, and forget - but that's fine. It's the difference between hand-casing strings mid-graph and having a place to point at when a workflow demands consistent casing.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| case_type | COMBO | lower | 5 options: upper, lower, title, capitalize, swapcase |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |