Nodes/ComfyUI Visual Dimension Selector/Dimension Selector πŸ“
ComfyUI Node

Dimension Selector πŸ“

Stop typing 1152x896 β€” click the rectangle instead

By GraftingRaymanΒ·Created 10 months agoΒ·Updated 10 months agoΒ· 1
Dimension Selector πŸ“
    • width
    • height
    • latent
    β—„width512β–Ί
    β—„height512β–Ί
    β—„batch_size1β–Ί

    If you've ever stared at an EmptyLatentImage widget trying to remember whether SDXL portrait is 896x1152 or 1152x896, this node is for you. Dimension Selector πŸ“ is a visual picker: it draws the aspect-ratio rectangle of your chosen preset right on the node canvas, labels it with the preset name and pixel dimensions, and lets you flip through 55 built-in resolutions with on-node arrows instead of typing numbers into a box. It's not magic - underneath it's a dressed-up EmptyLatentImage that also hands you width and height as separate INT outputs, and that extra part is what actually earns it a place in a workflow.

    Resolution is the silent killer of more gens than any bad prompt. Generate at a size the model wasn't trained on and you get stretched anatomy, doubled subjects, or a crop that chops the composition; SDXL's sweet spots are 1024x1024 plus a handful of trained aspect ratios around it. That's exactly the niche this node fills - the preset list is grouped into SD 1.5, SDXL, HD, social, cinema, phones, and print sizes, and there are filter buttons for square/portrait/landscape so you can zero in on the right shape fast. If you're forever toggling between aspect ratios while iterating, the rectangle preview beats memory every time.

    How it works

    The clever part lives almost entirely in the ~18 KB JavaScript frontend, not the Python. The backend file is around sixty lines. When you run it, it builds a zero-filled latent tensor torch.zeros([batch_size, 4, height // 8, width // 8]) - literally the same thing ComfyUI's built-in EmptyLatentImage does - and returns (width, height, latent). Every visible feature is canvas drawing in the JS: the scaled aspect rectangle, the preset name, the dimensions box, the arrow and filter buttons. Clicking a preset just writes its numbers into the width/height widgets; the backend blindly reads whatever's there.

    Inputs and outputs

    Three required inputs: width and height (INT, default 512, range 64–8192, stepped by 64) and batch_size (INT, default 1, up to 64). Three outputs: width, height, and latent. The latent plugs into KSampler's positive/negative exactly like EmptyLatentImage's, and the two INTs can drive a text node that echoes the size into your prompt or anything else that wants the numbers. The README's one quirk: if you wire INT values into the width/height inputs, they override whatever preset is showing on the canvas - handy when the dimensions should come from elsewhere (say an input image's real size) but you still want the visual on screen.

    Installing it

    ComfyUI Manager (search "ComfyUI Visual Dimension Selector"), or the manual way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GraftingRayman/ComfyUI-Dimension-Selector
    

    Restart ComfyUI (a full browser reload, since the frontend JS is the actual product). There's no requirements.txt, no model files, no weights - it's pure frontend plus a few lines of torch, so install is painless.

    Where people get burned

    • Non-multiple-of-8 presets. Several presets aren't divisible by 8 - print sizes like Letter at 2550x3300, or the iPhone presets at 1170x2532. The latent is floor-divided by 8 (height // 8), so the VAE decodes to a slightly smaller image than the label claims - 2544x3296 for that "Letter" preset, not 2550x3300. Harmless for most uses, genuinely confusing if you need exact output pixels.
    • The 4K, cinema, and print presets are aspirational, not beginner targets. Sampling a 3840x2160 latent is roughly 8x the compute of 1024x1024 - you need serious VRAM to denoise at that resolution natively. Those presets are for fixing your target aspect and letting hires-fix or upscaling do the heavy lifting, not because your GPU is about to render native 4K in one pass.
    • It's young and quiet. One node, one PR-less repo, zero community chatter. If a workflow you download references it, great; don't expect an ecosystem, tutorials, or quick fixes around it. If you already live inside another pack's dimension/conditioning nodes, this won't convert you - but as a standalone "pick a size, see the shape, get the latent" node it does its one job cleanly.
    Categorylatent

    Inputs (3)

    NameTypeDefaultDescription
    widthINT51264–8192β€”
    heightINT51264–8192β€”
    batch_sizeINT11–64β€”

    Outputs (3)

    NameTypeDescription
    widthINTβ€”
    heightINTβ€”
    latentLATENTβ€”