Nodes/ComfyUI-Jjk-Nodes/SDXL Recommended image sizes
ComfyUI Node

SDXL Recommended image sizes

Stop typing width/height by hand

By jjkramhoeft·Created 3 years ago·Updated 2 years ago· 46
SDXL Recommended image sizes
    • width
    • height
    resolutionSquare (1024x1024)
    aspectPortrait

    Every SDXL model has a short list of resolutions it was actually trained on, and generating outside that list is how you end up with stretched limbs, doubled heads, or a weirdly tiled background. Most people either memorize the numbers or keep a sticky note next to their monitor. This node skips both: pick a shape from a dropdown, get width and height out the other end.

    What it actually does

    SDXL wasn't trained at a single fixed size - Stability trained it multi-aspect, on a small set of buckets around the 1024×1024 native resolution: 1024×1024 (square), 1152×896, 1216×832, 1344×768, and 1536×640, plus their portrait rotations. That list isn't folklore, it's the architecture's own training spec, and it's exactly what this node's dropdown gives you. There's no math happening here - it's a lookup table wired to two INT outputs. The value is that you never have to remember whether it's 1216×832 or 1218×834, and you never fat-finger a resolution that's close to a trained bucket but not actually one of them, which is a subtler way to get soft artifacts than people expect.

    Because these are SDXL's own trained ratios, this node is genuinely SDXL-specific - it's the right tool for SDXL base and anything built on it (Illustrious, NoobAI, Pony, Juggernaut, RealVisXL, and the rest of that family all inherit the same native buckets). It's the wrong tool for SD 1.5 (trained at 512) or Flux (which is more forgiving about resolution to begin with). Don't reach for it outside the SDXL family and expect the numbers to mean anything.

    The two inputs, and the two outputs

    • resolution - pick a shape: Square (1024x1024), TV (1152x896), Photo (1216x832), Widescreen (1344x768), or Cinema (1536x640). Defaults to Square.
    • aspect - Landscape or Portrait, defaulting to Portrait. This is the one people trip on: it doesn't add a new size, it just swaps width and height on whatever you picked in resolution. Pick Widescreen + Portrait and you get 768×1344, not some new portrait-specific bucket.

    Outputs are plain width and height INTs. Wire them straight into an Empty Latent Image node's width/height sockets (or anywhere else that takes an int, like a KSampler's latent dimensions upstream). That's the entire point of the node - it exists to feed those two sockets correctly without you doing arithmetic.

    Installing it

    Easiest path is ComfyUI Manager: open it, search ComfyUI-Jjk-Nodes, install, restart ComfyUI. Doing it by hand is just as fast since there's nothing heavy to pull in:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jjkramhoeft/ComfyUI-Jjk-Nodes
    

    Restart ComfyUI and the jjk category shows up in the node search. No model downloads, no Python dependencies beyond what ComfyUI already ships - it's pure logic, so there's nothing to break here the way custom nodes with their own requirements.txt sometimes do.

    Where people get tripped up

    Honestly, there isn't much to go wrong - that's the appeal. The one real trap is the Portrait/Landscape swap above: if your output comes out sideways from what you expected, you picked the wrong aspect, not the wrong resolution. The other thing worth knowing going in: this is a tiny, low-profile utility pack (four nodes total, built by one author for their own use), not a widely-discussed ecosystem staple like Impact Pack or rgthree - so don't expect a big community thread if you hit an edge case. If you outgrow the five fixed buckets - say you want a resolution SDXL wasn't actually trained on - you'll want a general width/height math node instead, since this one is deliberately just the official list and nothing more.

    Categoryjjk

    Inputs (2)

    NameTypeDefaultDescription
    resolutionCOMBOSquare (1024x1024)5 options: Cinema (1536x640), Widescreen (1344x768), Photo (1216x832), TV (1152x896), Square (1024x1024)
    aspectCOMBOPortrait2 options: Landscape, Portrait

    Outputs (2)

    NameTypeDescription
    widthINT
    heightINT