Nodes/KJNodes for ComfyUI/Float Constant
ComfyUI Node Runs on cloud

Float Constant

One number, wired everywhere, changed in one place

By kijai·Created 3 years ago·Updated about 18 hours ago· 2,930
Float Constant
    • value
    value0.0000

    This node outputs a floating-point number. You type a value, it hands that value to whatever you connect it to. That's genuinely the whole thing - and yes, it's worth having.

    The reason isn't complexity, it's discipline. In a big workflow you often use the same number in several places: a denoise strength that also feeds a scheduler, a scale that three different nodes need to agree on. If you type that number into each widget by hand, you now have three copies to keep in sync, and eventually you'll change two and forget the third. FloatConstant makes it one source of truth - wire it out to all three, and changing the value once changes it everywhere. It's the graph equivalent of not hardcoding a magic number in five files.

    How it works

    There's no mechanism to explain - it's a constant. Whatever float you enter comes straight out the other side. The value is precise: the widget steps in tiny increments and accepts a huge range, so it handles anything from a 0.001 strength tweak to a large scale factor without rounding you off.

    It lives in the KJNodes/constants category alongside the pack's other little "just emit a value" nodes. Kijai's KJNodes is full of these unglamorous building blocks - the stuff that doesn't generate anything but makes a complicated graph tidy and maintainable.

    The inputs and outputs that matter

    • value (FLOAT, default 0) - the number you want. Wide range, fine-grained step. Type it here.

    Output is value (FLOAT) - the same number, ready to fan out to every input that needs it.

    There's nothing else to it. Connect the output to any FLOAT input.

    How to install it

    ComfyUI Manager: search KJNodes for ComfyUI, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-KJNodes
    pip install -r ComfyUI-KJNodes/requirements.txt
    

    Restart and it's under KJNodes/constants. No models, no dependencies of note.

    Common issues & troubleshooting

    "The target input won't accept the connection." It needs to be a FLOAT input. Some widgets are typed as INT (frame counts, step counts, seeds) and won't take a float directly. For those, use the pack's integer constant instead, or a convert node - a fractional value going into an INT slot is a type mismatch, not a rounding.

    "Why not just type the number into the node?" For a one-off, do exactly that - a constant node for a value used once is clutter. The payoff is only when the same number feeds several places, or when you want one obvious labeled knob at the top of a messy graph to tune. That's when this earns its spot.

    Precision surprises. Floats can't represent every decimal exactly, so a value might read back as 0.30000001. That's normal floating-point behavior, not a bug in the node, and it won't matter for any generation parameter.

    CategoryKJNodes/constants

    Inputs (1)

    NameTypeDefaultDescription
    valueFLOAT0.0000-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    valueFLOAT