Nodes/ComfyUI-NegiTools/Latent Properties 🧅
ComfyUI Node

Latent Properties 🧅

Read the size of a latent without the ×8 math

By natto-maki·Created 3 years ago·Updated 2 years ago· 31
Latent Properties 🧅
  • latent
  • WIDTH
  • HEIGHT

Latents are 8× smaller than the images they decode into - a 1024×1024 image is a 128×128 latent. That's an easy thing to forget, and it's the source of a whole class of "why is my output the wrong size" confusion in ComfyUI. This node exists to save you from doing that multiplication in your head: feed it a LATENT and it outputs the pixel dimensions the latent will produce after VAE decoding.

How it works

It's the sibling of Image Properties, with the math flipped. Image Properties reads width and height straight off an IMAGE tensor; Latent Properties reads the latent's tensor shape and multiplies by the 8× VAE scale factor (samples.shape[3] * 8 for width, samples.shape[2] * 8 for height) to report the decoded pixel size. So you always get the image-space dimensions, not the raw latent-space numbers - which is what you actually care about when you're sizing things downstream.

Inputs and outputs

  • Input: latent (any LATENT).
  • Outputs: WIDTH and HEIGHT (both INT), in decoded pixel dimensions.

The straightforward use is feeding these into a resize, an upscale, or a conditional that needs to know what a sampler will actually produce. If you've ever wired an image into an img2img setup at a different resolution than the latent it came from, you know why a node that just tells you the effective size is useful.

Installing it

It's part of ComfyUI-NegiTools, and it's the same story as every node in this pack - ComfyUI Manager, search "ComfyUI-NegiTools", or:

cd ComfyUI/custom_nodes
git clone https://github.com/natto-maki/ComfyUI-NegiTools
pip install -r ComfyUI-NegiTools/requirements.txt

then restart. No API key, no downloads, pure Python.

When it earns its place

Honestly, this one is a nicety. If your latents are always created by an Empty Latent node with known dimensions, you already know the size and don't need it. It becomes genuinely useful in pipelines that transform latents - upscaling, tiling, batch processing - where the effective size changes mid-graph and you want downstream nodes to track it. It's also a fine companion to Image Properties for that classic debugging moment: decode an image, check both nodes, and instantly see whether your latent and image are in the same coordinate system. For a beginner, that alone is worth the two seconds it takes to wire up.

Categoryutils

Inputs (1)

NameTypeDefaultDescription
latentLATENT

Outputs (2)

NameTypeDescription
WIDTHINT
HEIGHTINT