Nodes/CRT-Nodes/Boolean Transform (CRT)
ComfyUI Node

Boolean Transform (CRT)

Turn a string into an INT and a BOOLEAN

By PGCRT·Created 2 years ago·Updated about 15 hours ago· 128
Boolean Transform (CRT)
    • INT
    • BOOLEAN
    input_string0.0

    A lot of the friction in a ComfyUI graph isn't about generating images at all - it's type plumbing. You've got a value stuck as a STRING because it came out of a JSON node, a text file reader, or a widget that only outputs text, and everything downstream wants a proper INT or BOOLEAN. Boolean Transform is a small bridge node for exactly that gap: hand it a string, get back both a parsed integer and a boolean in one shot.

    What it's for

    Think of the common case: some upstream node gives you a number as text - "1", "0", "3" - maybe pulled from a saved config, a prompt-embedded value, or a batch/loop counter that only comes out as a string. You need that as a real INT to feed a widget, and you also want a quick true/false read of it (is it zero or non-zero) to gate a conditional branch. Rather than chaining a string-to-int node into a separate int-to-bool comparison, this node gives you both outputs from the same string in one step.

    The default value, "0.0", is a hint about what it expects to parse: numeric text, including decimal-looking strings, converted down to an integer plus a truthiness flag.

    The inputs and outputs that matter

    One required input:

    • input_string - a single-line STRING, default "0.0".

    Two outputs:

    • INT - the parsed integer value of the string.
    • BOOLEAN - presumably a truthy/falsy read derived from that same value (zero reads false, non-zero reads true is the standard convention, though the schema doesn't spell out the exact rule beyond the field names and default).

    Since the pack doesn't document the parsing rule for non-numeric input, treat this as a numeric-string parser rather than a general string-to-boolean node - if you feed it something that isn't a number (like "yes" or "true"), don't assume it'll do what you want without testing first.

    Installing it

    This node sits in CRT-Nodes' CRT/Utils/Logic & Values category, next to things like Resolution helpers and the Sampler/Scheduler Selector. It's part of PGCRT's (CRYPT_EXE's) full CRT-Nodes pack - installing gets you the whole suite, not just this node.

    ComfyUI Manager - search CRT-Nodes, install, restart.

    Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PGCRT/CRT-Nodes.git
    pip install -r requirements.txt
    

    Restart ComfyUI. This node is pure Python parsing logic - no extra downloads, no heavy dependencies riding along with it.

    Common issues

    • Non-numeric strings are the obvious trap. If your upstream text isn't a clean number (extra whitespace, a unit suffix, a word), the parse can fail or silently produce something you didn't expect. Sanitize the string upstream (an Advanced String Replace-style cleanup, or a trim) if you're not fully in control of where it's coming from.
    • Node showing up under an unusual display name in search. Its class name is literally Boolean Transform with a space, which is a little unusual for a ComfyUI class identifier - if you're scripting a workflow JSON by hand rather than building it in the UI, match the class name exactly as shown here.
    • Missing after install - like the rest of CRT-Nodes' logic utilities, this one has no optional dependencies, so if it's absent from the node list, look for an import failure elsewhere in the pack's console output rather than assuming this specific node is broken.
    CategoryCRT/Utils/Logic & Values

    Inputs (1)

    NameTypeDefaultDescription
    input_stringSTRING0.0

    Outputs (2)

    NameTypeDescription
    INTINT
    BOOLEANBOOLEAN