ComfyUI Node

0

Your prompt's off switch

By 2daadv·Created 6 months ago·Updated 21 days ago· 1
0
    • 0

    It's an integer that never changes. Zero. That's the whole node - no inputs, no settings, one INT output called 0 that always holds the number zero. Sounds like a joke until you've spent twenty minutes fighting a value that won't stay put. In ComfyUI, a hardwired constant is a commitment: it can't be nudged by a misclick, can't drift on control_after_generate, can't be silently overwritten by an upstream node. Sometimes the most useful thing a number can do is refuse to move.

    This is one of the constant nodes from 2daadv's utility pack, ComfyUI-GadgetNodes (search "GadgetNodes" in ComfyUI Manager, or git clone https://github.com/2daadv/ComfyUI-GadgetNodes into custom_nodes/, pip install -r requirements.txt, and restart - you'll find the whole family under the Gadget/core/const menu). It's a brand-new, one-developer, MIT-licensed pack with no track record yet, so there's nothing about it to be impressed or wary of other than the code itself - and the const nodes are dead simple under the hood: a subclass that returns a fixed value. No dependencies, no frontend tricks, works on the old canvas and Nodes 2.0 alike.

    Where you'll actually reach for zero, in order of how often I use it:

    • A seed of zero. Wire it into a KSampler's seed input (after converting the seed widget to an input) and every run is deterministic and obviously so. Zero is the conventional "lock the seed" sentinel people recognize at a glance.
    • Zeroing a step, a CFG, or a denoise. One seed value, five samplers - the classic one-source-fans-out trick from the plumbing layer. Set one sampler's steps to zero to effectively disable it without deleting the node.
    • As the false side of a toggle. When a boolean has to be a number (0/1 conventions in some nodes), zero is the off position, and a constant is the cleanest way to guarantee it stays off.

    The only real gotcha is the one that applies to every constant node: you'll fan it out to half a dozen inputs, then spend an hour wondering why they all changed - they didn't. The value is zero. That's the feature.

    Output it wires into anything expecting an INT: seeds, step counts, widths, indexes, sampler settings. If a node refuses a literal zero, the usual suspects are an optional input that reads unwired-as-None and treats zero as "no value" - that's a property of the receiving node, not this one.

    CategoryGadget/core/const

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    0INT