Nodes/ComfyUI Level Pixel/Convert Int To Bool [LP]
ComfyUI Node

Convert Int To Bool [LP]

Convert Int To Bool [LP] — ComfyUI Node Guide

By LevelPixel·Created 2 years ago·Updated 5 months ago· 31
Convert Int To Bool [LP]
    • BOOLEAN
    int0

    One of those nodes you don't think about until you need it, and then you're glad it exists instead of having to fake it with a comparison node. Takes an integer, hands back a boolean, following the convention basically every language and library uses: zero is false, anything else is true.

    What it's for

    ComfyUI's type system is strict about sockets - an INT output won't wire directly into a BOOLEAN input, even when the value obviously means one thing or the other. That strictness is generally good (it catches real mistakes), but it means the moment your workflow has an integer somewhere that's really functioning as a flag - a counter that's either zero or not, a value coming out of a node that only speaks INT when what you actually need downstream is a Switch or a conditional gate - you need an explicit bridge. This is that bridge.

    It's part of a bigger conversion family this pack ships: the README lists a full set including StringToFloat, StringToInt, StringToBool, StringToNumber, StringToCombo, IntToString, FloatToString, BoolToString, FloatToInt, IntToFloat, IntToBool, and BoolToInt - LevelPixel's own framing is that it covers a wider range of type conversions than most other packs bother with. This one and Convert Int To Float are the two from that set covered here.

    Inputs and outputs

    • int (INT, default 0) - the value to convert. The range is effectively unbounded on both ends (the schema's min/max sit at roughly ±1.8×10¹⁹, which is just ComfyUI's standard "no real limit" INT range, not a meaningful constraint you'd hit in practice).

    Output: BOOLEAN - false when the input is exactly 0, true for anything else, positive or negative.

    Installing it

    ComfyUI Manager: search "ComfyUI-LevelPixel" (listed as "Level Pixel"), install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/LevelPixel/ComfyUI-LevelPixel.git, restart ComfyUI. Nothing to download - this is as lightweight as a node gets, pure type conversion with zero dependencies.

    Common issues

    There's not much to trip over with a node this small, but the one thing worth double-checking is your assumption about negative numbers: if your workflow treats "any nonzero value" as true, this behaves exactly as expected for negatives too (-1 converts to true, same as 1). If you actually wanted "positive numbers only count as true," this node won't give you that distinction on its own - you'd need a comparison node ahead of it to first turn negatives into 0 before converting.

    Beyond that, the usual type-socket gotcha applies: this only accepts INT, so if you're holding a FLOAT somewhere upstream, you'll need Convert Int To Float's counterpart the other direction, or ComfyUI's own float-to-int conversion, before this node will accept the wire.

    CategoryLevelPixel/Conversion

    Inputs (1)

    NameTypeDefaultDescription
    intINT0-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN