ComfyUI Node

title

Title-Case Your Prompts (and Watch Out for Apostrophes)

By StableLlama·Created about a year ago·Updated 4 days ago· 48
title
    • STRING
    string

    Want "cyberpunk city street at night" to come out as "Cyberpunk City Street At Night"? That's title case, and that's what title does. It's a formatting node - you use it when you're building something human-facing like a filename, an overlay title, or a caption, and you want the words capitalized properly instead of shouting or lowercase.

    How it works

    Straight pass-through to Python's str.title(), from StableLlama's Basic data handling pack (no dependencies, pure Python). It returns a copy where every word starts with an uppercase character and the rest of the word is lowercase. One input (string), one output (STRING). No knobs to turn.

    The pack has the full case toolkit, so here's the cheat sheet for choosing: upper = ALL CAPS, lower = all lowercase, capitalize = only the first character of the whole string is uppercase, and title = every word capitalized. If you're generating a title, this is the one.

    Where it fits

    • Filenames - turning "my_render_042" into "My Render 042" for a nicer output filename.
    • Overlay text - prepping a title string before a text-overlay node.
    • Caption cleanup - normalizing tags or generated captions so each word is properly cased.

    The one real pitfall is apostrophes. Python's title() doesn't know grammar - "don't" becomes "Don'T", because it treats the apostrophe as a word boundary and capitalizes whatever follows it. If your text is full of contractions, this node will mangle them. "rock 'n' roll" becomes "Rock 'N' Roll". For most workflow strings - filenames, short titles, tag lists - that never comes up. For prose, it will, and it's not the node's fault so much as Python's blunt definition of "word."

    Installing it

    Search "Basic data handling" in ComfyUI Manager and restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
    

    Restart and you're set. No models, no dependency installs - this pack is deliberately boring in the best way.

    Gotchas

    Beyond the apostrophe issue, remember that title-casing is a lossy transform - it doesn't preserve your original casing, so don't run it on data you need to match case-sensitively later without keeping the original around. And if you're feeding the result into a CLIP encoder, title case changes the prompt tokens; that's usually fine, but it is a change, not just a display nicety.

    CategoryBasic/STRING

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING