Nodes/ComfyUI-QING/布尔取反丨类型转换
ComfyUI Node

布尔取反丨类型转换

Flip any boolean — the NOT gate ComfyUI forgot to ship

By sheengoa·Created about a year ago·Updated 20 days ago· 16
布尔取反丨类型转换
    • 布尔
    booleanfalse

    You will hit this the first time a workflow only behaves correctly when a condition is false. Core ComfyUI gives you switches and routers galore, but no native NOT gate - so when your sampler's denoise should be off whenever some other node says "on," you either wire it backwards or reach for a node that does one thing. BoolInvert is that one thing. One boolean in, the opposite boolean out. That's the entire job, and it's a genuinely handy little brick once you're building condition-driven graphs.

    It belongs to ComfyUI-QING's "data tools" family (the whole pack ships 79 nodes under the QING/ category prefix - the display names are Chinese, so expect to see 布尔取反丨类型转换 in your node menu). If you're already used to the plumbing layer's way of doing things - value nodes, switches, *-typed routing - this slots right in. It's the same shape as the built-in PrimitiveBoolean, except instead of holding a value it transforms one.

    How it works. The mechanism is about as deep as it gets: it reads the boolean input (a BOOLEAN, default false) and returns not boolean. True becomes False, False becomes True. Nothing is stored, no state, no history - every run is a pure function of its input. Because it's deterministic, ComfyUI's executor caches it happily; it won't force downstream nodes to rerun.

    The inputs and outputs that matter. There's exactly one of each:

    • boolean - the value you want flipped. Type it in the widget or convert the widget to an input and wire another node's boolean into it.
    • The output, labeled 布尔 (BOOLEAN), is the inverse.

    That's the whole schema. What beginners miss is the wiring pattern: this node earns its keep downstream of a comparison, a HasValue, or any switch output, feeding a ConditionRouter or a switch's selector input. Invert once, and both branches of your graph get a coherent signal instead of one branch that means the opposite of what it looks like it means.

    How to install. ComfyUI-QING installs as one pack - you get all 79 nodes, not just this one. Through ComfyUI Manager, search "ComfyUI-QING" and install, or clone it manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GAO-SHIQING/ComfyUI-QING
    cd ComfyUI-QING
    python install_dependencies.py
    

    Restart ComfyUI afterward. Heads-up: the README's own git clone line has a typo (GAOSHI-QING, missing the H) - use the URL above or let Manager do it. If you're in China, python install_dependencies.py --mirror speeds up the pip step.

    Troubleshooting. The failure modes are vanishingly small because the node is trivial. Two things can still bite: leaving the input unconnected uses the widget default (false), so an un-wired BoolInvert silently outputs true - that's a logic bug in your graph, not a node bug. And the output port is named in Chinese (布尔), which trips people up the first time they stare at a wire expecting a familiar English label. If your downstream node is rejecting the socket type, check that you're reading the BOOLEAN output, not grabbing a neighboring port. That's about all there is to get wrong.

    CategoryQING/数据工具

    Inputs (1)

    NameTypeDefaultDescription
    booleanBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    布尔BOOLEAN