Nodes/Clh Tool for ComfyUI/INTConstant_clh
ComfyUI Node

INTConstant_clh

One number, wired to everything

By clhui·Created 2 years ago·Updated 11 months ago· 9
INTConstant_clh
    • value
    value0

    The most boring node in the pack, and boring is exactly the point. It holds a single integer that you set once and wire out to as many places as you like. That's it. When five nodes in your workflow all need to know the same number - a resolution, a step count, a batch size, a frame count - this gives you one place to change it instead of five.

    If you've used KJNodes or rgthree, you know this genre: the humble "constant" node. It doesn't compute anything or transform anything. It's a labeled dial you turn once, and it's the difference between a workflow you can retune in five seconds and one where you're hunting through the graph flipping the same value in a dozen widgets, missing two, and wondering why the output looks off.

    Why you'd bother

    Widgets on individual nodes are fine until the same number needs to be consistent across several of them. Say your width, your latent size, and an upscale target all derive from one base resolution. Type it into a KSampler here, a Empty Latent there, a math node over there, and now that number lives in three spots that can silently drift apart. Promote it to a single INTConstant clh, wire that one output everywhere, and there's exactly one source of truth. Change it once, the whole graph moves together. That's the entire value proposition, and it's a real one for anyone building workflows they actually reuse.

    The inputs and outputs that matter

    There's only one of each, which is the whole charm:

    • value (default 0) - the integer you're storing. The max is enormous (a full unsigned 64-bit ceiling), so you'll never hit a realistic upper bound; the min is 0, so this holds non-negative whole numbers.

    Output is value, an INT. Wire it into any socket that wants an integer - dimensions, seeds, step counts, batch sizes, frame counts. Fan it out to as many as you want; that's the intended use.

    Installing it

    ComfyUI Manager: search Clh Tool for ComfyUI, install, restart. Or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/clhui/ComfyUi-clh-Tool
    

    and restart ComfyUI. If a manual clone doesn't surface the node, the startup console names any missing dependency - Manager handles that install automatically, a bare clone doesn't. (A pure constant node like this is unlikely to need anything, though.)

    Common issues

    Honestly, there's very little to go wrong with a constant. The one real gotcha is integer-only: this holds whole numbers, minimum 0. If you need decimals (a CFG of 7.5, a denoise of 0.4) or negatives, this is the wrong node - you'd want a float constant instead. Feeding a float-shaped requirement from an INT source will either error or quietly truncate.

    The other thing isn't a bug so much as a habit: the payoff only lands if you actually route the constant everywhere that number is used. Half-adopting it - one node reads the constant, two others still have the value typed in locally - recreates the exact drift problem you installed it to kill. Commit to it. One number, one node, wired to everything. And if you want the string equivalent for prompts and text, its sibling StringConstant clh does the same job for text.

    CategorysimpleTool_clh/constants

    Inputs (1)

    NameTypeDefaultDescription
    valueINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    valueINT