Nodes/ComfyUI-LogicUtils/Length of String
ComfyUI Node

Length of String

The one-line character counter this pack is built around

By aria1th·Created 3 years ago·Updated 7 months ago· 119
Length of String
    • INT
    string

    This is len() with a node body around it. You give it a string, it gives you back the character count as an integer. There's no cleverness to explain - the entire value proposition is that ComfyUI doesn't have this natively, and once you're building anything with real branching logic, you need a number to compare against, and "how long is this string" is one of the most common numbers you'll want.

    Where it actually earns its keep: gating on whether a caption or prompt is empty before you burn a generation on it, checking a filename isn't suspiciously short (a sign an upstream node returned garbage), or feeding a length into one of LogicUtils' own comparison nodes to branch a workflow. It's small on purpose. If you've ever needed "if len(x) == 0, stop" in ComfyUI and gone hunting for a node that does exactly that and nothing else, this is it.

    Inputs and outputs

    • string (default "") - anything you can wire a STRING into: a prompt, a filename, a tag list, output from another logic node.

    Output is a plain INT - the character count, ready to feed into a comparison, a math node, or IsPrimeNode if you're feeling silly about it.

    Installing ComfyUI-LogicUtils

    Via ComfyUI Manager: Install Custom Nodes → search "ComfyUI-LogicUtils" → install → restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aria1th/ComfyUI-LogicUtils
    

    Restart ComfyUI. Zero dependencies for this node - it's a single Python builtin wearing a node's clothes, so there's genuinely nothing that can go wrong on install.

    Worth knowing

    LogicUtils is aria1th's utility dump - the same handle that trains Illustrious XL as AngelBottomless, though this repo is a separate, much lower-stakes side project. Its README openly admits there's basically no documentation ("proper documentation is being prepared, however there are too many nodes"), which is exactly why nodes like this one are worth spelling out individually. The pack picked up a real endorsement on r/StableDiffusion in January 2026 - someone needed a tiny comparison node and didn't want to install a giant pack like impact-pack (which drags in SAM) or a half-maintained one just to get it, and LogicUtils got named as the answer specifically because it has no dependencies. That's this node in a sentence: small, dependency-free, does one thing. Public commits to the repo stopped shortly after that, in January 2026, so treat it as stable-and-abandoned rather than actively maintained - fine for something this simple, since there's nothing left to break.

    CategoryLogic Gates

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING

    Outputs (1)

    NameTypeDescription
    INTINT