ComfyUI Node

SNS Histogram

One Column, One Histogram — Pixel Distributions and Everything Else

By HowToSD·Created 2 years ago·Updated about a year ago· 23
SNS Histogram
  • dataframe
  • IMAGE
y_column_name
title
y_axis_label
bins10
style
palette

If you want to see how a single column of numbers is distributed - pixel values in an image, ratings in a dataset, latencies in a benchmark - SNS Histogram is the node. It takes one numeric column and a bin count, and hands back a histogram as an IMAGE.

It's the pack's simplest plot and one of its most useful. The README even shows the party trick: pull pixel data out of a generated image, histogram the red channel, and suddenly you're analyzing your own ComfyUI output with the same tool you use for CSV data.

How it works

It wraps Seaborn's histplot on a single column. Note the naming quirk: the input is called y_column_name, but that's just the data column whose values get binned along the x axis - there's no x input at all. You pick the column and the bins count (from 2 to 200, default 10), and it buckets the values into that many ranges, drawing a bar per bucket whose height is how many values landed there.

One honest limitation straight from the source: multiple series aren't supported yet. The node's code has a leftover loop that breaks after the first column, so it's strictly one column at a time - if you want two histograms overlaid, run the node twice and stack the images.

Inputs and outputs

  • dataframe - your data.
  • y_column_name - the numeric column to histogram.
  • title, y_axis_label - labels.
  • bins - number of buckets, 2–200, default 10.
  • style, palette - Seaborn theme names.

Output: one IMAGE.

Install

Ships in HowToSD/ComfyUI-Data-Analysis. Manager: search "Data analysis" in the Custom Node Manager, install, restart, reload the browser tab. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis   # README: example workflows expect this folder name
pip install -r requirements.txt

Requires seaborn, matplotlib and pandas; no models or GPU needed.

Common issues

Non-numeric data is the usual failure - histogramming a column of strings raises, so make sure the column holds numbers (convert with the pack's Py String To Float / Pandas As Float nodes if it came from text). Column-name typos error loudly, same as the other plot nodes. Bin count is a judgment call: too few and you flatten the shape, too many and it's noise - 10 is a fine starting point. And remember the single-series limit; don't expect one node to overlay multiple columns, and don't feed it a column of categories expecting a bar per category - that's a bar chart's job, not a histogram's.

CategoryData Analysis

Inputs (7)

NameTypeDefaultDescription
dataframeDATAFRAME
y_column_nameSTRING
titleSTRING
y_axis_labelSTRING
binsINT102–200
styleSTRING
paletteSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE