ComfyUI Node

Int Split

Split one integer budget into two parts — by percentage or by exact cut point

By 1hew·Created about a year ago·Updated 7 days ago· 33
Int Split
    • int_total
    • int_split
    total20
    split_point0.50

    If you've ever found yourself wiring three math nodes together just to answer "how do I split my 100 frames into 60 and 40?", this is the node that was born for that. It takes one total integer, splits it at a point, and hands you both pieces - the total and the split - as two clean INT outputs.

    The idea is a small but real one in ComfyUI: lots of loops and pipelines want a budget divided into two passes. Split a video into an "establishing" chunk and a "rest" chunk. Split a step count into a first sampler run and a second. Split a batch into a test group and the remainder. Doing that with stock math nodes is exactly the kind of fiddly busywork this pack exists to remove.

    How it works

    Two inputs:

    • total - the number you're splitting (default 20, range 1–10000).
    • split_point - how to cut it. The clever bit is that it's dual-mode. If split_point is between 0 and 1, it's treated as a fraction: 0.5 of 20 gives 10, 0.25 gives 5. If it's greater than 1, it's treated as an absolute cut point: split_point = 7 gives you 7, regardless of the total. So the same knob does both percentage and count depending on what you type.

    Outputs are int_total (the original total, passed through so you don't need a separate passthrough wire) and int_split (the computed first part). Edge cases are handled sensibly: split_point = 1.0 gives a split of 1, not the whole total; an out-of-range absolute cut clamps to the total; and the split never goes negative.

    So total=100, split_point=0.6int_total=100, int_split=60. Feed int_split to your first loop, and int_total - int_split to the second (or use another split node with a complementary point).

    Installing it

    It's part of 1hewNodes. ComfyUI Manager → search "ComfyUI 1hewNodes" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/1hew/ComfyUI-1hewNodes
    

    Restart ComfyUI. No special dependencies, no model downloads.

    Common issues

    The one confusion point is the dual-mode split_point, and it's worth internalizing: anything ≤ 1 is a percentage, anything > 1 is an absolute count. Type 2 expecting "half" and you'll get a split of 2, which is a great way to confuse yourself later. Also remember the outputs are the two pieces of a budget, not a range - if you were hoping for "give me frames 40–60," this isn't a slicing node, that's what the pack's batch range nodes are for. For splitting one integer into two, though, it's the node you'll reach for every time.

    Category1hewNodes/int

    Inputs (2)

    NameTypeDefaultDescription
    totalINT201–10000
    split_pointFLOAT0.500–10000

    Outputs (2)

    NameTypeDescription
    int_totalINT
    int_splitINT