Nodes/ComfyWarp/SchedulerInt
ComfyUI Node

SchedulerInt

The scheduler that counts in whole numbers

By Sxela·Created 3 years ago·Updated 2 months ago· 49
SchedulerInt
    • INT
    schedule
    frame_number0
    blend_jsontrue

    SchedulerInt is the integer sibling of SchedulerFloat, and honestly it fills a smaller niche. SchedulerFloat handles the continuous stuff - denoise, CFG, ControlNet strength - because those are all floats. SchedulerInt exists for the things that refuse to be fractions: seeds, sampler steps, batch sizes, frame counts, anything where a node's input only accepts a whole number.

    How it works

    Identical machinery to SchedulerFloat, from the same get_scheduled_arg function. Your schedule input is one of three formats - a single value (25), a list of consecutive values ([25, 30, 35, 40]), or a dict of keyframes ({0: 20, 60: 40}) - and the node returns the value for the current frame_number, interpolating between keyframes when blend_json is on.

    The one real difference: the result is cast to an int at the end. That has a consequence worth knowing. If you interpolate between {0: 20, 60: 40}, the blended value is a float like 26.33, and the int cast truncates it to 26. So a "smooth" ramp between integer keyframes actually steps, one whole number at a time, every few frames. If you want strict, predictable stepping, turn blend_json off - then between keyframes it holds the previous keyframe exactly and jumps at the next one.

    The inputs that matter

    • schedule (string, multiline) - your keyframe track in one of the three formats above.
    • frame_number (int) - the current frame. Drive it from the pack's FixedQueue current_frame output.
    • blend_json (bool, default true) - interpolation on or off. For integers, "interpolation" just means it counts up between keyframes instead of holding still.

    Output is a single INT, which plugs into any integer input: seed, steps, batch size, or the frame indices some video nodes expect.

    Installing it

    Same as the rest of the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Sxela/ComfyWarp
    

    Restart ComfyUI (or search "ComfyWarp" in Manager). No model downloads, just opencv-python and scikit-image behind the scenes.

    Where people get burned

    The usual suspect - frame_number left at its default of 0, so the schedule never advances - applies here too; wire in a frame counter or the node returns the same number forever. Beyond that, the truncation trap above is the one that confuses people: if your stepped seed schedule looks "wrong" between keyframes, that's the int cast doing its job, not a bug. When in doubt, write more keyframes so the jumps land where you want them. This is also the oldest, least-maintained corner of an already old pack, but the node itself is so simple - a parser and a cast - that it keeps working long after fancier nodes break on ComfyUI updates.

    CategoryWarpFusion

    Inputs (3)

    NameTypeDefaultDescription
    scheduleSTRING
    frame_numberINT00–9999999999
    blend_jsonBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    INTINT