3D RGB Histogram Viewer
The 3D RGB Histogram Viewer is a color forensics lab on a node
- image
Every image is a cloud of colors. A normal histogram flattens that cloud into three skinny bars for red, green and blue; this node instead turns it into a cube you can spin with your mouse. The 3D RGB Histogram Viewer (class RGBHistogram3DNode, category image/analysis) is a one-node pack - plug an image in, and the node itself grows a WebGL canvas where every occupied color bucket floats in space, R along one axis, G along another, B along the third.
Why reach for it? It's a diagnostic, not a filter. When you're chasing banding, a washed-out sky, or a color cast that a flat 2D histogram hides, the cube shows you the shape of the distribution at a glance - where the mass of pixels sits, whether your highlights are crushed into a corner, whether that "neutral" palette is secretly tinted. It's the kind of node you drop at the end of a workflow, stare at for a run, and remove. An inspection tool, not a permanent resident. It also nudges you toward the right instinct from the KB's post-processing essay: before re-rolling a generation because the colors feel off, actually look at what the colors are doing.
Here's the fun part: it doesn't compute anything clever server-side. Python side, the node takes your IMAGE tensor, clamps it to 0–1, saves the first frame of the batch as a PNG into ComfyUI's temp folder (rgb_histogram_3d_temp_<node_id>.png), and hands a custom UI payload back to the frontend. The real work happens in your browser. The node loads a vendored copy of Three.js (r128, bundled, so it's fully offline), fetches that PNG, downsamples it to roughly 500px wide, and bins every pixel into bins buckets per channel. Each bucket that actually appears becomes one point in the cube, positioned by its R/G/B value and colored either by its true color or by how frequently it shows up. There's even a stats overlay in the corner: unique color count, total sampled pixels, and the single most common color. Pause rendering off-screen is handled too - an idle node doesn't keep burning the GPU.
The inputs you'll actually set, from the schema:
image- required, the only thing that matters. Wire anyIMAGEoutput here.bins(default 24, range 6–128) - the one you'll touch. Higher gives a finer cube, but since the source is downsampled to ~500px before binning, past a certain point you're just splitting the same pixels into emptier buckets.color_mode-RGBcolors points by their real color;Densitycolors by frequency. Density is the view that makes clipping and dominant tones jump out.
The rest (point_size, cube_scale, auto_rotate, show_axes, show_box, show_floor) are cosmetic - spin-to-rotate, resize points, hide the grid if it bothers you. There are no outputs: it's a terminal output node, so it re-runs when its input changes and ComfyUI's cache handles the rest. Drag to orbit, scroll to zoom.
Install is the usual one-liner:
cd ComfyUI/custom_nodes
git clone https://github.com/petrvavrin/ComfyUI-3D-RGB-Histogram.git
then restart ComfyUI. ComfyUI Manager can do it too - search "3D RGB Histogram". Its requirements.txt is just numpy, torch and Pillow, which ComfyUI already ships, so you'll almost never need the pip step.
Where people get burned: only the first image of a batch gets visualized, so a batch of four will silently ignore three of them. The temp PNG is overwritten per node on every run and cleaned at startup, so files don't pile up. If the canvas stays black, check you've connected a real IMAGE output and that web/lib/three.min.js is still present (that's the vendored Three.js - remove it and the node breaks offline). An empty batch raises an error rather than a blank render, which is honestly good behavior. Not the deepest tool in the box, but for the price of one node it's the best look at your palette you'll get in ComfyUI.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| bins | INT | 246–128 | — |
| point_size | INT | 144–34 | — |
| cube_scale | INT | 7840–130 | — |
| color_mode | COMBO | RGB | 2 options: RGB, Density |
| auto_rotate | BOOLEAN | false | — |
| show_axes | BOOLEAN | true | — |
| show_box | BOOLEAN | true | — |
| show_floor | BOOLEAN | true | — |
Outputs (0)
No outputs