Nodes/ComfyUI-Shinsplat/Sum Wrap (Shinsplat)
ComfyUI Node

Sum Wrap (Shinsplat)

A seed counter that wraps back to start instead of climbing forever

By Shinsplat·Created 2 years ago·Updated about a year ago· 47
Sum Wrap (Shinsplat)
    • txt_out
    • int_out
    start0
    step1
    ceiling1
    wrap1
    clearfalse

    When you're running a batch of generations you usually want a counter that steps each time and then returns to a baseline once it hits a target - not one that counts to infinity. That's Sum Wrap: an incrementor with a start, a step, a ceiling, and a wrap point. The README's description is refreshingly honest - "if you do your math wrong it will overshoot, that's up to you" - so think of it as a dumb, predictable counter you drive, not a smart node that babysits you.

    How it works

    The node keeps an internal running value across runs. On the first run it outputs start; every run after that it adds step. When the running value equals ceiling, instead of continuing it jumps to wrap. Two outputs carry the value: int_out for wiring into a seed or steps input, and txt_out - the same number as a string - for when you want to display it or feed a text-formatting node. Negative steps and negative start values work fine; there's no clamping, so a step that jumps past the ceiling just keeps going (that's the "overshoot" the author warns about).

    clear (default false) resets the stored state back to start. The author's flow for batches: start at your base seed, set the ceiling to your batch size, set wrap back to the base, and each generation gets a fresh, predictable seed while the counter rolls over instead of ballooning.

    The inputs and outputs

    • start - where the counter begins (and where it returns if you clear).
    • step - added each run; negatives count down.
    • ceiling - the target that triggers the wrap.
    • wrap - the value the counter jumps to after hitting the ceiling.
    • clear - reset the stored state.

    Outputs: txt_out (STRING) and int_out (INT).

    How to install it

    Part of ComfyUI-Shinsplat:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Shinsplat/ComfyUI-Shinsplat
    

    or ComfyUI Manager → "ComfyUI-Shinsplat" → restart. No extra deps.

    Common issues

    • "It skips my numbers" - if step doesn't divide evenly into ceiling - start, the counter never lands exactly on the ceiling and never wraps. Do the arithmetic before wiring it up, per the README.
    • "It kept counting after I cleared" - clear resets once; turn it back off or it will keep resetting every queue.
    • txt_out vs int_out - same value, two types. Use int_out for numeric inputs and txt_out when a node expects text.
    Categoryadvanced/Shinsplat

    Inputs (5)

    NameTypeDefaultDescription
    startINT0-18446744073709550000–18446744073709550000
    stepINT1-18446744073709550000–18446744073709550000
    ceilingINT1-18446744073709550000–18446744073709550000
    wrapINT1-18446744073709550000–18446744073709550000
    clearBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    txt_outSTRING
    int_outINT