SDXLResolution
A dropdown of SDXL's actual trained resolutions
- width
- height
SDXLResolution solves a specific, common mistake: typing in an SDXL width and height that "feels about right" (a nice round 1024x768, say) instead of one of the resolutions SDXL was actually trained on. SDXL is multi-aspect trained - 1024x1024 native, plus a fixed set of taller and wider buckets like 1152x896, 1216x832, and 1344x768 (and their rotations) - and generating at an off-bucket resolution is a real source of stretched anatomy and weird composition, not just a theoretical concern. This node is a dropdown of the real buckets, so you pick instead of guess.
How it works
Choose a resolution from the dropdown - nine options: 1024x1024, 1152x896, 896x1152, 1216x832, 832x1216, 1344x768, 768x1344, 1536x640, 640x1536. The node splits that string and outputs width and height as separate integers, ready to plug straight into an Empty Latent Image or similar sizing node.
The inputs and outputs that matter
- resolution - the whole node; pick the aspect ratio you want and the exact SDXL-trained pixel dimensions come with it.
- Outputs - width and height, both INT, feeding directly into your latent's size inputs.
Installing it
Search ComfyMath in ComfyUI Manager, or:
cd ComfyUI/custom_nodes && git clone https://github.com/evanspearman/ComfyMath
then restart ComfyUI. Pure Python, no dependencies beyond ComfyUI's own, no models to download - this node needs nothing extra to work.
Common issues
The main value here is just not having to remember or look up the bucket table by hand, and it's genuinely correct: 1024x1024 native with 1152x896, 1216x832, 1344x768, 1536x640 and their rotations as the trained multi-aspect set matches what SDXL and its heavily-used anime derivatives (Illustrious, NoobAI) were actually trained on. If you're generating on an SDXL-family checkpoint and want to avoid the anatomy stretching that comes from picking an untrained resolution, this dropdown is the fast, correct way to do it - faster than opening a browser tab to look up the table.
The one thing to keep straight: this node only covers SDXL's own trained buckets. If you're working on SD 1.5 (which trained at 512x512 and its own set of aspect ratios) or a non-SDXL architecture, these numbers don't apply and picking one here will generate at the wrong native scale for that model - check what your checkpoint is actually built on before trusting the dropdown.
ComfyMath as a whole hasn't seen active maintenance since roughly early 2024 by community accounts, but this node is a static lookup table with zero external dependencies - there's essentially nothing for an upstream ComfyUI change to break here, and the values themselves don't go stale since SDXL's trained resolutions haven't changed since the model shipped.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| resolution | COMBO | 9 options: 1024x1024, 1152x896, 896x1152, 1216x832, 832x1216, 1344x768, +3 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |