Nodes/scorpiov-nodes/Scorpiov Width Height πŸ“
ComfyUI Node

Scorpiov Width Height πŸ“

A ratio picker that hands you an empty latent, not just two numbers

By scorpiovΒ·Created 3 months agoΒ·Updated 9 days agoΒ· 2
Scorpiov Width Height πŸ“
    • width
    • height
    • empty_latent
    β—„ratioCustomβ–Ί
    β—„width1024β–Ί
    β—„height1024β–Ί
    β—„upscale_factor1.0β–Ί
    β—„batch_size1β–Ί

    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 when ratio is "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, so 2.0 on 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 ratio to "Custom" before expecting typed dimensions to matter.
    • upscale_factor is 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.

    CategoryScorpiov/Image

    Inputs (5)

    NameTypeDefaultDescription
    ratioCOMBOCustom10 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
    widthINT102464–8192Used only when ratio is set to Custom
    heightINT102464–8192Used only when ratio is set to Custom
    upscale_factorFLOAT1.00.1–8Multiplies both width and height. e.g. 2.0 = double resolution
    batch_sizeINT11–64Number of images in the empty latent batch

    Outputs (3)

    NameTypeDescription
    widthINTβ€”
    heightINTβ€”
    empty_latentLATENTβ€”