ComfyUI Node

Text Case

UPPERCASE, lowercase, Title Case — for your prompts

By DebugPadawan·Created about a year ago·Updated 5 months ago· 2
Text Case
    • result
    text
    modelowercase

    Sometimes the only thing wrong with your prompt is the case. Text Case is the plain-language version of case conversion - uppercase, lowercase, capitalize, title case, or swap case, from a single dropdown. It's the node you reach for when you're normalizing text that arrived from a wildcard, a file, or a half-typed prompt, and you want it consistent before it goes near the CLIP encoder.

    It ships in DebugPadawan's ComfyUI Essentials, a pure-Python utility pack. The mechanism is literally Python's string methods (str.upper(), str.lower(), and friends) behind a node interface.

    How it works

    Two required inputs:

    • text - the string to transform (multiline-friendly)
    • mode - the dropdown: uppercase, lowercase, capitalize, title case, swap case

    One output: result - the transformed string.

    What each mode does, concretely:

    • uppercase / lowercase - every character shifted, as you'd expect.
    • capitalize - first letter uppercase, the rest forced lowercase (Python's str.capitalize()).
    • title case - every word's first letter capitalized via str.title().
    • swap case - flips each letter's case (upper becomes lower and vice versa).

    One real-world quirk of Python's title(): it doesn't respect apostrophes. "don't" becomes "Don'T". If you're titling prompts with contractions, that will bite you, and you'll want the pack's Text Case Converter instead, which handles words more deliberately.

    Where you'll use it

    • Normalizing prompts so a tag list doesn't have inconsistent casing when it hits the text encoder.
    • Prepping text for display or filenames - lowercased filenames, title-cased labels.
    • Cleaning wildcard output where the source used inconsistent case.

    Installing it

    Whole pack, one install. ComfyUI Manager, searching for "DebugPadawans-ComfyUI-Essentials," or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DebugPadawan/DebugPadawans-ComfyUI-Essentials
    

    Then restart ComfyUI. Requirements (numpy, torch, opencv-python) are already satisfied by stock ComfyUI; no model downloads. Don't confuse the pack with cubiq's "ComfyUI Essentials" when searching Manager - different, larger pack, now in maintenance mode.

    Gotchas

    • The apostrophe trap. title case on "don't" yields "Don'T". Known Python behavior, real footgun for prompt text.
    • capitalize forces the rest lowercase - "hELLO" becomes "Hello", not "HELLO". If you expected only the first letter to change, that's the wrong mode.
    • Case changes don't touch non-letters - digits and punctuation pass through. That's usually what you want.
    • It's a small, quiet pack; for text-case nodes, behavior is simple enough that the source is the doc.
    CategoryDebugPadawan/Text

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    modeCOMBOlowercase5 options: uppercase, lowercase, capitalize, title case, swap case

    Outputs (1)

    NameTypeDescription
    resultSTRING