CAS Empty Latent Aspect Ratio Preset
A dropdown of the right resolutions, so your images don't come out broken
- LATENT
- width
- height
The most common reason ComfyUI images come out looking wrong - tiled, doubled-up anatomy, or just mush - is generating at a resolution the model wasn't trained on. CAS Empty Latent Aspect Ratio Preset exists to make that particular mistake hard to make. Instead of typing a width and height into EmptyLatentImage and hoping, you pick a named preset like 1024x1024 - 1:1 Square - SDXL or 912x512 - 16:9 Landscape - SD15, and the node builds the matching empty latent, sized for that model family. That's it - that's the whole job, and it does it well.
How it works
Every preset is a real (width, height) pair, curated per model in the pack's presets.py. The label is your spec sheet: dimensions, aspect ratio, and the model it's tuned for, all in one string. The node parses the model straight out of that label, and a model dropdown beside the preset list filters the choices down to that family's entries - so you're not scrolling past dozens of Flux presets to find the SD15 ones.
The model matters beyond the label, because different families use different latent formats. SD1.5 and SDXL use a 4-channel VAE at 8× downsample; Flux.1, Krea, and Qwen-Image use 16 channels; Flux.2 uses a completely retrained 128-channel VAE at 16×. The node builds the latent with the right channel count and stride for whichever model you pick. Which is your one real responsibility: pick the model you're actually sampling with. Choose a Flux preset but run SDXL through the sampler, and the latent shape won't match what the model expects.
What you set
- preset - the big dropdown. Defaults to the first entry; the label tells you everything about what you're getting.
- batch_size (default 1) - how many blank latents to create.
Both have sensible defaults, which is the point: this node is meant to be fire-and-forget. Outputs are the LATENT (into KSampler) plus width and height as INTs, in case another node wants to know the actual resolution.
Why the presets are the point
The curated values aren't random - they track each model's native sweet spot. SD1.5 sits around 512, SDXL at 1024, Flux.1 around a megapixel, Qwen-Image around 1.7MP, Flux.2 up near 4MP. Generating near native resolution is the fix for tiling and duplicated anatomy, and these presets keep you in that range without you having to remember six different "good sizes." If none of the built-ins fit your workflow, the pack is small and open: add your own entries to presets.py and they show up in the dropdown on next launch.
Install
This is one half of a two-node pack that lands under the latent category. It needs nothing beyond a zeros tensor, so there are no model downloads and no heavy dependencies. Install via ComfyUI Manager by searching comfyui-aspect-ratio-presets, or manually:
cd YOUR_COMFYUI/custom_nodes
git clone https://github.com/budihartono/comfyui-aspect-ratio-presets.git
Then restart ComfyUI. If you'd rather define your own dimensions than pick from the curated list, the sibling CAS Empty Latent Aspect Ratio Axis node computes the matching dimension from one axis and a ratio - the preset node here is for when you want the curated, model-matched sizes handed to you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 6 options: Krea, Flux.2, Qwen-Image, Flux.1, SDXL, SD15 | |
| preset | COMBO | 51 options: 512x512 - 1:1 Square - Krea, 1024x1024 - 1:1 Square - Krea, 1216x832 - 3:2 Landscape - Krea, 1152x896 - 4:3 Landscape - Krea, 1344x768 - 16:9 Landscape - Krea, 832x1216 - 2:3 Portrait - Krea, +45 | |
| batch_size | INT | 1 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |
| width | INT | — |
| height | INT | — |