ComfyUI Node

PlotSeriesString

Turn a column of numbers into a chart you can actually look at

By TashaSkyUp·Created about a year ago·Updated about a year ago· 1
PlotSeriesString
    • IMAGE
    series1 2 3 4 5 6 7 8 9 10
    titleSeries Plot
    xlabelX-axis
    ylabelY-axis

    The honest reason this node exists: TrainModel hands you a list of per-epoch metrics, and squinting at raw numbers in the JSON view is misery. PlotSeriesString takes a column of numbers, plots them with matplotlib, and hands you back an ordinary ComfyUI IMAGE you can preview, save, or pipe anywhere an image can go. It's the "show me the loss curve" node, and once you're training anything in this pack you'll reach for it constantly.

    It comes from EternalKernel PyTorch Nodes (TashaSkyUp), the pack that stuffs raw PyTorch machine learning into the ComfyUI graph - build an nn.Sequential net node by node, train it, run inference, all visual. PlotSeriesString is the dashboard at the end of that pipeline.

    How it works

    The mechanism is unglamorous and fine. Your series string gets split on newlines, each line is cast to float, and the resulting list is handed to matplotlib.pyplot.plot(). The plot is saved to a PNG buffer, loaded with PIL, and converted to a batch-of-one float tensor in 0–1 range - which is exactly the format ComfyUI's image nodes expect. Output dimensions are (1, H, W, 3).

    Inputs and outputs

    • series (required STRING) - one number per line, e.g. the default 1\n2\n3\n...\n10. This is the only thing that matters.
    • title, xlabel, ylabel (optional) - cosmetic, default to "Series Plot" / "X-axis" / "Y-axis". The X axis is just the index of each value; there's no x-data input.
    • Output: IMAGE - the rendered chart. Wire it to any preview or Save Image node.

    A couple of small truths from the source: anything that isn't a parseable float raises an error mid-run, and the series field is a plain STRING input even though the function also tolerates a Python list. So the practical loop is: run training, copy the metrics out, paste them in. Slightly clunky, but you only do it at the end of a run.

    Installing it

    PlotSeriesString ships with the whole ETK pack, so install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TashaSkyUp/EternalKernelPytorchNodes.git
    cd EternalKernelPytorchNodes
    pip install -r requirements.txt
    

    Restart ComfyUI and the node appears under ETK/pytorch. ComfyUI Manager users can search "EternalKernel PyTorch Nodes" instead - same result. The requirements list pulls in torch, torchvision, numpy, scipy, scikit-learn and a few extras like transformers and coqpit, so it's not a tiny install, but most ComfyUI installs already have the heavy half.

    Troubleshooting

    The one real trap is text in the series: paste a header row or a trailing empty line and you get a float() conversion error with a node full of red. Keep it strictly numbers. And because the pack patches ComfyUI's input validation to ignore return-type mismatches (it does this globally on import), a wrongly-typed input will often fail late and weird rather than clearly - if a plot suddenly throws a cryptic numpy/matplotlib error, check what's actually in your series field first.

    CategoryETK/pytorch

    Inputs (4)

    NameTypeDefaultDescription
    seriesSTRING1 2 3 4 5 6 7 8 9 10
    titleoptSTRINGSeries Plot
    xlabeloptSTRINGX-axis
    ylabeloptSTRINGY-axis

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE