⬡ Polyhedron Media Info
Stop typing the dimensions — read them out of the batch
- image
- width
- height
- frame_count
- fps
- duration_sec
- aspect_ratio
The ⬡ Polyhedron Media Info node exists to kill a specific kind of annoying bug: you type a resolution into a latent-size node or a save node by hand, change the source image, and forget to update the number. The graph runs fine and quietly produces the wrong-sized output. This node reads width, height, frame count, fps, duration and aspect ratio straight out of whatever IMAGE batch is wired into it, and hands them to the rest of the graph as typed values - so the numbers can't drift from the media.
It's a one-input, six-output measurement node, and the readout inside it is what makes it pleasant: it prints what it measured and whether it sees a still or a video (1920x1080 · 81 frames · 16.0 fps · 5.06 s · 1.78), so you get the answer without hunting in the console.
How it works
The node reads width, height and frame count directly from the tensor shape - [N, H, W, C] - so it works for any IMAGE source, not just this pack's Media Loader. Mid-graph batches from an upscale or a VAE decode measure just as well. duration_sec is computed as frame count over fps, and aspect_ratio as width over height. The one input you might set is fps: it's optional, and 0 means "unknown," which reports duration as 0. In practice you wire it from the Media Loader's fps output (or a fixed fps for a stills sequence) when you want a real duration.
The outputs
width,height(INT) - pixel dimensions. Feed these into latent-size nodes, upscale targets, or the batch pipeline.frame_count(INT) - how many frames are in the batch. 1 for a still.fps(FLOAT) - whatever was passed in (or 0).duration_sec(FLOAT) - frame_count ÷ fps; 0 when fps is unknown.aspect_ratio(FLOAT) - width ÷ height, for ratio-aware scheduling.
The classic wiring: Media Loader → Media Info → a latent-size node and a Save node's filename tokens, so "the size this run actually is" flows everywhere it matters. Because it's an output node, its readout also shows up in your run's results panel.
Installing it
Part of the ⬡ Polyhedron Suite pack. ComfyUI Manager → "Polyhedron Suite", or:
cd ComfyUI/custom_nodes
git clone https://github.com/PolyhedronAI/ComfyUI-PolyhedronLoRAStack.git
# restart ComfyUI
No extra dependencies.
Gotchas
Two things to know. First, it measures an IMAGE batch - if you want the intended duration of a video being loaded, wire the Media Loader's fps output in, or a video with a native rate will report its frame count but a duration of zero until you give it the fps. Second, width/height are the batch's actual pixel size, which isn't necessarily what the model sees: a latent is 8× or 16× smaller depending on the VAE. For latent-grid numbers, ⬡ Polyhedron Empty Latent's latent_width/latent_height outputs are the ones to feed into latent-shaped inputs like the seed preview fields. And as with the rest of the pack, if the node renders blank under Nodes 2.0 (Modern Node Design), disable that renderer in Settings.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Any IMAGE batch [N,H,W,C]. Width/height/frame-count are read from the tensor itself, so this works for any source — not just the Media Loader, but also mid-graph. | |
| fpsopt | FLOAT | 0.000–240 | Optional source fps (e.g. wired from the Media Loader). 0 = unknown → duration is reported as 0. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| width | INT | — |
| height | INT | — |
| frame_count | INT | — |
| fps | FLOAT | — |
| duration_sec | FLOAT | — |
| aspect_ratio | FLOAT | — |