Dimensions
Randomize your resolution on every run from a simple list
- width
- height
If you test a lot, you end up wanting to try different image sizes without hand-editing an Empty Latent every run. Primitive Dimensions is a one-line answer: type a comma-separated list of resolutions, and each run it picks one at random and hands you the width and height as two INT outputs. Perfect for sweep testing or just keeping your outputs varied.
It's from ComfyUI Extended, the dependency-free utility pack, and it's one of the pack's small-but-satisfying primitives. The companion to the pack's Integer primitive, but tuned for one job: resolutions.
How it works
The single input, list, is a multiline STRING in a strict format:
832x1216, 1216x832, 1024x1024
Each entry is widthxheight, comma separated. The node validates the format against a regex (^\d+x\d+(\s*,\s*\d+x\d+)*$) - if it doesn't match, you get a validation message right on the node. On each execution it splits the list, picks a random entry, and returns it as the width and height INT outputs, ready to feed an Empty Latent or any size-aware node.
The random pick isn't cached: like the pack's other random nodes, IS_CHANGED returns NaN when the list has more than one entry, which forces a fresh pick on every queue run. So no, it's not a bug that it re-rolls each time - it's the point.
Install
cd /path/to/your/ComfyUI/custom_nodes
git clone https://github.com/rookiepsi/comfyui-extended.git
Restart ComfyUI and it's under comfyui-extended/primitive. Manager users: search "ComfyUI Extended" and install. Zero dependencies, zero downloads.
Common issues
- Validation rejects your input. The format is strict:
WxHentries separated by commas. Spaces around the comma are fine; a straypxor a missingxis not. The node tells you when it's unhappy. - Leaving it empty errors out. An empty string splits into nothing and the node can't unpack
widthxheightfrom it. Always keep at least one valid entry. - "Why did my size change?" Because it's random by design. If you need a specific resolution for one run, that's what the single-entry list is for - one entry, one answer, every time.
The honest take: it's a niche convenience, but for anyone doing batch resolution tests it kills the most tedious micro-task in the workflow. Feed its outputs into an Empty Latent and let the list be the only thing you edit.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| list | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |