ComfyUI Node Runs on cloud

Ceil

DF_Ceil – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Ceil
    • INT
    Value1.00

    DF_Ceil rounds a float up to the nearest whole number and hands it back as an INT. That's the entire node - no settings to fiddle with, no modes. Straight from the pack's own description: 1.01 becomes 2. It's part of Derfuu_ComfyUI_ModdedNodes, a small math-and-utility pack from ComfyUI's early days (2023) that fills the gap between "I did some math and got a float" and "the node I want to plug this into needs a whole number."

    That gap is more common than it sounds. Most of this pack's math nodes - DF_Sum, DF_Divide, DF_Latent_Scale_by_ratio's ratio math, and so on - output FLOAT. Plenty of things downstream in ComfyUI want INT instead: width and height widgets, step counts, pixel offsets. If you compute a target size by multiplying a base width by some ratio, you'll get something like 917.4, and no image size widget is going to accept that directly. DF_Ceil is the bridge - round up, never down, so a scaled dimension never comes up short of what you actually asked for.

    Input and output

    One required input:

    • Value - the FLOAT you want rounded up

    One output:

    • INT - the ceiling of Value

    That's it. The reason you'd pick ceiling specifically over floor (see DF_Floor, its sibling in the same pack) comes down to which direction of error you'd rather have. If you're computing a canvas size or a buffer and rounding down could leave you one pixel short of covering everything, ceiling is the safe direction - you'll occasionally be a fraction over, never under.

    Where it fits

    This is a connective-tissue node, not something you add for its own sake. It shows up right after a math node that produced a float you now need as an integer - most often at the tail end of a scaling calculation, right before that number goes into something like an image resize or an EmptyLatentImage width/height. If your workflow doesn't do any custom math on dimensions, you probably won't need this at all; ComfyUI's built-in nodes already hand you integers where they expect integers.

    Installing

    The whole pack installs as one unit - you can't grab just this node on its own. Through ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
    

    then restart ComfyUI. It's pure Python logic, no models, no unusual dependencies - the install itself is fast and rarely the source of any trouble.

    Troubleshooting

    If DF_Ceil (or anything else from the pack) doesn't appear in the node search right after install, restart the server and hard-refresh your browser tab. That's the standard fix for a node loading successfully in the console logs but not showing up in the frontend menu - a generic ComfyUI quirk, not something specific to this pack.

    One thing worth flagging generally about this pack: its maintainer has a track record of removing deprecated nodes outright on updates rather than keeping a legacy version around, which has bitten people who built workflows around some of the pack's older nodes. The basic converter nodes - Ceil, Floor, Absolute value - have been stable fixtures of the pack for a long time and aren't the ones that have historically been pruned, but if you update the pack and something else in an old workflow throws a missing-node error, that maintenance habit is worth checking before you assume your ComfyUI install itself is broken.

    CategoryDerfuu_Nodes/Functions/Converters

    Inputs (1)

    NameTypeDefaultDescription
    ValueFLOAT1.00

    Outputs (1)

    NameTypeDescription
    INTINT