Integer
An integer that increments, decrements, or randomizes itself between runs
- INT
The classic ComfyUI pain: you want to try steps 20, 30, 40... and you sit there editing a widget by hand between every run. Primitive Integer from ComfyUI Extended automates the boring part. Set a value, a step, and a method - increment, decrement, randomize, even previous - and the node changes its own value between queue runs. It's a seed-cycler for any integer, not just seeds.
This is the pack's most genuinely clever node, because it works in two places: the Python side picks the value and decides when to force a re-run, and the frontend (web/primitive.js) actually updates the widget you're looking at. The result feels like magic - the number visibly changes on the node between runs.
Inputs that matter
value(INT) - the starting number.step(INT) - how much increment/decrement moves each run.min/max(INT) - the clamp range. Increment stops atmax, decrement atmin.method-fixed(outputvalueas-is),increment,decrement,randomize(picks a random value on the step grid inside the range), orprevious(hand back the last value used).
Output is a single INT.
How it works
The Python side sends state over a websocket (comfyui-extended_primitive), the frontend clamps and steps the widget. randomize also returns NaN from IS_CHANGED, which forces ComfyUI to consider the node changed on every queue run - so a randomized value genuinely re-rolls each time rather than being cached. That's the same trick the pack's Expression and Dimensions nodes use for randomness, and it's the detail that makes this node actually work instead of just looking like it should.
Install
cd /path/to/your/ComfyUI/custom_nodes
git clone https://github.com/rookiepsi/comfyui-extended.git
Restart, and it's under comfyui-extended/primitive. Or ComfyUI Manager → search "ComfyUI Extended" → install → restart. The pack has no dependencies and downloads nothing.
Common issues
randomizeforces a re-run every time. That's by design - it can't roll a new value if ComfyUI caches the old result. Don't put this node in a spot where you need a stable value between runs.- Value won't go past the clamp. Increment/decrement respect
min/maxhard. If your number seems stuck, your range is the culprit. previouswith a cold start. The first run has no prior value cached, so it falls back tovalue; subsequent runs hand back whatever was used last.
Where it shines: step-count sweeps, seed exploration, batch counts. Where it's a trap: anywhere you need determinism. Know which side you're on and this node is a small superpower.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| value | INT | 0-1000000000000000–1000000000000000 | — |
| step | INT | 1-1000000000000000–1000000000000000 | — |
| min | INT | 0-1000000000000000–1000000000000000 | — |
| max | INT | 1000000000000000-1000000000000000–1000000000000000 | — |
| method | COMBO | fixed | 5 options: fixed, increment, decrement, randomize, previous |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |