π― YFG Histograms Generator
See the tonal range before you judge the render
- image
- Original Image
- RGB Histogram Filled
- RGB Histogram Lines
- Red Channel
- Green Channel
- Blue Channel
- Luminosity
When a render looks off and you can't say why, a histogram often can. "Washed out," "crushed blacks," "muddy midtones" - these aren't vibes, they're measurable shapes in the distribution of pixel values, and a histogram shows them in one glance. That's what this node does: it takes an image, computes the per-channel and luminance distributions, and draws them as actual images you can look at right in the graph.
The "YFG Histograms Generator" (from gonzalu/ComfyUI_YFG_Comical) uses NumPy to bin the pixel values, then matplotlib to render the plots - no display-node tricks, just real chart images as IMAGE outputs. It's one of the most useful "why does this look bad" diagnostic tools you can keep in a workflow, especially if you do your own upscaling or post-processing where contrast decisions matter.
Inputs and outputs
The only input is image plus histogram_size (small / medium / large), which sets the render resolution of the charts via DPI (50 / 100 / 150). Bigger = crisper when you zoom in.
Outputs - all IMAGE, all wired into SaveImage or a preview:
- Original Image - the input, passed through.
- RGB Histogram Filled - all three channels overlaid as filled curves.
- RGB Histogram Lines - same thing as line plots, easier to read at a glance.
- Red Channel, Green Channel, Blue Channel - each channel's distribution alone.
- Luminosity - the brightness histogram, the one that tells you about exposure.
What to look for
A healthy render has a histogram spanning the full range with no big piles at either end. Spikes hard against the left edge = crushed blacks. Spikes on the right = blown highlights. A narrow bell in the middle with empty space at both ends = washed-out, flat contrast - the classic complaint. If you're upscaling, checking the histogram before and after tells you whether your upscale pass actually preserved tonal range or just smeared it.
Installing
Standard pack install: ComfyUI Manager β search "YFG Comical", or
cd ComfyUI/custom_nodes
git clone https://github.com/gonzalu/ComfyUI_YFG_Comical
Restart ComfyUI. This node is the dependency gotcha of the whole pack: it imports cv2 and matplotlib at module load, but neither is listed in pyproject.toml. If the entire pack fails to load after install, it's almost certainly this. Fix: pip install opencv-python matplotlib, restart.
The honest take
A histogram won't tell you what's wrong, only what's there - but that's usually enough to point you at the fix (brightness/contrast up, a levels node, or a model that's trained for the contrast profile you're after). For a one-node diagnostic that costs nothing at runtime, it's hard to beat. If you find yourself checking it constantly, the pack's compact version of this node is the tidier daily driver - it does one histogram at a time and previews it inline.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| histogram_size | COMBO | medium | 3 options: small, medium, large |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| Original Image | IMAGE | β |
| RGB Histogram Filled | IMAGE | β |
| RGB Histogram Lines | IMAGE | β |
| Red Channel | IMAGE | β |
| Green Channel | IMAGE | β |
| Blue Channel | IMAGE | β |
| Luminosity | IMAGE | β |