Nodes/ComfyUI-AutoFlow/String Case Converter
ComfyUI Node

String Case Converter

Upper, lower, title, swapcase — without leaving the graph

By ZXL-Xinram·Created about a year ago·Updated 9 months ago· 4
String Case Converter
    • result
    text
    case_typelower

    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 WORLD
    • lower - hello world
    • title - Hello World (every word's first letter capitalized)
    • capitalize - Hello world (first letter only)
    • swapcase - flips every letter's case, so HellohELLO

    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

    • capitalize vs title. They look similar and aren't: title uppercases the start of every word, capitalize only the very first letter. Pick the wrong one and hello world becomes Hello world instead of Hello 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.

    CategoryAutoFlow/Utilities

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    case_typeCOMBOlower5 options: upper, lower, title, capitalize, swapcase

    Outputs (1)

    NameTypeDescription
    resultSTRING