Scorpiov Width Height π
A ratio picker that hands you an empty latent, not just two numbers
- width
- height
- empty_latent
Every SDXL-and-up workflow starts with the same two decisions: what resolution, and what aspect ratio. ComfyUI's built-in Empty Latent Image has you type width and height by hand, which is fine until you find yourself re-entering 1216Γ832 for the tenth time and wondering why nobody made this a dropdown. Scorpiov Width Height is that dropdown - a small node that turns a preset ratio list into both the dimensions and a ready-to-sample empty latent, in one shot.
The schema is small and the defaults are sane:
ratio- a preset dropdown with sensible options: Square, Landscape, Portrait, Story (both orientations), Widescreen, Phone Video, Panorama, Smartphone. Select one and width/height follow.width/height- only used whenratiois "Custom". (The tooltip is explicit about that, so don't be confused when typing dimensions doesn't do anything while a preset is selected.)upscale_factor- multiplies both dimensions, so2.0on a 1024Γ1024 preset gives you 2048Γ2048. A clean way to do a "double resolution" pass without touching the base ratio.batch_size- how many latents in the batch, wired straight into the empty latent.
Outputs: width (INT) and height (INT) if some other node needs the numbers, plus empty_latent - a fully-formed LATENT you can wire straight into a KSampler's latent input, or a latent Upscale/VAE-encode node. That's the part ComfyUI's own node doesn't give you as a side output: the dimensions and the latent, from one control.
The custom-ratio trick
The preset list isn't hardcoded in the node - it's read from a ratios.txt file in the pack folder. Add your own at the bottom and they appear in the dropdown after a refresh:
My Custom Ratio (2:1) | 2048 | 1024
Lines starting with # are comments and "Custom" is always prepended automatically. For anyone working at non-standard resolutions (SDXL-custom, specific video ratios, a personal canvas), that's a genuinely nice touch - you edit a text file, not the node's code, to add your house ratios.
How it works
Under the hood it reads ratios.txt into a cached list (re-reads only when the cache is empty), computes width/height from your selection, applies the upscale factor, and builds the empty latent with torch.zeros at the right batch size. Nothing clever, which is the point - it's a convenience node, and it does the one thing cleanly.
Gotchas
- Width/height inputs are ignored while a preset ratio is selected - set
ratioto "Custom" before expecting typed dimensions to matter. upscale_factoris a multiplier on top of the ratio, so remember it stacks: a 2.0 factor on the Panorama preset is a very wide canvas. Check the numbers before you commit VRAM.- It's a Scorpiov-pack node, so if you only want the ratio dropdown without the rest of the pack, the install cost is the same either way - you get all ten nodes.
Installing
Ships in scorpiov-nodes. Install via ComfyUI Manager (search "scorpiov-nodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/vikramudyawar/scorpiov-nodes
Restart ComfyUI after. No extra Python dependencies, no models. Honest take: this one is a nicety, not a necessity - ComfyUI's Empty Latent Image does the job. But if you juggle several aspect ratios per project and want them one click away (plus the custom ratios.txt list to encode your own), it's a comfortable quality-of-life upgrade, and the empty_latent output means you replace a whole node chain with one pick.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| ratio | COMBO | Custom | 10 options: Custom, 1024 x 1024 (1:1) Square, 1152 x 896 (9:7) Landscape, 896 x 1152 (7:9) Portrait, 1216 x 832 (19:13) Story, 832 x 1216 (13:19) Story, +4 |
| width | INT | 102464β8192 | Used only when ratio is set to Custom |
| height | INT | 102464β8192 | Used only when ratio is set to Custom |
| upscale_factor | FLOAT | 1.00.1β8 | Multiplies both width and height. e.g. 2.0 = double resolution |
| batch_size | INT | 11β64 | Number of images in the empty latent batch |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| width | INT | β |
| height | INT | β |
| empty_latent | LATENT | β |