Image Histogram
Read your image's exposure like a photographer, not a guesser
- image
- ui_widget
- image
- image_list
- dataset
A histogram tells you in one glance whether an image is crushed to black, blown out to white, or balanced - and most people generating images never look at one. LF_ImageHistogram renders a brightness histogram for your image right on the node, exports it as an actual image, and hands you the raw data as JSON. It's the analytics node you didn't know you needed until your output keeps coming out too dark.
It's a diagnostic, plain and simple. Instead of eyeballing a preview and feeling like the image is murky, you get the distribution of tones. A histogram shoved hard against the left edge means lost shadow detail; clipped at the right means blown highlights; a fat middle means a washed-out, low-contrast image. Once you can read that at a glance, you stop guessing which fix to apply.
How it works
One required input - image, the image or batch to analyze. The node computes the luminance distribution and draws it as a bar chart on a KUL_TAB_BAR_CHART widget, with tabs if you feed it multiple images.
The three outputs cover three ways to use the result:
image- the histogram rendered as an actual image tensor. Save it, show it, wire it anywhere.image_list- the same histogram(s) as a list, for batch handling.dataset- the raw histogram data as JSON. This is the useful one for automation: you can feed the distribution into logic that decides whether an image is under- or over-exposed and adjusts your pipeline accordingly.
That last output is the sleeper feature. An exposure-checking loop - histogram in, compare the dataset's spread, bump brightness if the tails are clipped - is a real workflow, and the JSON output makes it buildable with plain nodes. It's also flagged as an output node (is_output_node in the schema), so ComfyUI treats it as a natural end point for inspection.
Installing it
Part of LF Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/comfyui-lf
Restart ComfyUI, or search LF Nodes in ComfyUI Manager. No model downloads; the pack's deps are just numpy, Pillow and opencv-python for this kind of work.
Gotchas
Two habits worth noting. First, the histogram only shows luminance, not per-channel color balance - great for exposure, useless for diagnosing a green cast. If you want color analysis, that's a different node in this pack (ColorAnalysis). Second, if the chart widget renders but stays blank, it's the custom frontend not refreshing - toggle the node or restart rather than assuming the data is missing.
And the standing pack note: comfyui-lf is legacy, frozen since Feb 2025; the author continues development in lucafoscili/lf-nodes, where the chart widgets were rebuilt on LF Widgets.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input images to generate histograms from. | |
| ui_widgetopt | KUL_TAB_BAR_CHART | [object Object] | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_list | IMAGE | — |
| dataset | JSON | — |