LTLatentToShape
A Debugging Readout for Your Latent's Shape
- input
- dim
- dim
- dim
- dim
- dim
- dim
- dim
LTLatentToShape reads the shape of a latent tensor and hands it to you as seven INT outputs, all named dim, with missing dimensions reported as 0. That's it. It's a small, boring node - and it's exactly the kind of thing you want when a workflow won't run because a latent came out the wrong size and you can't tell why.
Half the ComfyUI debugging experience is staring at a shape error and guessing which node produced the wrong tensor. This node ends the guessing: drop it on a wire, and the shape is right there in numbers you can read and route onward.
How it works
It returns input["samples"].shape, padded on the left with zeros until there are seven entries. A 4D image latent [B, C, H, W] comes out as 0, 0, 0, B, C, H, W. A 5D video latent [B, C, T, H, W] comes out as 0, 0, B, C, T, H, W. So for images, dim3 is the batch count; for video, dim4 is the frame count. Remember that the padding is on the front, which trips up anyone expecting a 4D latent to start at dim0.
The inputs and outputs
input- the LATENT you're inspecting.- Seven
dimINT outputs - one per dimension, zeros where the latent doesn't reach.
What it's actually for
Debugging first, and the README pairs it with LTReshapeLatent: read the shape of a "reference" latent, feed those ints into the reshape node, and copy that shape onto another latent. You can also wire the ints into other nodes that take size inputs - it's a genuinely composable little probe.
A note on expectations: because it's a shape readout, it has no effect on the image and costs nothing to run. There's no failure mode beyond plugging in something that isn't a LATENT, which won't let you connect it anyway. For a tool this thin, that's the right behavior.
Installing it
Part of xl0's Latent Tools pack. ComfyUI Manager → search Latent Tools → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/xl0/latent-tools
Restart, and it's under LatentTools. The pack's only dependency is lovely-tensors (Manager installs it; manual cloners may need pip install lovely-tensors). No model downloads.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input | LATENT | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| dim | INT | — |
| dim | INT | — |
| dim | INT | — |
| dim | INT | — |
| dim | INT | — |
| dim | INT | — |
| dim | INT | — |