Random Resolution Selector
Randomize image size by seed — deterministically
- width
- height
Resolution is usually the one thing you don't want to randomize - but for testing and grids, having size vary across a batch is exactly the point. HYBS_RandomResolutionSelector picks a resolution from the pack's config file based on a seed: index = seed % number_of_combos. Same seed, same config, same size. That determinism is the whole trick - you get "random" sizes across seeds without losing reproducibility, which is why this node pairs naturally with the pack's Seed List Generator for resolution-sweep batches.
Where the plain Resolution Selector is a manual dropdown, this is the automated cousin. It's for workflows that iterate over a batch and should visit different sizes: composition testing across aspect ratios, training-data-ish sampling, or stress-testing "does my model still hold up at portrait vs. landscape."
How it works
The mechanism is tiny and it's right in the tooltips:
- seed (
INT, default 0, non-negative) - fed throughseed % len(combos)to index the list of combos
Outputs are the usual pair:
- width (
INT) - height (
INT)
Both the Random and plain selectors read the same config/resolution_combos.json (with the same built-in default list if the file is missing), but the Random one has two behaviors that matter:
- It reloads the JSON on every execution. Edit the file mid-session and the next run picks up the change - no restart.
- Its execution fingerprint includes the config file's modification time. So editing
resolution_combos.jsonforces the node to re-run even if the seed hasn't changed, instead of ComfyUI treating it as cached.
The other consequence of seed % len(combos): adding or removing combos reshuffles which seed maps to which resolution. If you've tuned a specific seed to a specific size, don't edit the config underneath it.
Installation
Standard pack install:
cd path/to/ComfyUI/custom_nodes
git clone https://github.com/hybskgks28275/ComfyUI-hybs-nodes.git
pip install -r ComfyUI-hybs-nodes/requirements.txt
Or "ComfyUI-hybs-nodes" via ComfyUI Manager, then restart. No models, no extra deps.
One honest limitation before you build a whole thing on it: because it's modular-arithmetic "random," the sizes are uniformly picked from the config but in a fully predictable order as seeds climb. That's a feature for reproducibility and a mild letdown if you expected true shuffling - consecutive seeds walk the list in order, they don't hop. For a batch where each image gets a different seed, you'll still see a spread of sizes, which is the point. And as with any size variation, remember the KB's warning: don't push far past the model's native training resolution, or you'll get tiling and duplicated anatomy instead of variety.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 0 | Deterministic pick: index = seed % len(combos). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | Width of the selected resolution. |
| height | INT | Height of the selected resolution. |