ComfyUI Node

NNT Evaluate Predictions

The report card for your model

By inventorado·Created 2 years ago·Updated 2 years ago· 69
NNT Evaluate Predictions
  • MODEL
  • input_data
  • target_data
  • metrics
  • report
task_typeclassification
num_classes10

Training loss going down is nice, but it's not the same as knowing whether your model is actually good. NNT Evaluate Predictions is where you find out: feed it a trained model plus labeled data, and it runs the full evaluation for you - accuracy, per-class accuracy, confusion matrix, and confidence for classification; MSE and MAE for regression. It's the node that turns "I trained a thing" into "I know the thing is 92% accurate, and here's which class it keeps screwing up."

What it actually does

It takes the MODEL, runs it over your input_data with targets in target_data, then computes metrics with the same conventions your training code used. For classification it argmaxes the outputs, compares to the labels, and builds a confusion matrix (via scikit-learn) - the per-class accuracies are where you'll spot the interesting failures, like "it's great at 0s but confuses 4s with 9s." For regression it computes MSE and MAE instead, and also returns the raw predictions versus true values so you can eyeball where it's off. Outputs are a metrics DICT (all the numbers) and a report STRING (a formatted, human-readable summary - this is the one to wire into a text-display node).

Inputs that matter

  • MODEL - the compiled model from NntCompileModel (or loaded via NntLoadModel).
  • input_data / target_data - TENSORs; typically the output of a data loader. For classification, targets are expected as class indices, and the node squeezes and casts them to long integers for you.
  • task_type - classification or regression. Choose wrong and you'll get nonsense metrics, so make the call explicit.
  • num_classes - only used for classification; set it to match your label count.

How it fits the workflow

The natural chain is: NntFileLoader or NntHuggingFaceDataLoaderNntCompileModelNntTrainModel → this node on the held-out split. If you're following the MNIST example in the pack's workflows/ folder, this is the node that gives you the "98.7%" moment. It's an output node (is_output_node), so it's designed to sit at the end of a graph and be read - pair its report with the pack's text-display approach.

Installing NNT

Part of inventorado/ComfyUI_NNT. ComfyUI Manager (search "ComfyUI Neural Network Toolkit") or:

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

Restart ComfyUI after. The requirements include scikit-learn (used for the confusion matrix here) plus a heavy stack around it - torch, pandas, transformers, shap - so the first install is slow. The pack's example workflows also need ComfyUI-Jjk-Nodes for text output; Manager's "Install Missing Custom Nodes" handles that. Remember the author's framing: NNT is a learning toolkit, and this node is its way of making "does it actually work?" tangible.

CategoryNNT Neural Network Toolkit/Models

Inputs (5)

NameTypeDefaultDescription
MODELMODEL
input_dataTENSOR
target_dataTENSOR
task_typeCOMBOclassification2 options: classification, regression
num_classesINT102–1000

Outputs (2)

NameTypeDescription
metricsDICT
reportSTRING