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

JK String Not Equals

Branch on two strings being different

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

    The inverse of JKStringEquals: two strings in, and the BOOLEAN output is true when they don't match, false when they do. Functionally you could get the same result by running JKStringEquals into a NOT node, but having the comparison and the negation baked into one node keeps a branch-heavy graph a little less cluttered - one node instead of two for a check you'll likely use more than once.

    The inputs and outputs that matter

    Two required inputs, a and b, both STRING. One output, BOOLEAN: true for "different," false for "same." It's a direct, literal comparison - no case-insensitivity option, no whitespace trimming - so normalize both values upstream first if that matters for your comparison.

    Where this fits

    Useful anywhere your workflow logic is "do something unless this matches a specific value" rather than "do something only if it matches" - for instance, running a fallback branch whenever a mode string isn't the expected one, without inverting a JKStringEquals output by hand. If either value you're comparing didn't start life as a string - a number, a widget from another pack, a model or context object - run it through JKAnythingToString first so this node has an actual STRING to compare.

    This kind of node earns its keep most in workflows you're building for repeated or shared use rather than a one-off generation - a batch script that loops through several checkpoint names and needs to skip a specific one, a template workflow where you want a visible "did this not match what I expected" check instead of silently letting a mismatch propagate downstream, or a debugging setup where you're comparing a live value against a known-good constant while iterating on a graph. None of that needs anything clever from the node itself; it's the same length-and-character comparison as its sibling, just answering the opposite question.

    Installing it

    Bundled with the rest of kostenickj/jk-comfyui-helpers, no standalone install path - already on comfy.icu, or for self-hosted ComfyUI: cd ComfyUI/custom_nodes && git clone https://github.com/kostenickj/jk-comfyui-helpers.git, then restart. Pure logic, no model downloads, no extra Python dependencies. The README notes its ComfyUI Manager registration was pending, so a manual clone is the dependable path; git pull inside the folder to update later. This is a small, low-visibility personal toolkit overall, so don't expect much community write-up to fall back on - the node's behavior itself is straightforward enough that you shouldn't need much anyway.

    Common issues

    The one real trap with any of this pack's string-equality nodes: it's a strict, literal comparison. Differing capitalization, trailing whitespace, or a stray newline character will register as "different" even if the two strings look identical to you at a glance. If a comparison you expect to read false (i.e., "these match") keeps coming back true, check both values through a text preview or JKAnythingToString for hidden whitespace or casing mismatches before assuming the node itself is wrong.

    CategoryJK Comfy Helpers/Util

    Inputs (2)

    NameTypeDefaultDescription
    aSTRING
    bSTRING

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN