Random Image Size YAML (watdafox)
Random image sizes with presets you can actually edit — no Python required
- LATENT
- width
- height
- NX_LATENT
- nx_width
- nx_height
- resolution_multiplier
- str_result_1x_resolution
- str_result_nx_resolution
Random Image Size YAML is the twin of this pack's Random Image Size Advanced - same two-latent setup, same random/fixed modes - except the resolution presets live in a plain text file you can edit, yaml/model_resolutions.yaml, instead of being burned into Python. If you have opinions about which aspect ratios your models actually like, this is the version you want.
Here's the concrete win. You generate with Flux or SDXL or some fine-tune with a very particular sweet spot, and you've discovered the built-in lists don't include your preferred sizes. With the hardcoded sibling you're out of luck unless you fork the repo. With this one, you open the YAML and add a group:
SDXL:
- "1024x1024"
- "1152x896"
- "896x1152"
MyFluxSetup:
- "800x1200"
- "1200x800"
Restart (or reload) and your new group shows up in the random_pick_state dropdown as a first-class random pool. That's a genuinely friendlier workflow than editing node source.
How it works
Everything mechanical is identical to the hardcoded version: random_pick_state of None uses your image_size dropdown pick; a preset key or All picks randomly from that group on each run. width_override/height_override force dimensions (0 = off), sizes round down to multiples of 64 when not overridden, and resolution_multiplier (default 1.5) produces the scaled NX_LATENT/nx_width/nx_height for your upscale pass. add_random_resolutions and override_random_resolutions let you extend or replace the random pool at runtime.
The YAML twist adds two things. One, the presets are loaded at import time, so edits need a ComfyUI restart to appear. Two, the node tries to be robust across machines: if a downloaded workflow's widget values don't match your local YAML (different preset keys), its validation hooks fire a "node widget calibration" event via the pack's web extension, attempting to re-sync the dropdown options. It's an educated guess at fixing a real, annoying problem - YAML drift between the machine that made a workflow and the machine running it.
The inputs and outputs
batch_size,random_pick_state,image_size,width_override,height_override,resolution_multiplier,add_random_resolutions,override_random_resolutions- as above.- Outputs
LATENT/width/height,NX_LATENT/nx_width/nx_height/resolution_multiplier, and the twostr_result_*_resolutionstrings for metadata.
Category: watdafox/latent.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/OhSeongHyeon/comfyui-watdafox-nodes.git
Restart ComfyUI (or ComfyUI Manager → "comfyui-watdafox-nodes"). No pip dependencies, no model downloads. The YAML ships with the pack at custom_nodes/comfyui-watdafox-nodes/yaml/model_resolutions.yaml.
Watch out
The autosync is best-effort, not magic - if it doesn't re-sync, refresh the browser or re-add the node. And remember sizes get floored to multiples of 64, so a 1000x1000 you add will actually run as 960x960. Also, the fallback if the YAML is missing or malformed is the hardcoded SDXL list, so a broken edit degrades to SDXL rather than crashing the node.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| batch_size | INT | 11–64 | — |
| random_pick_state | COMBO | 6 options: None, All, SDXL, Qwen, Flux, Flux2 | |
| image_size | COMBO | 75 options: SDXL 704x1408, SDXL 704x1344, SDXL 768x1344, SDXL 768x1280, SDXL 832x1216, SDXL 832x1152, +69 | |
| width_override | INT | 00–16384 | — |
| height_override | INT | 00–16384 | — |
| resolution_multiplier | FLOAT | 1.500.01–10 | — |
| add_random_resolutions | STRING | — | |
| override_random_resolutions | STRING | — | |
| str_result_1x_resolution | STRING | — | |
| str_result_nx_resolution | STRING | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| width | INT | — |
| height | INT | — |
| NX_LATENT | LATENT | — |
| nx_width | INT | — |
| nx_height | INT | — |
| resolution_multiplier | FLOAT | — |
| str_result_1x_resolution | STRING | — |
| str_result_nx_resolution | STRING | — |