Nodes/ComfyDL/Area Chart
ComfyUI Node

Area Chart

Plot a training curve as a filled area chart, straight from a tensor

By Cynthia-lxx·Created 2 months ago·Updated 2 days ago· 6
Area Chart
  • Y
  • X_vals
  • image
stackedfalse
alpha0.50
color_palettetab10
xlabel
ylabel
figsize_w7.0
figsize_h4.0
labels

CdlAreaChart takes a tensor and renders it as a filled area chart, then hands you back a real ComfyUI IMAGE you can preview or save. If you've ever trained a model and wished the loss curve was visible in the node graph instead of in a separate script, this is the node that closes that gap. It's part of ComfyDL's Visualization category, and it's one of the friendlier ways to see what your training data actually looks like.

How it works

Under the hood it's matplotlib. A single series gets drawn with fill_between; turn on stacked and it switches to stackplot for multiple overlapping series. The tensor goes to numpy, the plot is drawn, and the figure is converted straight to an IMAGE tensor - so unlike a raw cdlTensor, this output wires into ComfyUI's standard PreviewImage / SaveImage nodes with no conversion drama.

The mechanics are simple but worth knowing:

  • Your Y tensor is treated as the series values. If it's 1-D it's reshaped to one series of length T; if it's 2-D, the rows are the series and the columns are the time points.
  • The x-axis defaults to 0, 1, 2, … for each point. Pass the optional X_vals tensor if you want real x positions (epochs, iterations, dates).
  • For stacked, you want Y shaped [series, time] so the stacks pile up correctly.

Inputs and outputs

Required:

  • Y - the cdlTensor of values to plot.
  • stacked - boolean, default off; multi-series mode.
  • alpha - fill transparency (0.1–1.0, default 0.5).
  • color_palette - matplotlib palette name, default tab10.
  • xlabel, ylabel - axis labels, empty by default.
  • figsize_w, figsize_h - figure size in inches (defaults 7×4).

Optional:

  • X_vals - x positions as a cdlTensor.
  • labels - comma-separated series names for the legend in stacked mode.

The one output is image, type IMAGE.

Where you'd use it

The classic use: track a metric over training and watch the curve in the graph - the README's linear-regression example wires residuals and losses into histogram/plot nodes exactly this way. If you've got loss-per-epoch from a ComfyDL training loop, an area chart is a nicer read on the same data than a plain line. Just remember it's a chart of data you already have, not a live training monitor - ComfyUI doesn't stream updates mid-run, you get the chart when the queue item completes.

Installing it

It ships with ComfyDL, so it's one install for all 106 nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Cynthia-lxx/ComfyDL
pip install -r ./ComfyDL/requirements.txt

Then restart ComfyUI - or search "ComfyDL" in ComfyUI Manager. matplotlib is the only dependency this pack adds; the plot nodes in this file all depend on it, and it's the one thing to check if your charts come back empty or throw on import.

Gotchas

  • Feed a 1-D tensor and stacked will just render one series - there's nothing to stack. Use [series, time].
  • Empty input tensors render a polite "No data" placeholder rather than crashing - a nice touch, but it means a blank chart is often a sign your tensor is empty, not broken.
  • labels is comma-separated; mismatched label counts are truncated silently, so double-check you have one label per series.
Categoryd2l/Visualization

Inputs (10)

NameTypeDefaultDescription
YTENSOR
stackedBOOLEANfalse
alphaFLOAT0.500.1–1
color_paletteSTRINGtab10
xlabelSTRING
ylabelSTRING
figsize_wFLOAT7.03–20
figsize_hFLOAT4.02–20
X_valsoptTENSOR
labelsoptSTRING

Outputs (1)

NameTypeDescription
imageIMAGE