ComfyUI Node

isupper

Isupper — the sibling of islower that checks the screaming text

By StableLlama·Created about a year ago·Updated 4 days ago· 48
isupper
    • BOOLEAN
    string

    Same family, opposite question: isupper asks whether a string is all uppercase. If islower is the quiet sibling that checks whether your tags came out normalized, isupper is the one that catches text that arrived screaming - ALL CAPS filenames, header text, or a value someone's code uppercased before it reached you. It returns a BOOLEAN you can branch a conditional on.

    Reach for it when case matters downstream: verifying a constant, checking whether an acronym-heavy string is already in the form you want, or as the other half of a normalize-and-verify chain - lower the string, check it, use it.

    How it works

    Python's str.isupper(). Mirrors islower exactly: it needs at least one cased character, and every cased character must be uppercase. Non-cased characters - digits, punctuation, underscores - don't count for or against:

    • "HELLO"True
    • "HELLO 123!"True
    • "Hello"False
    • "123"False (no cased characters at all)
    • ""False
    • "HELLO_WORLD"True (underscore is ignored)

    Same family quirk as islower: "123" and "" both fail because there are no cased characters to be uppercase. And mixed-case sneaks through nothing - one lowercase letter anywhere flips it to False.

    Inputs and outputs

    One required input, string (default ""), one BOOLEAN output. Wire it into a conditional or comparison - on True pass the string along, on False route it into this pack's upper node to force the case.

    Installing it

    This is part of the Basic data handling pack by StableLlama. ComfyUI Manager: search "Basic data handling", install, restart. Manual route:

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

    The whole pack is pure Python - no dependencies, no model files, no pip install step. It's the rare custom node that can't drag you into dependency hell, which is why it shows up in shared workflows all the time. Find it under Basic/STRING/is.

    Common issues

    The empty-string trap is identical to islower: blank text returns False, because there's nothing cased to test. So don't use isupper as a "is this string non-empty" check - it isn't. And the punctuation rule runs counter to intuition: "ABC-123" is True even with the hyphen and digits, because only the letters are evaluated. If you need to know whether a whole filename is uppercase including its extension, check the extension separately or normalize it first. For plain "did this text come through all caps", it does exactly what it says.

    CategoryBasic/STRING/is

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN