Nodes/ComfyMath/SDXLExtendedResolution
ComfyUI Node

SDXLExtendedResolution

Pick a good SDXL size from a dropdown

By evanspearman·Created 3 years ago·Updated about a year ago· 192
SDXLExtendedResolution
    • width
    • height
    resolution

    SDXL doesn't like arbitrary resolutions - feed it something too far off its trained aspect ratios and you'll get stretched anatomy, duplicated heads, or generally soft, wrong-looking output. Most people handle this by keeping a mental (or literal) chart of "good" SDXL sizes and typing numbers into an Empty Latent node by hand. SDXLExtendedResolution turns that chart into a dropdown: pick a resolution, get width and height as integers, wire them straight in.

    It's from ComfyMath, evanspearman's small math/logic utility pack for ComfyUI, and this node is the picker version of its sibling CM_NearestSDXLExtendedResolution (which does the same lookup but from an input image instead of a manual choice).

    How it works

    There's no arithmetic to configure - you just choose a resolution from a preset list of 40 width×height combinations, formatted as strings like 512x2048 or 704x1344. What's notable about the list is that it's much bigger than SDXL's five officially trained aspect ratios (1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, and their rotations). This "Extended" table walks the width up in 64-pixel steps while holding the total pixel count close to SDXL's native 1024×1024 budget the whole way - 512×2048 and 1024×1024 both land almost exactly on that same pixel count, just at very different aspect ratios. It's the same idea as the official trained buckets, generalized to a lot more shapes.

    The node then reads the width and height back out of whichever string you picked and outputs them as separate INT sockets, ready to feed downstream.

    Inputs and outputs

    • resolution - a dropdown of 40 preset WIDTHxHEIGHT strings, ranging from tall (e.g. 512x2048) through to the equivalent wide shapes, all sitting near SDXL's native pixel budget.
    • Outputs: width and height (INT, INT) - plug directly into an Empty Latent Image's width/height, or into a resize/upscale node.

    How to install it

    Through ComfyUI Manager: search ComfyMath, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/evanspearman/ComfyMath.git
    

    then restart ComfyUI. It's a plain lookup table with no dependencies, no model downloads, nothing else to set up.

    Common issues & troubleshooting

    A picked resolution generates worse than expected. Not every entry in this extended list is one of SDXL's actually-trained aspect ratios - only 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640 (and their rotations) are officially in-distribution. The rest extrapolate the same pixel-budget idea out to more extreme ratios the model wasn't specifically trained on. The further a pick sits from square, the more likely you are to see soft artifacts or warped proportions; if that happens, try one of the five official ratios instead and see if it cleans up.

    You need this driven by an existing image instead of picking manually. Use the sibling node, CM_NearestSDXLExtendedResolution - same underlying table, but it measures an input image and finds the closest match automatically instead of you choosing from the dropdown.

    Missing node error on a shared workflow. Install ComfyMath via Manager as above, then reload.

    The pack hasn't been updated in a while. True, and a 2024 community thread confirmed the author had stepped back from active development - but the same thread also confirmed this family of resolution nodes works correctly in practice. It's a finished, stable lookup table rather than something under active change, which for a fixed list of resolutions is exactly what you want.

    Categorymath/graphics

    Inputs (1)

    NameTypeDefaultDescription
    resolutionCOMBO40 options: 512x2048, 512x1984, 512x1920, 512x1856, 576x1792, 576x1728, +34

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT