Aspect Ratio JK๐
Never guess the right latent size again โ 31 presets for SD15, SDXL, SD3 and Qwen
- width
- height
Every diffusion model has resolutions it was trained at, and feeding it something way off that range is how you get doubled heads and cropped compositions. Aspect Ratio JK๐ is a 31-entry preset menu that hands you a width and height in the native shape of the model you're running - no mental math about what SDXL's base resolution should be.
It's a small utility, but it's the kind of thing that quietly unblocks beginners. Instead of typing 1152ร896 from memory every time you build an SDXL workflow, you pick "SDXL 1152x896" from the list and wire the two INT outputs wherever a resolution is expected: Empty Latent Image, Empty SD3 Latent, or the width/height inputs on a KSampler-parameters node.
How it works
The mechanism is boring in the best way. A dropdown maps a friendly label to a hardcoded resolution, the node parses "SDXL 1152x896" into two ints, and returns them. The presets are grouped by the model family they belong to - SD15 has a whole band of 512-tall landscape shapes (680, 768, 912, 952, 1024, 1224 wide), SDXL gets its 1024-class portrait/landscape set, SD3 adds a few of its own, and Qwen-image has 1328ร1328 and friends. The custom path is where it gets more useful than most aspect-ratio nodes: set resolution to "Custom" and the custom_width / custom_height sliders (64โ16384, stepping by 8) take over.
swap_dimensions is the one toggle that will save you an afternoon. Set it true and the node returns height, width - you can keep your landscape preset while composing vertically, or rotate a portrait shot for a social-media crop without changing the preset.
The inputs that actually matter
resolution- the preset list. Start here.custom_width/custom_height- used only when resolution is "Custom".swap_dimensions- flips the output pair.
Outputs: width and height, both INT. That's it. There's a small guard in the source - if the resolution string somehow fails to parse, it falls back to 512ร512 rather than crashing the graph, which is a nicer failure mode than a red node.
Install & gotchas
Part of the JakeUpgrade pack, so: ComfyUI Manager โ search ComfyUI-JakeUpgrade, or
cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
cd ComfyUI-JakeUpgrade && pip install -r requirements.txt
No models, no heavy deps beyond the pack's standard list (opencv-python, pillow, torch). One honest note: presets are a convenience, not a rule. SDXL happily generates at non-native sizes when you denoise properly or upscale after; the preset just removes the "which number do I type" step for the common cases. And if the node doesn't show up in your library, check the pack's config.ini - deprecated nodes are hidden by default, though this one isn't among them, so it should just be there.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| resolution | COMBO | Predefined resolution presets for different models | |
| custom_width | INT | 51264โ16384 | Custom width when resolution is set to Custom |
| custom_height | INT | 51264โ16384 | Custom height when resolution is set to Custom |
| swap_dimensions | BOOLEAN | false | Swap width and height dimensions |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| width | INT | โ |
| height | INT | โ |