CMK Image QuickMetrics
Read the tensor before you blame the sampler
- image
- image
Drop it on a wire, read the panel, delete it. CMK Image QuickMetrics is a debug tap: it passes the image through untouched and prints width, height, pixel count, batch size, the raw tensor shape and the dtype directly in the node UI. It's the fastest answer to "wait, is this thing a batch of eight?"
Most ComfyUI troubleshooting starts one step too late. You see a mangled output and start fiddling with the sampler, when the actual problem is that your loader handed you four frames instead of one, or a mask node returned something with the wrong rank. Numbers instead of vibes.
What it shows
Everything comes off tensor.shape, no guessing:
- width and height - dims 2 and 1 of the tensor.
- pixels - width × height, which is the number you actually care about when you're asking whether that face region has enough latent budget to look like a face.
- batch_size - dim 0. This is the useful one.
- tensor_shape - the full thing joined with
×, so a surprise 5-D tensor is visible instead of hidden. - dtype - usually
torch.float32. If it isn't, something upstream is doing something odd.
Malformed input (no .shape, too few dimensions) doesn't crash it: every metric just reports 0 and the shape reports unknown.
Inputs and outputs
| | name | type |
|---|---|---|
| in | image | IMAGE |
| out | image | IMAGE |
One in, one out, and the output is pixel-identical to the input. The node is marked as an output node in the pack, which is the whole trick: you can hang it off any IMAGE wire as a dead end and ComfyUI will still execute it, so you don't have to rewire your graph or sacrifice a Save Image to get diagnostics.
The metrics are delivered through the node's ui payload, with each value exposed both as a text list and as its own single-entry array - the source comments say that's the most robust format across frontend versions, which is the sort of detail you only learn from shipping to other people's installs.
Install
cd ComfyUI
git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
Or via ComfyUI Manager: search CMK Flow (registry cmk-flow) and restart. The manual route needs the second command - a bare git clone never runs pip, and the pack wants ultralytics, onnxruntime, insightface, segment-anything, nudenet==3.4.2 and friends. Turn on Vue Nodes / Nodes 2.0 or CMK's dynamic nodes degrade to plain LiteGraph widgets.
When it saves you
The batch-size surprise is the classic. An animated or multi-frame file loaded through a batch-capable loader gives you N frames; every node downstream that quietly assumes one image either processes N of them or errors in a way that doesn't mention frames. Four seconds with this node beats twenty minutes of checkpoint-swapping.
The other one is catching a 4-channel tensor where you expected 3 - an alpha channel that survived a resize and is now being treated as colour. Same story with a mask that came out as a single-channel 2-D tensor and got broadcast into something strange.
If you want those numbers as actual outputs you can wire into something else, the pack also ships CMK Image Metrics - same file, same measurements, but it exposes width, height, batch_size, channels as INT outputs plus a diagnostic payload, instead of just printing them at you. QuickMetrics is the glance; Image Metrics is the plumbing.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |