πΉ CYH Latent | SDXL Aspect Ratio
SDXL aspect ratios without the stretched-body lottery
- LATENT
SDXL was trained on a fixed set of resolutions near 1 megapixel, and generating far outside that band is how you get stretched bodies, duplicate limbs, and that unmistakable "I asked for widescreen and got a horror show" look. This node hands you an empty latent at SDXL-friendly sizes from a dropdown, so you can stop rolling the dice on odd resolutions.
It's part of the Chye ComfyUI Toolset's latent category - one of six aspect-ratio generators sharing the same design, but this one tuned to SDXL's native 1024 base rather than Flux's or Qwen's.
How it works
Nothing clever, and that's the point. The preset label embeds the resolution (16:9 (Widescreen) - 1024Γ576), the node parses it, applies your orientation and multiplier, rounds to a multiple of 32, then emits a zeroed tensor:
latent = torch.zeros([batch_size, 4, final_height // 8, final_width // 8])
Standard empty-latent behavior, output type LATENT, straight into KSampler β VAE Decode. Zero model downloads, zero extra weights.
The presets
- 1:1 - 1024Γ1024
- 4:3 - 1024Γ768
- 3:2 - 1152Γ768
- 16:9 - 1024Γ576
- 21:9 - 1344Γ576
All of these sit in the 0.5β1.2MP band, which is where SDXL behaves. Note the pack's table isn't identical to the classic "SDXL trained ratios" list (1024Γ1024, 1152Γ896, 1216Γ832, 1344Γ768, 1536Γ640) - the pack throws in 1024Γ768 and 1152Γ768, which are SDXL-adjacent rather than textbook. It doesn't matter much in practice; they're all within the safe band, and going off the exact training set only costs you a little quality, not broken anatomy.
The inputs that matter
Three you'll actually set:
- aspect_ratio - the five presets above.
- multiplier - scales the preset 0.1β10.0. This is the one to respect: crank 16:9 to 2.0 and you're at 2048Γ1152, well past SDXL's 1MP comfort zone in a single pass. Keep it at 1.0β1.25 and upscale after.
- orientation - Portrait/Landscape, default Portrait. Same quirk as the other nodes in this pack: the presets are written in landscape terms, so leaving the default Portrait swaps 1024Γ576 into 576Γ1024. Set it deliberately.
Batch size (1β64) stacks identical blank latents for grid runs.
Where it fits
The classic SDXL advice - generate at a trained ratio, then hires-fix or upscale - is exactly what this node automates. It replaces Empty Latent Image plus a mental lookup table. If you're on a non-SDXL fine-tune like Illustrious or NoobAI (which stay within the SDXL framework), these sizes apply there too.
Install
ComfyUI Manager (search "Chye ComfyUI Toolset"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/chyer/Chye-ComfyUI-Toolset
cd Chye-ComfyUI-Toolset
pip install -r requirements.txt
Restart afterward. Dependencies: scipy and opencv-python are the notable ones, plus requests and coloredlogs; torch and numpy come with ComfyUI. Zip installs need the .git/.cnr-id file (Chye-ComfyUI-Toolset) the README calls out to avoid workflow-load errors.
Honest verdict
For SDXL regulars this is a genuine convenience - a tiny node that removes a recurring piece of arithmetic. It won't change your image quality, because nothing about an empty latent changes quality; it just keeps you inside the band where SDXL does its best work.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| aspect_ratio | COMBO | 16:9 (Widescreen) - 1024Γ576 | 5 options: 1:1 (Square) - 1024Γ1024, 4:3 (Standard) - 1024Γ768, 3:2 (Photo) - 1152Γ768, 16:9 (Widescreen) - 1024Γ576, 21:9 (Ultrawide) - 1344Γ576 |
| orientation | COMBO | Portrait | 2 options: Portrait, Landscape |
| multiplier | FLOAT | 1.00.1β10 | β |
| batch_size | INT | 11β64 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | β |