Random Integer Generator Using List
The list-based twin of the random-divisor node
- INT
This pack actually ships two nodes that do the same job from the outside: give them a range and a divisor, get back a random integer that's a clean multiple of that divisor. This one is the "Using List" version - same three inputs, same single output, same idea. If you just want the short version: pick either one, they behave identically from where you're sitting on the graph. The interesting bit is why there are two at all.
What it's for
Diffusion models care about round numbers - the VAE downscales by 8x, and a lot of workflows (Flux is the strict example) want width and height divisible by 64 specifically, not just any number. A plain "random integer" node can hand you a value that breaks that rule and either errors out or gets silently cropped. This node closes that gap: you get randomness, but constrained to values that are actually safe to use.
How it works
Set min_value and max_value for the range, and divisor for the multiple the result has to land on. The node picks a random integer and returns the nearest multiple of your divisor, as a single INT. Per the README, it re-rolls with every generation, so you get fresh values run to run without needing to touch ComfyUI's own randomize-seed control. Where this node differs from its sibling RandomIntegerNodeEfficient is presumably under the hood - the display name ("Using List") suggests it builds out the list of valid multiples in your range first and samples from that list, rather than computing the nearest multiple directly. The README doesn't spell out the mechanics, so treat that as an educated guess rather than documented behavior - either way, the output is a valid random multiple of your divisor, which is the only contract you actually need to rely on.
The inputs and outputs that matter
- min_value (
INT, default 0) - low end of the range. - max_value (
INT, default 100) - high end of the range. - divisor (
INT, default 1) - the multiple the output snaps to. Use 8 or 64 for image dimensions; leave at 1 for a plain random integer with no rounding.
Output is INT - wire it into a width, height, batch count, or any other integer field downstream.
Installing it
Same pack, same steps as the rest of it:
- ComfyUI Manager: search "ComfyUI-Random-Int-Divisor-Node", install, restart.
- Manual:
Restart ComfyUI after cloning - a browser refresh alone won't pick up a newly added custom node.cd ComfyUI/custom_nodes git clone https://github.com/Jaminanim/ComfyUI-Random-Int-Divisor-Node
No extra Python packages beyond ComfyUI's own, and nothing to download - it's a lightweight, self-contained utility pack with no model dependency.
Common issues
The README is a single paragraph, so there's no documented gotcha list - what trips people up here is mostly the math, not the code:
- Divisor of 0 doesn't have a "nearest multiple" - keep it at 1 or above.
- A tight range with a big divisor (e.g. min 10, max 20, divisor 64) may not contain any valid multiple at all. Widen the range or lower the divisor so the math has room to work.
- If you can't find it in Manager search, it's a small pack and may not be as consistently indexed as the bigger ones - the manual git clone into
custom_nodesis the reliable path. - Picking between this and
RandomIntegerNodeEfficient: functionally you won't notice a difference. If you ever do hit a discrepancy between the two on the same inputs, that's worth reporting upstream since the pack doesn't document one - but for everyday use, either node gets you the same thing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| min_value | INT | 0 | — |
| max_value | INT | 100 | — |
| divisor | INT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |