Nodes/ComfyUI GOAT Nodes/🐐 Capped Float (Positive)
ComfyUI Node

🐐 Capped Float (Positive)

The float version of Capped Int, same 0-means-uncapped rule

By AconexOfficialΒ·Created 2 years agoΒ·Updated 12 months agoΒ· 11
🐐 Capped Float (Positive)
    • FLOAT
    β—„float0.00β–Ί
    β—„cap1.00β–Ί

    Same idea as its sibling Capped Int (Positive), just for float values: clamp a number to a ceiling in one node instead of chaining a math node with a min operation. If you've got a strength, weight, or scale value coming from somewhere upstream that you need to guarantee never exceeds a certain number - say, a LoRA weight a workflow shouldn't be allowed to push past 1.5 - this is the one-node way to enforce it.

    How it works

    Two inputs, float and cap, one output: whichever is smaller. Same footgun as the int version, and worth knowing before you rely on it: a cap of 0 means uncapped, not "clamp to zero." It's the same sentinel-value design across both Capped nodes in the pack, which at least means once you've learned the rule on one, it applies to the other without surprises.

    Notice the min/max ranges on both inputs go up to roughly 1.1 quadrillion (1125899906842624, which is 2^50) rather than a tidy round number - that's a technical ceiling from how the node's underlying number widget is configured, not a meaningful design choice you need to think about. In practice you'll be using this for values in a much more ordinary range: weights, strengths, scale factors typically under 10.

    Inputs and outputs that matter

    • float (0 to ~1.1 quadrillion, default 0) - the value you're clamping.
    • cap (same range, default 1) - the ceiling. 0 = uncapped.

    One output: FLOAT - float, or cap, whichever is lower (unless cap is 0, in which case float passes through unchanged).

    How to install it

    ComfyUI Manager: search "GOAT Nodes", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AconexOfficial/ComfyUI_GOAT_Nodes.git
    

    then restart ComfyUI. Nothing else to it - no dependencies, no models.

    Common issues & troubleshooting

    Setting cap to 0 doesn't zero the value. As with Capped Int, this is intentional behavior, not a bug - 0 is the pack's "no limit" sentinel for both capped nodes. If you actually need to zero a value conditionally, reach for a comparison or switch node instead; this one is purpose-built for "never exceed X," not "force to zero."

    Values look identical to input no matter what you set cap to. Double-check you didn't leave cap at 0 by accident, since the default on Capped Int is 10 but this node's default cap is 1 - easy to mix up if you're used to the int version's default and assume the float version matches.

    Precision at the extreme end of the range. You're very unlikely to ever approach the ~1.1 quadrillion ceiling in a real workflow, but if you're doing something unusual with very large float values, be aware that floating-point precision degrades at that scale - this node's range ceiling is a widget limit, not a guarantee of exact precision up to it.

    Category🐐 GOAT Nodes/Math

    Inputs (2)

    NameTypeDefaultDescription
    floatFLOAT0.000–1125899906842624β€”
    capFLOAT1.000–1125899906842624β€”

    Outputs (1)

    NameTypeDescription
    FLOATFLOATβ€”