Nodes/DARASK Nodes/DARASK Float → Int
ComfyUI Node

DARASK Float → Int

The 15-second fix when a node demands an integer

By daraskme·Created 4 months ago·Updated 3 months ago· 1
DARASK Float → Int
    • INT
    value0.00
    moderound

    Somewhere in every video workflow there's a mismatch: you've got a float (frame rate, seconds) and some node wants an integer. In LTX Video templates the classic example is feeding an FPS float into LTXVEmptyLatentAudio.frame_rate, which wants an INT. Stock advice says install ComfyMath and grab its CM_FloatToInt. The DARASK Float → Int is that exact node, reimplemented in a few lines so you don't have to drag in an entire math pack for one cast. It does precisely one thing and does it with no ceremony.

    How it works

    It's a FLOAT in, an INT out, with one choice to make: mode - round, floor, ceil, or trunc, defaulting to round. That's the entire node. Round gives you the nearest integer (24.7 → 25), floor and ceil do what their names promise for when you want to be conservative or generous, and trunc just chops the decimal. The value input is a widget by default but can be converted to an input socket if you want to wire a computed FLOAT into it.

    Output: a single INT. That's all. It won't surprise you.

    When to reach for it

    Honestly, less than you'd think - and the pack itself makes that point. The DARASK LTX 2.3 Video Settings node has an fps_int output that does int(round(fps)) internally, so any new LTX workflow built with that node never needs this one. DARASK Float → Int is positioned as the migration tool: you've got an existing ComfyMath-based workflow, you're switching packs, and you want to swap CM_FloatToInt for something that doesn't drag in the whole ComfyMath dependency. Drop it in, rewire, move on.

    Install

    Same pack, same drill: ComfyUI Manager → search DARASK → install, restart. Zero models, zero extra pip packages. It's one of the two or three nodes you could install this pack for alone and call it a day.

    Honest notes

    There's no seed, no batching, no "round to nearest multiple of 8" - if you need to snap a value to a grid (and for LTX frame counts you genuinely might, since 2.3 wants frame counts divisible by 8 plus 1), that's still on you to do upstream. Rounding a 24.6 to 25 when you needed a multiple of 8 is exactly the kind of off-by-one that produces a "generation fails silently" afternoon. When in doubt, round first, then verify against the grid constraint.

    CategoryDARASK

    Inputs (2)

    NameTypeDefaultDescription
    valueFLOAT0.00-1000000000000000000–1000000000000000000
    modeoptCOMBOround4 options: round, floor, ceil, trunc

    Outputs (1)

    NameTypeDescription
    INTINT