ComfyUI Node

LC Int Split

Turn one step count into two samplers that always add up

By lonecatone23·Created about a month ago·Updated about 20 hours ago· 12
LC Int Split
    • a
    • b
    • total
    total20
    split_point0.50

    LC Int Split does one arithmetic thing and does it so you never have to think about it again: it takes a single total and splits it into two parts, a and b, where a + b is always exactly total. You control the split with a fraction, not a number.

    Here's the setup that makes it worth having. A two-stage generation - first pass at low denoise, second pass refining - wants one step budget carved into two sampler runs. Or you've got a dual-model workflow (the LC123 pack is full of them: LC Sampler Configure with its cfg_1/cfg_2 dual-pass, LC Split Sigma Scheduler) where sampler one does part of the steps and sampler two does the rest. Rather than typing 12 into one sampler and hoping you remember the other is 8 of 20, you keep one source of truth - the total - and let this node derive both halves. Change 20 to 24 and both samplers follow.

    The two inputs are exactly what the tooltip says:

    • total (INT, default 20) - the whole value to split. The author's own description: "steps, frames, pixels, …" Anything integer that needs dividing into two parts.
    • split_point (FLOAT, 0–1, default 0.5) - the fraction of total that goes into a. 0 puts everything in b, 1 puts everything in a, 0.5 is half and half.

    Mechanically it's a = round(total × split_point), then b = total − a. No drift, no remainder loss - the two outputs always reconcile back to the total. There are three outputs: a, b, and total passed through untouched, the last one so you can fan the original value off to other math without an extra wire.

    The trap, and it's a real one: split_point is a fraction, and it's hard-clamped to 0–1. Type 10 because you're on total 20 and want 10 each - the node clamps to 1.0, which means a = 20 and b = 0. Everything goes to the first sampler and the second gets nothing. If you want an exact absolute split ("first 12 of 30"), you have to enter the fraction: 12/30 ≈ 0.4. That's the price of the "always adds up" guarantee, and it's why the author put "Fraction of total" right in the tooltip. Keep it in 0–1 and this node is boring in the best way - set total once, drag split_point, and the halves stay in sync.

    Where it slots in: convert the step widget on two samplers to an input (right-click → Convert to input), wire a and b to them, and drive the whole thing from one total. It also feeds LC Dimension Resize, batch sizes, or frame counts for video loops. It's category LC123/utils, pure Python, no model files involved.

    Install is the standard LC123 pack routine: ComfyUI Manager → search "LC123" (repo ComfyUI_LC123_nodes), or cd ComfyUI/custom_nodes && git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes, then restart ComfyUI. No extra pip packages - just ComfyUI's own Python env. Mind the nested-folder gotcha if you unzip a release over an existing clone (__init__.py must sit directly in ComfyUI_LC123_nodes/), and on hosted/cloud ComfyUI the pack generally has to be installed by the platform first.

    CategoryLC123/utils

    Inputs (2)

    NameTypeDefaultDescription
    totalINT200–2147483647Whole value to split (steps, frames, pixels, …).
    split_pointFLOAT0.500–1Fraction of total. 0 = all in b, 1 = all in a, 0.5 = half.

    Outputs (3)

    NameTypeDescription
    aINT
    bINT
    totalINT