ComfyUI Node

String Upper

Turning your prompt into all caps, on purpose

By kale4eat·Created 2 years ago·Updated 2 years ago· 7
String Upper
    • string
    s

    String Upper is the "shout" button for text in your workflow: one string in, the same string in all caps out. On its own that sounds like a party trick, but the real job it does is normalization - and normalization is what makes comparisons in a node graph stop lying to you.

    What it is

    This node runs Python's s.upper() on its input. Every lowercase letter becomes uppercase; everything else - digits, punctuation, already-uppercase letters - passes through untouched. "a masterpiece, best quality" becomes "A MASTERPIECE, BEST QUALITY".

    The boring-but-useful reason to reach for it: string comparisons in this pack are case-sensitive. String Equal, String Not Equal, String StartsWith - all of them treat "Masterpiece" and "masterpiece" as different strings, even though you and I both know they're the same tag. Run both sides through String Upper (or String Lower, its sibling) before comparing, and you get case-insensitive matching for free. It's the standard trick.

    The inputs and outputs

    • s (STRING) - the text to convert.
    • string (STRING) - the all-caps result.

    One in, one out, nothing else. If you just want to see a prompt in caps for a filename or a display node, this is a zero-effort way to get there.

    How to install it

    Part of the string-util pack, which is one tiny dependency-free repo:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kale4eat/ComfyUI-string-util
    

    Or search "ComfyUI-string-util" in ComfyUI Manager and restart. You'll find it under the string-util category, right next to String Lower.

    Common issues

    Not much can go wrong here, which is the appeal. One thing worth remembering: uppercase is a style change, so if you uppercase a prompt before sending it to CLIP Text Encode, you've rewritten what the model sees - that's usually not what you want. Use this node for normalization and comparisons, or for cosmetic text like filenames and display strings. When in doubt, normalize for logic, not for the encoder.

    Categorystring-util

    Inputs (1)

    NameTypeDefaultDescription
    sSTRING

    Outputs (1)

    NameTypeDescription
    stringSTRING