π Empty Latent Advanced
An Empty Latent node that stops you Googling 'SDXL aspect ratios'
- Latent
- Width
- Height
It's EmptyLatentImage with a better front door
If you've built more than one ComfyUI workflow you've met the stock Empty Latent Image node - the thing that starts every txt2img graph with a blank slate of latent noise. This is that node with a dropdown instead of arithmetic. Pick a resolution off a menu of 20 presets labelled by model family, and the width/height widgets fold away so the node stays tiny on your graph.
That's the whole pitch, and for its target audience it's a good one: you stop Googling "what are the SDXL aspect ratios" and just pick β― 832Γ1216 (SDXL - 2:3).
How it actually works
Under the hood it does exactly what the core node does - a torch.zeros([batch, 4, height//8, width//8]) tensor on CPU. The //8 is the VAE downsampling: SD1.5 and SDXL both compress 8x per side, so a 1024Γ1024 image lives as a 128Γ128 latent. All zeros means no signal at all, which is the point - the sampler builds the image from that blank start. That's also what the README's "Zero-Lag" claim means: it's a fresh tensor, no VAE encode step, nothing to wait on.
The 20 presets are hardcoded and grouped: seven SD1.5 ratios around 512px, nine SDXL ratios (the official multi-aspect training set - 832Γ1216, 1216Γ832, 1024Γ1024 and friends), and four HD/FHD ratios like 1080Γ1920.
The Mode dropdown decides how those presets get used:
- Use Preset (default) - the dropdown picks the size; Width/Height are ignored, and the JS extension hides them so the node renders as one compact widget.
- Override - unlocks Width and Height. Turn Ratio Lock on and changing one side recomputes the other to match the selected preset's aspect ratio.
The inputs and outputs that matter
- Resolution - the 20-preset enum, default
β― 832Γ1216 (SDXL - 2:3). - Mode -
Use Preset/Override. - Ratio Lock (default on) - only honored in Override mode.
- Width / Height (64β16384, step 8), Batch Size (1β64).
Outputs: Latent, the LATENT you feed into the KSampler, plus Width and Height as INTs - the rounded final numbers. Wire those into a crop or conditioning node and you never have to recompute the actual dimensions by hand.
Installing
ComfyUI Manager, search Empty Latent Advanced, install, restart. Or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/ameyukisora/ComfyUI-Empty-Latent-Advanced.git
Then restart ComfyUI. No requirements.txt, no model downloads, nothing but one Python file and a small JS extension - the install is genuinely painless. Find the node under right-click β Add Node β Latent β π Empty Latent Advanced.
Should you bother?
Honest take: the output is byte-identical to stock Empty Latent Image. You're paying for the menu and the auto-hide, so the value shows up if you hop between SD1.5 and SDXL workflows, or do a lot of portrait crops and are tired of typing dimensions from memory. If you never leave 1024Γ1024, you don't need it. The preset list is fixed to those three families - Flux and other non-8x-VAE or non-SDXL models get no rows, so use Override there.
Two small footguns, worth restating so they don't bite: Ratio Lock derives its ratio from the selected preset, not your typed numbers - switch presets and the "locked" ratio silently changes. And any width/height you type gets rounded to a multiple of 8 (min 64), with the INT outputs reporting the rounded values, so don't expect what you typed back verbatim.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| Resolution | COMBO | β― 832Γ1216 (SDXL - 2:3) | 20 options: β― 512Γ896 (9:16), β― 512Γ768 (2:3), β― 480Γ640 (3:4), β‘ 512Γ512 (1:1), β 640Γ480 (4:3), β 768Γ512 (3:2), +14 |
| Mode | COMBO | Use Preset | 2 options: Use Preset, Override |
| Ratio Lock | BOOLEAN | true | β |
| Width | INT | 83264β16384 | β |
| Height | INT | 121664β16384 | β |
| Batch Size | INT | 11β64 | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| Latent | LATENT | β |
| Width | INT | β |
| Height | INT | β |