Empty Latent (Advanced)
An Empty Latent node that finally tells you the dimensions
- Latent
- Latent Width
- Latent Height
- Width
- Height
Every workflow that starts from scratch needs an empty latent, and ComfyUI's built-in one is fine - right up until you need a specific aspect ratio, a non-standard VAE compression, or the actual pixel dimensions as numbers for the next node. Empty Latent (Advanced) from WtlNodes is that version. It's not a fundamental rework; it's the "I got tired of doing this math by hand" upgrade.
The core idea is the same: you give it pixel dimensions, it gives you a LATENT at width/8 × height/8 (for the standard 8× VAE compression). The improvements are presets, sanity, and outputs.
The inputs that matter
use_ratio- flip this on and instead of typing pixels you pick aratio(1:1, 3:2, 4:3, 5:3, 16:9, 16:10, 21:9, 32:9) plus anorientation(landscape/portrait toggle). Nice for keeping generations consistent across a batch.resolution- a dropdown of 28 common training-style resolutions (1024×1024, 1344×896, 1792×1344, 1920×1280…). The fastest way to land on a tried-and-true size without remembering SDXL's native set.width/height- manual control, 64 to 8192, step 64. 64-step snapping is deliberate: latents want multiples of 8, and aligned sizes behave better in samplers.batch_size- 1 to 256.latent_compression- this is the hidden gem, default 8. It's the spatial downscale factor from pixels to latent. SD1.5 and SDXL are 8; some newer architectures differ. If your VAE compresses 16× (or 4×), set it here and the node does the division correctly instead of you eyeballing latent sizes.
The outputs that make it useful
Beyond the Latent itself you get four integer outputs: Latent Width, Latent Height (the latent-space dimensions), and Width, Height (pixel dimensions). Wire those into a Primitive-style math node or a Text template and you can label batches, size conditioning crops, or drive an upscale-by-multiplier pipeline with numbers that came from the source of truth - no converting by hand and no hardcoded values that break when you change resolution.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git
Restart ComfyUI, or search "WtlNodes" in ComfyUI Manager. No models, no heavy deps.
Gotchas
- The
latent_compressiondefault is 8, and changing it doesn't resize your latent. It changes how the node computes latent dimensions from pixels. If you set it to 16 on an 8× model, you'll get a latent that's half the expected size and a confusing sampler error downstream. - The
resolutionpreset list is pixel-side, not latent-side. It's a convenience picker for humans; the node still does the compression math for you. - Ratio + orientation gives you aspect, not absolute size. You'll still set a
width(or resolution) to define the scale. The ratio then derives the other side.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| use_ratio | BOOLEAN | false | — |
| orientation | BOOLEAN | false | — |
| width | INT | 102464–8192 | — |
| height | INT | 102464–8192 | — |
| ratio | COMBO | 8 options: 1:1, 3:2, 4:3, 5:3, 16:9, 16:10, +2 | |
| resolution | COMBO | 28 options: 1152x768, 1024x1024, 1792x1344, 1344x896, 2048x1280, 1280x768, +22 | |
| batch_size | INT | 11–256 | — |
| latent_compression | INT | 81–64 | Spatial compression factor. SD/SDXL = 8, adjust for other architectures. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| Latent | LATENT | — |
| Latent Width | INT | — |
| Latent Height | INT | — |
| Width | INT | — |
| Height | INT | — |