ComfyUI Node

Round Up

Ceil, as a node — for when 'close enough' isn't a dimension you can cut

By mikemojen·Created 8 months ago·Updated 3 months ago· 0
Round Up
    • integer
    value0.00

    Round Up is math.ceil wearing a ComfyUI hat: a FLOAT in called value, an INT out called integer, and nothing else. Any fraction gets bumped to the next whole number. It's the "never cut short" node - the one you reach for when the alternative is a dimension that's 0.4 units too small, and you'd rather have a hair extra than a hair short.

    Why ceil, specifically

    math.ceil(3.1) is 4. And because ceil moves toward positive infinity, it's symmetric with the pack's Round Down node on the other side: ceil(-3.1) is -3, not -4. If your values can go negative (coordinates, deltas), remember which node you grabbed - they're not interchangeable, and neither is "round to nearest." In dimension and material math, ceil is the safe direction: if you need material for a 3.1-unit feature, buying/cutting for 4 units beats discovering you're short.

    Where it fits

    The same slots as Round Down, in the other direction: computed sizes you can't afford to round down, batch counts that must cover everything (ceil is how you get "one more tile to finish the row"), and pixel dimensions for crop/resize nodes that want integers. In this pack's context, it's the natural companion to the SVG measurement nodes - take SVGDimensions' float width, ceil it, and you have the exact integer canvas you need. There's no precision loss trap here: it just moves up.

    Install

    Part of ComfyUI-HappNodeSet (mikemojen). ComfyUI Manager: search HappNodeSet. Manual:

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

    Restart ComfyUI. Pure Python (math.ceil), zero extra dependencies.

    Honest take

    Both rounding nodes in this pack are the same one-liner in a box, and neither will change your life - but they're the kind of thing you stop noticing you have until you switch to a workflow without them and hit a "expected INT, got FLOAT" error. If the pack is installed for the measurement tools anyway, consider these the free utilities riding along. The only decision that matters is floor vs. ceil on negatives, and that's a decision you make, not a bug you'll hit.

    Categorymath

    Inputs (1)

    NameTypeDefaultDescription
    valueFLOAT0.00-10000000000–10000000000

    Outputs (1)

    NameTypeDescription
    integerINT