图像分析丨数据
Stop guessing what's inside your image tensor
- image
- 批次
- 宽度
- 高度
- 通道
- 信息
Every ComfyUI user has had the moment: a node downstream is throwing shape errors, or the image comes out black, and you have no idea whether your tensor is [1, 1024, 1024, 3] or [4, 512, 512, 3], or whether its values live in 0–1 or 0–255. ImageDataAnalyzer is the node that answers all of that in one glance. It takes an optional image, pokes at the tensor, and hands you the batch size, width, height, channel count, and a full text report.
It's from ComfyUI-QING (display name "图像分析丨数据"), the same Chinese-authored utility pack that gives you mask and data plumbing. This is one of those "boring but saves your afternoon" nodes.
How it works
No required inputs - you wire an IMAGE into the optional image socket, or you don't. If nothing's connected, you get back all zeros plus the string "无图像输入" (no image input), which is itself a useful sanity signal. When an image is present it inspects the tensor's shape, device, dtype, and statistics:
- shape
[B, H, W, C](or[H, W, C], which it treats as batch 1) - total pixel count and estimated memory footprint (it assumes float32:
pixels × 4 bytes) - min, max, and mean value
- a type classification: "标准化图像 (0-1)" if values sit in 0–1, "8位图像 (0-255)" if they run up to 255, otherwise "自定义范围"
That last bit is the one you'll actually use. The 0–1 vs 0–255 mismatch is a classic source of "my image is invisible" - a node expecting normalized values fed 0–255 data renders as a blown-out white square, and vice versa.
The outputs that matter
批次(batch),宽度(width),高度(height),通道(channels) - four INTs. Clean numbers you can wire straight into other nodes, which is the real value here: this isn't just a readout, it's a source of facts for your graph.信息(info) - one STRING with the full multi-line report.
A neat trick: because the numeric outputs are real INTs, you can gate logic on them. Feed 宽度 into a router or an IntToBool-style comparison and have the workflow branch on whether the image is the size you expected, before a batch step runs.
Where it fits
Think of it as the diagnostic front-end to your batch pipeline. Before you run QING_BatchForEach (same pack) over a folder, check that every image is actually batch-friendly. When a mask or image comes out of a node looking wrong, drop this inline (it passes nothing through - it's a pure analyzer, so branch it off a preview node) and read the numbers. Pair the 信息 string with the pack's LetMeSee or LogPrinter if you want it surfaced in the console or the UI panel.
Installing
Part of ComfyUI-QING, so it installs with the whole pack - all 79 nodes at once. ComfyUI Manager: search "ComfyUI-QING". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/GAO-SHIQING/ComfyUI-QING
cd ComfyUI-QING
python install_dependencies.py # or: pip install -r requirements.txt
Restart ComfyUI. Dependencies are plain pip packages (Pillow, opencv-python, scipy, scikit-image, cairosvg), no model downloads. The author ships a China mirror flag, --mirror --auto. Python ≥ 3.9 and a recent ComfyUI.
Gotchas
There's essentially one: it's a passive analyzer, so it only tells you about whatever you remember to feed it, and the memory figure is an estimate that assumes float32 regardless of the tensor's actual dtype. Treat the numbers as directional, not gospel. And remember the empty-input behavior - all zeros plus "无图像输入" is a state you'll hit by accident when you wire up a new workflow and forget to connect the image, so it doubling as a "did I connect this?" check is a feature, not a bug.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| imageopt | IMAGE | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| 批次 | INT | — |
| 宽度 | INT | — |
| 高度 | INT | — |
| 通道 | INT | — |
| 信息 | STRING | — |