📊 Histogram Analysis
Actually look at your data before you grade it
- image
- histogram_image
- histogram_data
- statistics
- raw_data
A histogram node is never the star of a pack, but it's the thing pros reach for before they start moving sliders. This one renders a proper, matplotlib-quality histogram of your image, gives you the statistics behind it, and exports the raw data - then gets out of the way. It doesn't touch your image; it's a diagnostic, and in a grading workflow that's exactly what you want upstream of the curve and levels nodes.
Why you'd reach for it: instead of guessing why an image looks muddy, you read the histogram. Pile-up on the left means crushed shadows. Pile-up on the right means blown highlights. A lump in the middle with nothing at the edges means low contrast - which is most AI output, honestly. Knowing that tells you whether to reach for an S-curve, a levels auto-fix, or the dehaze slider. The curve node in this same pack even draws channel histograms behind its curves, which is the fancier version of the same idea; this node is the standalone, inspect-anything version.
How it works
The node computes a histogram over however many bins you ask for (64 to 1024, default 256) for whichever channel you pick, then renders it with matplotlib - dark background, readable bars, the kind of chart you'd screenshot for a review. If show_statistics is on, it layers in the numbers: mean, median, and standard deviation, computed via scipy. export_data gives you the raw bin counts as a string, which you can pipe to other nodes if you're building something that reacts to image statistics.
A genuinely useful detail: it handles batches. Feed it a batch of images and you get back a stacked batch of histogram images. The text outputs (histogram_data, statistics, raw_data) return the first frame's values - ComfyUI can't carry a list of strings through a single wire, so that's a sane compromise rather than an omission.
The inputs that matter
There are basically four knobs total:
channel- RGB, R, G, B, or Luminance. Luminance is the one to check for tonal-range questions; R/G/B individually reveal color casts.histogram_bins- leave at 256 for normal work; more bins if you're hunting fine detail.show_statistics- on by default; the mean/std/median line is most of the value.export_data- off by default; flip it if you want raw counts.
Outputs: histogram_image (wire to a Preview or Save node), plus the three string outputs. And since it only reads the image, you can park it on a branch alongside your main pipeline without affecting anything.
Installing it
Same as the rest of the pack. ComfyUI Manager → search "ComfyUI-Curve", or:
cd ComfyUI/custom_nodes
git clone https://github.com/aiaiaikkk/ComfyUI-Curve.git
Restart ComfyUI. Nothing to download. The one hard dependency beyond ComfyUI's usual stack is matplotlib - if the histogram renders blank or the node errors, that's your culprit (pip install matplotlib in ComfyUI's environment).
Where people get burned
The matplotlib dependency is the recurring one, and a blank output tells you before you waste time. Otherwise the honest gotcha is expectations: this node diagnoses, it doesn't fix. The stats are reference data, not automagic - the actual fixes live in the pack's PS Curves, Levels, and Color Grading nodes. Use this one to aim those.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| channel | COMBO | RGB | 5 options: RGB, R, G, B, Luminance |
| histogram_binsopt | INT | 25664–1024 | 直方图分组数量 |
| show_statisticsopt | BOOLEAN | true | 显示详细统计信息 |
| export_dataopt | BOOLEAN | false | 导出原始直方图数据 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| histogram_image | IMAGE | — |
| histogram_data | STRING | — |
| statistics | STRING | — |
| raw_data | STRING | — |