Nodes/comfyui-jk-easy-nodes/JK String Not Empty
ComfyUI Node

JK String Not Empty

Gate a branch on a text field actually having content

By kostenickj·Created 2 years ago·Updated 2 years ago· 8
JK String Not Empty
    • BOOLEAN
    a

    The mirror image of JKStringEmpty: one string in, one BOOLEAN out, true if the string actually has content and false if it's empty. Same tiny node, opposite answer - which one you reach for is purely about which way round makes your graph's logic read more naturally. If your downstream branch is "only run this step when there's something to work with," this node's true output maps directly to "go," which is often cleaner than wiring a NOT node onto JKStringEmpty's output.

    The inputs and outputs that matter

    One required input: a (STRING). One output: BOOLEAN. No configuration beyond that - it's a length check, nothing more.

    Where this fits

    This pack's own optional text fields - extra_positive_text and extra_negative_text on EasyHRFix, JKEasyDetailer, and their Context siblings - default to empty and only do anything if you fill them in. JK String Not Empty is the natural gate for "did the user actually put something here" before you route conditioning through an extra encode step, log a value, or trigger any optional branch that depends on a text field actually being filled. It pairs well with JKAnythingToString if the value you're checking started out as something other than text.

    More generally, this is the kind of node you reach for whenever a workflow needs to be more robust than "assume the user filled everything in." Optional text fields are common across ComfyUI packs - an extra style tag, an override caption, a custom filename fragment - and a lot of them silently do nothing useful if left blank rather than erroring. Wiring this node's output into a gate before the step that consumes that text turns "silently does nothing" into an explicit, visible branch in your graph, which makes a workflow easier to debug later, especially one you're sharing with someone else who might leave a field empty without realizing it matters.

    Installing it

    Part of the kostenickj/jk-comfyui-helpers pack, not a standalone install - already present on comfy.icu, or cd ComfyUI/custom_nodes && git clone https://github.com/kostenickj/jk-comfyui-helpers.git and restart if you're self-hosting. Pure logic, no model downloads, no extra dependencies. The README's ComfyUI Manager listing was pending at time of writing, so the manual clone is the reliable route; git pull to update. This is a small, low-visibility personal toolkit overall - there's essentially no community discussion to lean on if something's unclear, so the node's behavior and the README are what you have.

    Common issues

    Same small caveat as its sibling: ComfyUI distinguishes between an unconnected optional input (which can come through as None) and a genuinely empty string "". If you're feeding this node from something that might output None rather than an actual empty string, the check may not behave exactly as expected - route the value through JKAnythingToString first if you're unsure what's actually arriving. Beyond that, there's not much that can go wrong with a node this small.

    CategoryJK Comfy Helpers/Util

    Inputs (1)

    NameTypeDefaultDescription
    aSTRING

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN