Image Latent Resolution Extractor
Find out what pixel size a latent actually represents
- samples
- latent
- width
- height
Image Latent Resolution Extractor answers one question: what pixel resolution does this latent represent? Latents don't carry their real dimensions in an obvious way - a sampler's output is a tensor downscaled 8×, so a 128×128 latent is actually a 1024×1024 image once decoded. This node reads the latent, multiplies by 8, and hands you the true pixel width and height, while also passing the latent through unchanged. It's the readout you want when you're building adaptive workflows - "decode whatever size this is and upscale it accordingly" - without hardcoding dimensions.
How it works
The mechanism is a one-line calculation: it takes the latent dict's samples tensor, reads its last two spatial dimensions, and multiplies each by 8 (the standard latent downscale factor) to get the effective pixel resolution. That's it - no VAE involved, no decode, no guesswork about which model produced it. It's deliberately lightweight.
Input:
samples- any LATENT (the standard{"samples": tensor}dict, whether from an Empty Latent, a sampler, or a VAE encode).
Outputs:
latent- the input latent passed through untouched, so you can keep it in the data path.width/height- the effective pixel dimensions (INT).
The natural use is exactly the pack's own "Dynamic Upscaling" workflow idea: extract the latent's real resolution, feed it into the pack's Multiplication node to scale it, and size an upscale or a new latent proportionally. It's also a great sanity check - if a sampler produced a latent at an unexpected size, this is the node that tells you before you waste a decode.
Installing
This is one of the 26 nodes in ComfyUI-Flow-Assistor - ComfyUI Manager (search "Flow Assistor") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Merserk/ComfyUI-Flow-Assistor.git
Restart after cloning. Current ComfyUI required (the pack is V3-only); no extra dependencies.
Where people get burned
Two things to keep straight. The 8× factor is the standard downscale for the mainstream autoencoders - if you're working with a model that uses a different latent scale (some newer architectures vary), the reported "pixel" size will be off by that factor; the node assumes 8× and doesn't check. And this node reports the latent's stored dimensions - it can't tell you what resolution the model was trained at or what the image "should" be, so use it as a factual readout, not a quality guide. If you need the dimensions of a pixel image instead, the pack's Image Resolution Extractor is the sibling node for that job.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| width | INT | — |
| height | INT | — |