Get Shape
Read the actual width, height, and batch size of an image, latent, or mask
- tensor
- width
- height
- PyList_size
- channels
You've resized, cropped, or run something through a tiled process, and now you're not entirely sure what dimensions actually came out the other end. Get Shape reads the real tensor dimensions off an IMAGE, LATENT, or MASK and reports width, height, batch size, and channel count - a quick way to verify a pipeline stage did what you think it did, instead of guessing from the preview thumbnail.
How it works
Connect a tensor and it inspects its actual shape. For IMAGE and MASK this is straightforward - the reported width and height are the real pixel dimensions. LATENT is where it gets a genuine unit conversion: latents live in a compressed space, not pixel space, and the standard VAE architectures used across SD-family, SDXL, and Flux-family models compress by a factor of 8 per side - a 1024×1024 image becomes a 128×128 latent. This node knows that and multiplies latent dimensions by 8 before reporting them, so what you see is always image-space size, not the smaller raw latent grid - you don't have to do the ×8 math yourself every time you're debugging a latent-stage node.
The batch-size output is named PyList_size rather than something like batch or count, which looks like a naming mismatch at first glance - it's a PyList_size reporting on an IMAGE/LATENT/MASK tensor, nothing to do with a PYLIST at all. The node's own tooltip explains it directly: the name is kept for compatibility with existing workflows that already reference that output name. It's worth knowing going in so you don't spend time looking for a differently-named batch output that doesn't exist.
The inputs and outputs that matter
tensor- acceptsIMAGE,LATENT, orMASK. One socket, three accepted types.
Four outputs: width and height (both INT, with LATENT inputs converted ×8 to image-space size), PyList_size (INT, the batch dimension - despite the name, this is a batch count, not a PyList length), and channels (INT, which the node's own tooltip flags as sometimes reporting 1 for MASK inputs specifically, since masks are typically single-channel).
How to install it
ComfyUI Manager: search "ComfyUI-List-Utils," install, restart. Manual clone:
cd ComfyUI/custom_nodes
git clone https://github.com/godmt/ComfyUI-List-Utils.git
Restart ComfyUI. No models, no extra dependencies - this reads tensor shape metadata that's already sitting in memory, nothing to compute or download.
Common issues & troubleshooting
Width/height look 8x smaller than expected. You're probably reading the shape somewhere that isn't actually the LATENT conversion path you expected - double check you connected a LATENT and not something that's already been VAE-decoded to IMAGE, or vice versa, since the ×8 multiplier only applies to the LATENT case and an IMAGE input is reported at face value.
PyList_size isn't what you expected for batch count. Remember this output has nothing to do with a PYLIST value despite the name - it's the batch dimension of the tensor you connected. If your batch size looks wrong, check further upstream where the batch was actually set (a Repeat/batch node, an EmptyLatentImage batch field, etc.) rather than assuming this node miscounted.
channels reports 1 for a mask you expected to have more. That's expected and documented - masks are conventionally single-channel, so 1 is often the correct answer, not a bug in this node.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tensor | IMAGE,LATENT,MASK | IMAGE, LATENT, or MASK whose shape you want to inspect. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| width | INT | Width. LATENT inputs are multiplied by 8 to report image-space width. |
| height | INT | Height. LATENT inputs are multiplied by 8 to report image-space height. |
| PyList_size | INT | Batch size. The output name is PyList_size for compatibility with existing workflows. |
| channels | INT | Channel count. MASK inputs may be reported as 1 channel. |