GetLatent_(Width&Height) _O
Read latent dimensions without decoding
- samples
- INT
- INT
Latents are where the work actually happens in ComfyUI - the sampler manipulates them, and they only become pixels at the VAE decode. But a latent is just a tensor, and if you want to know its size as a number you can use, you have to read it out of that tensor. GetLatent_(Width&Height) _O does that: feed in a LATENT, get two INT outputs for width and height.
It's one of the O/numbers nodes in the Quality of Life Suit, and it's the latent-side sibling of GetImage_(Width&Height) _O. The classic use is size math before the latent touches a sampler: read the latent's dimensions, multiply them, and feed the result into a LatentUpscaleFactor _O or a resize so you can scale from the latent's own current size rather than guessing.
The crucial caveat
These are latent-space dimensions, not pixel dimensions. Stable Diffusion's VAE downscales by a factor of 8, so a latent of 64×64 corresponds to a 512×512 image, and 96×96 maps to 768×768. If you wire this output into a pixel-space consumer expecting "width in pixels," your math will be off by a factor of 8 and you'll be confused why nothing lines up. For SDXL the factor is 8 too (latent 64×64 → 512×512 at base); for some newer models it differs, so when in doubt, check the model's VAE downscale factor.
How it works
The node reads samples["samples"].shape[3] for width and shape[2] for height from the latent tensor and returns them as INTs - width first, height second. It's a pure read; the latent isn't modified, decoded, or resized. The single required input is samples (a LATENT), and there are no widgets to configure.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
or ComfyUI Manager → search ComfyUI-QualityOfLifeSuit_Omar92, then restart ComfyUI. No dependencies, no models.
Where it fits
Pair it with the pack's factor-based latent tools for a clean loop: read the latent size, decide on a factor, upscale, and confirm the new size in a debug print. Or use it just to sanity-check a workflow when a latent comes out an unexpected size after some chained operation. It's a small node, but in the batch/video workflows where latent shapes are constantly in flux, a read-only dimension probe saves a lot of head-scratching. And when a workflow insists the latent is a size you didn't expect, this node gives you the ground truth instead of a guess.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |
| INT | INT | — |