Sum Wrap (Shinsplat)
A seed counter that wraps back to start instead of climbing forever
- txt_out
- int_out
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 youclear).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
stepdoesn't divide evenly intoceiling - 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" -
clearresets once; turn it back off or it will keep resetting every queue. txt_outvsint_out- same value, two types. Useint_outfor numeric inputs andtxt_outwhen a node expects text.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| start | INT | 0-18446744073709550000–18446744073709550000 | — |
| step | INT | 1-18446744073709550000–18446744073709550000 | — |
| ceiling | INT | 1-18446744073709550000–18446744073709550000 | — |
| wrap | INT | 1-18446744073709550000–18446744073709550000 | — |
| clear | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| txt_out | STRING | — |
| int_out | INT | — |