LC Get Image π
Ask the image its resolution, get six answers
- image
- megapixels
- width
- height
- resolution
- batch
- aspect ratio
How many times have you needed to know an image's dimensions inside a workflow and resorted to squinting at the node corner? LC Get Image (LCGetImage) turns any IMAGE into a tidy set of six numbers: megapixels, width, height, resolution (the longer side), batch size, and an aspect ratio string. One socket in, a small summary printed on the node, six outputs out.
It's the read-out companion to the LC123 size family - the README pairs it with LC Dimension Resize as the "measure, then compute" duo, and it's the natural front-end for any resolution-aware graph.
The outputs
- megapixels (FLOAT) - width Γ height / 1,000,000, rounded to 2 decimals. "This image is 1.05 MP" at a glance.
- width, height (INT) - straight from the tensor shape.
- resolution (INT) - the longer side in pixels. Useful for "is this over my upscale threshold?" checks.
- batch (INT) - how many images are in the batch.
- aspect ratio (STRING) - a
W:Hlabel normalized to the shorter side = 1, e.g.1.0:1.2. Note it's a string, not a number - handy for display or for feeding a text-comparison, but if you need to do ratio math, you'd rather compute from width/height.
It also prints a one-line summary on the node itself (1.05 MP | 1024 Γ 1024 | res 1024 | 1.0:1.0 | batch 1), which is genuinely the nicest feature - you can read the graph state without expanding anything.
Why you'd reach for it
Resolution-aware graphs. A few patterns:
- Dynamic latents - feed an image's width/height (or a fraction via LC Dimension Resize) into an Empty Latent, so your output resolution always matches your input source.
- Conditional upscaling - check
resolutionagainst a threshold to decide whether an upscale branch fires. - Batch-aware layouts - the
batchoutput feeds any node that needs to know how many frames it's handling (video frames, multi-image workflows).
It's a value node in the plumbing sense - one authoritative source of "what is this image" that everything else can read from instead of each node re-deriving it.
Install
Part of ComfyUI_LC123_nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes
or ComfyUI Manager, then restart. No dependencies, no models - it just reads tensor shapes.
Where people get burned
The aspect ratio being a string surprises people trying to feed it into math. And because it's marked an output node, its summary shows even when nothing downstream uses the sockets - which is a feature, but can look like a "bug" if you expected it to disappear. The pack is a quiet niche collection with essentially no community discussion, so the short source in lc_get_image.py is the authoritative spec for exactly what each output means.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Source image. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| megapixels | FLOAT | β |
| width | INT | β |
| height | INT | β |
| resolution | INT | β |
| batch | INT | β |
| aspect ratio | STRING | β |