Empty Latent Ratio Custom SDXL (Mikey)
Any aspect ratio, fitted to SDXL's pixel budget
- LATENT
SDXL was trained on a specific set of resolutions that all land around the same total pixel count - 1024x1024, 1152x896, 1216x832, 1344x768, 1536x640, and their rotations. Stray too far outside that budget (say, by picking a random width and height off the top of your head) and you're generating outside the model's comfort zone, which is a common cause of the "why is my composition stretched" complaints you see in SDXL threads. Empty Latent Ratio Custom SDXL exists for the moment when none of the preset ratio dropdowns match what you actually need - you have a specific size in mind, maybe to match a print dimension or an ad slot - and you want SDXL's pixel budget respected without doing the ratio math yourself.
Per the pack author's own description, you enter whatever width and height you want, from wherever - a screen size, a canvas spec, anything - and the node fits it under roughly 1024x1024 resolution while preserving your ratio, then hands you back a properly sized empty latent. That's the difference between this node and just typing numbers into a plain Empty Latent Image: this one keeps you inside SDXL's actual working range even when your starting numbers weren't anywhere close to it.
The inputs that matter: width and height (integers, 1 to 8192, default 1024 each) are your desired ratio - you're not necessarily setting the final output size directly, you're describing the shape you want, and the node scales it to fit. batch_size (1 to 64) works like any other latent node's batch control. The single output is LATENT, ready to go straight into your sampler.
Worth knowing: fitting the pixel count to SDXL's budget isn't the same as fitting the aspect ratio to what SDXL was actually trained on. A very extreme ratio - something far taller or wider than SDXL's trained rotations (1024x1024 through roughly 1536x640-and-back) - can still generate distorted results even though the total pixel count is technically correct, because the model itself was never trained on ratios that extreme. If you want maximum reliability, this node is best used for ratios that are close-ish to something in SDXL's actual trained range; for anything more extreme, expect to fight it a bit, same as you would with any node claiming an arbitrary ratio on this model family.
Installing it
Comes with the full Mikey Nodes pack. Through ComfyUI Manager, search "Mikey Nodes." Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/bash-j/mikey_nodes
Restart ComfyUI. No extra models or dependencies needed - this is pure latent-shape math.
Common issues
The main one is a false sense of security: because the node handles the pixel-budget fitting for you, it's easy to assume it also protects you from SDXL's aspect-ratio sensitivity entirely. It doesn't - it solves one problem (total pixel count) and not the other (trained ratio). If a generation at an extreme custom ratio still comes out stretched or oddly composed, that's the model's trained-ratio limitation showing through, not a bug in this node. For anything you'll reuse often, it's worth checking whether Preset Ratio Selector already has a close match in its built-in list - those presets come with matching Clip Text Encode conditioning sizes worked out for you, which this simpler node doesn't provide.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 10241–8192 | — |
| height | INT | 10241–8192 | — |
| batch_size | INT | 11–64 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |