ComfyUI Node

Is String Empty (Soze)

A guard for the workflow you don't want to run on nothing

By SozeInc·Created 2 years ago·Updated 5 days ago· 10
Is String Empty (Soze)
    • BOOLEAN
    input_text

    This is a small enough pack that when someone on r/comfyui asked exactly the question this node answers - "is there a node that checks if a String input is empty before running the workflow?" - the top reply just linked straight to it, with the honest caveat that they'd never personally used it. That's a fair summary of where this pack sits: nobody's evangelizing it, but it quietly has the specific node for the specific annoying gap you just hit.

    And the gap is real. ComfyUI will happily run a full generation on an empty prompt string, a blank filename, or a text field nobody filled in - burning GPU time and giving you nothing useful back. This node exists to catch that before it happens.

    How it works

    It takes one string and returns a boolean: true if the string is empty (or effectively empty - just whitespace), false if there's real content in it. That boolean is the whole point - wire it into a switch or gate node so downstream execution only proceeds when there's actually something to work with.

    Where this gets genuinely tricky, and it's worth knowing going in: ComfyUI doesn't have a clean native way to stop a workflow mid-graph once you've detected the problem. Checking for empty is the easy 10%; halting execution on it is the part people struggle with. The realistic options are routing the boolean into whatever switch/gate node you're already using to skip branches, or - for anything more forceful - some intentional-failure trick further downstream (like pointing a file loader at a path you know doesn't exist) to force an error rather than let the run continue silently.

    The inputs and outputs that matter

    Just one required input, input_text (STRING), and one output: BOOLEAN. There's nothing else to configure - no threshold, no "trim first" toggle, no case sensitivity option. It's a single yes/no check.

    How to install it

    ComfyUI Manager → search "ComfyUI_Soze" → install → restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SozeInc/ComfyUI_Soze.git
    pip install -r ComfyUI_Soze/requirements.txt
    

    then restart. Zero dependencies beyond the base pack - this is a one-line check.

    Common issues & troubleshooting

    The recurring theme in the discussion that led people to this node in the first place: detecting the empty string is trivial, actually acting on it is the hard part. If you wire this in and your workflow still runs to completion on an empty field, the node isn't broken - you haven't connected its BOOLEAN output to anything that actually gates execution. A bare, unconnected check does nothing.

    Also worth doing early rather than late: if you want the check to actually save you compute, it needs to run before the expensive nodes, and ComfyUI's execution order isn't always obvious from graph layout alone. If your check seems to fire after the generation already started, look at whether something needs an explicit dependency link (routing a dummy connection through it) to force it to evaluate first.

    Categorystrings

    Inputs (1)

    NameTypeDefaultDescription
    input_textSTRING

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN