ComfyUI Node

String Equal

The exact-match check that gates your workflow

By kale4eat·Created 2 years ago·Updated 2 years ago· 7
String Equal
    • bool
    s1
    s2

    String Equal is the gatekeeper: it compares two strings and tells you, with a boolean, whether they're identical. That's the whole job - and it's the node you reach for when a workflow needs to make a decision about what a string is, not just what it contains.

    What it is

    It runs Python's s1 == s2 and returns True when the two strings match exactly, False otherwise. Exact means exact: every character, including case, spacing, and trailing whitespace. "draft" and "Draft" are not equal. "draft" and "draft " are not equal. That strictness is a feature - it's also the thing that will surprise you the first time.

    The classic use: a mode switch. Set a string to "fast" or "quality", compare it against a fixed literal, and route the boolean into a switch or reroute node to pick samplers, steps, or upscalers. It's also handy for validating that an auto-generated string came out the way you expected before you spend a generation on it.

    The inputs and outputs

    • s1 (STRING) - first string.
    • s2 (STRING) - second string.
    • bool (BOOLEAN) - True if s1 and s2 are exactly equal.

    Nothing else. If you need the inverse, the same pack has String Not Equal (!=), which returns True when they differ.

    How to install it

    Same dependency-free pack as all the others:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kale4eat/ComfyUI-string-util
    

    or search "ComfyUI-string-util" in ComfyUI Manager and restart. It's under the string-util category.

    Common issues

    Case sensitivity is the #1 surprise, and it's actually a Python default, not a bug here. If your two strings come from different places - one typed by hand, one generated - the case will drift and the comparison will silently return False. Normalize both sides with String Upper or String Lower before comparing and you get case-insensitive equality. Whitespace is the second trap: run the strings through String Strip first if there's any chance of stray spaces or newlines. Two tiny prep nodes and your gate stops lying to you.

    Categorystring-util

    Inputs (2)

    NameTypeDefaultDescription
    s1STRING
    s2STRING

    Outputs (1)

    NameTypeDescription
    boolBOOLEAN