SDXL Resolutions (WLSH)
SDXL Resolutions (WLSH)
- width
- height
SDXL wasn't trained at one resolution - it was trained at 1024x1024 plus a set of specific alternate aspect ratios, and generating outside those specific pairs is a real way to end up with stretched anatomy or weird framing. This node exists so you never have to remember the list or type the numbers by hand: pick a resolution from a dropdown, pick landscape or portrait, get width and height back as plain integers.
The five options baked in - 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640 - aren't arbitrary. They're literally SDXL's multi-aspect training buckets. The model's own positional encoding was trained expecting these specific dimensions (and their rotations), which is why "just generate at whatever resolution you want" works worse on SDXL than it does on newer, more resolution-flexible architectures. Off-ratio generation is one of the more common causes of duplicated limbs or warped proportions on SDXL and its finetunes - Pony, Illustrious, and the rest inherit the same training-resolution constraint from the base model. Sticking to this list, then upscaling afterward if you need more pixels, is still the standard approach for anything in the SDXL family.
Inputs: resolution is an enum with the five pairs above (each shown as WIDTHxHEIGHT|ratio, e.g. 1024x1024|1:1). direction is landscape or portrait - pick landscape and you get the pair as listed, pick portrait and width/height swap. Outputs: width and height, both plain INT. Note there's no image or latent output here at all - this is a pure number-generating node, meant to feed the width/height fields on something else (a stock Empty Latent Image node, a resize node, wherever you need the actual numbers).
If you want the resolution and an actual empty latent in one step instead of wiring this into a separate latent node, the pack ships a dedicated node for that - SDXL Quick Empty Latent (WLSH) - which is the same resolution list but outputs a LATENT directly along with the same width/height integers. This node is the leaner version for when you just need the numbers.
Installing it: search "wlsh_nodes" in ComfyUI Manager, or clone manually:
cd ComfyUI/custom_nodes
git clone https://github.com/wallish77/wlsh_nodes
Restart ComfyUI. No models to download - this is a static lookup table, nothing more.
Where this matters most in practice: if you're building a batch or automating variations across resolutions, wiring this node in (rather than four separate hardcoded width/height pairs scattered around your graph) means a resolution change is one dropdown click instead of hunting down every place you typed a number. And if you're getting warped results on an SDXL-family checkpoint and you're not sure why, checking whether your current resolution actually matches one of these five pairs is a genuinely useful first diagnostic step before you start blaming the prompt, the sampler, or the checkpoint itself.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| resolution | COMBO | 5 options: 1024x1024|1:1, 1152x896|9:7, 1216x832|19:13, 1344x768|7:4, 1536x640|12:5 | |
| direction | COMBO | 2 options: landscape, portrait |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |