Removed PyTorch wrapper nodes. They were moved to ComfyUI-Py-Wrapper extension.

This commit is contained in:
HowToSD
2025-03-10 15:54:51 -07:00
parent 5fee9ffb60
commit 60692bf9c2
338 changed files with 6 additions and 14298 deletions
+4 -11
View File
@@ -1,9 +1,6 @@
# ComfyUI-Data-Analysis
## Update (March 7, 2025)
You can now use newly added nodes to train a machine learning model for image classification with your own image data **without any coding** from scratch.
Check out [the new tutorial to classify dogs and cats](docs/dog_cat_classification_model_training.md)
## Update (March 10, 2025)
All PyTorch nodes have been moved to a separate extension. If you're using PyTorch wrappers, install the [ComfyUI-Pt-Wrapper extension](https://github.com/HowToSD/ComfyUI-Pt-Wrapper).
---
![Baseball tutorial](docs/images/baseball_question.jpg)
## How Can We Figure Out Which MLB Player Had the Most Hits Per Year?
@@ -22,15 +19,11 @@ I hope you find it useful and engaging for data exploration.
![Baseball tutorial](docs/images/baseball_final.png)
**ComfyUI-Data-Analysis** is an extension for ComfyUI that provides custom nodes for data analysis using Pandas, Seaborn, and Matplotlib within ComfyUI.
Originally designed for structural data analysis, this extension is for you if you:
- Want access to PyTorch's low-level methods (e.g., `add`, `div`, `max`, `where`, `scatter`, `gather`) to manipulate PyTorch tensors or extract information.
- Are comfortable with ComfyUI and want to learn foundational PyTorch methods **without writing a single line of code**.
- Want to analyze structural data (tabular data) using ComfyUI's node system.
Especially, this is suited if you want to analyze structural data (tabular data) using ComfyUI's node system.
## Features
**ComfyUI-Data-Analysis** includes numerous custom nodes that wrap Pandas and PyTorch.
**ComfyUI-Data-Analysis** includes numerous custom nodes that wrap Pandas, Matplotlib and Seaborn.
For a complete list, see the [Node Reference](docs/reference/node_reference.md).
These nodes allow you to conduct complex analyses in an intuitive, graphical way. You can also combine them with other ComfyUI custom nodes to fit your workflow needs (e.g., integrating images).
-318
View File
@@ -171,112 +171,6 @@ from .modules.pandas_wrapper.pandas_var import PandasVar
from .modules.pandas_wrapper.pandas_vertical_concat import PandasVerticalConcat
from .modules.pandas_wrapper.pandas_vertical_split import PandasVerticalSplit
from .modules.pandas_wrapper.pandas_xs import PandasXs
from .modules.pytorch_wrapper.pt_abs import PtAbs
from .modules.pytorch_wrapper.pt_acos import PtAcos
from .modules.pytorch_wrapper.pt_add import PtAdd
from .modules.pytorch_wrapper.pt_arange import PtArange
from .modules.pytorch_wrapper.pt_argmax import PtArgmax
from .modules.pytorch_wrapper.pt_argmin import PtArgmin
from .modules.pytorch_wrapper.pt_asin import PtAsin
from .modules.pytorch_wrapper.pt_atan import PtAtan
from .modules.pytorch_wrapper.pt_bitwise_and import PtBitwiseAnd
from .modules.pytorch_wrapper.pt_bitwise_left_shift import PtBitwiseLeftShift
from .modules.pytorch_wrapper.pt_bitwise_not import PtBitwiseNot
from .modules.pytorch_wrapper.pt_bitwise_or import PtBitwiseOr
from .modules.pytorch_wrapper.pt_bitwise_right_shift import PtBitwiseRightShift
from .modules.pytorch_wrapper.pt_bitwise_xor import PtBitwiseXor
from .modules.pytorch_wrapper.pt_bmm import PtBmm
from .modules.pytorch_wrapper.pt_bool_create import PtBoolCreate
from .modules.pytorch_wrapper.pt_cos import PtCos
from .modules.pytorch_wrapper.pt_cosh import PtCosh
from .modules.pytorch_wrapper.pt_crop import PtCrop
from .modules.pytorch_wrapper.pt_data_loader import PtDataLoader
from .modules.pytorch_wrapper.pt_div import PtDiv
from .modules.pytorch_wrapper.pt_einsum import PtEinsum
from .modules.pytorch_wrapper.pt_eq import PtEq
from .modules.pytorch_wrapper.pt_evaluate_classification_model import PtEvaluateClassificationModel
from .modules.pytorch_wrapper.pt_exp import PtExp
from .modules.pytorch_wrapper.pt_flatten import PtFlatten
from .modules.pytorch_wrapper.pt_float_create import PtFloatCreate
from .modules.pytorch_wrapper.pt_floor_divide import PtFloorDiv
from .modules.pytorch_wrapper.pt_from_image import PtFromImage
from .modules.pytorch_wrapper.pt_from_image_transpose import PtFromImageTranspose
from .modules.pytorch_wrapper.pt_from_latent import PtFromLatent
from .modules.pytorch_wrapper.pt_from_numpy import PtFromNumpy
from .modules.pytorch_wrapper.pt_full import PtFull
from .modules.pytorch_wrapper.pt_gather import PtGather
from .modules.pytorch_wrapper.pt_ge import PtGe
from .modules.pytorch_wrapper.pt_gt import PtGt
from .modules.pytorch_wrapper.pt_index_select import PtIndexSelect
from .modules.pytorch_wrapper.pt_int_create import PtIntCreate
from .modules.pytorch_wrapper.pt_interpolate_by_scale_factor import PtInterpolateByScaleFactor
from .modules.pytorch_wrapper.pt_interpolate_to_size import PtInterpolateToSize
from .modules.pytorch_wrapper.pt_le import PtLe
from .modules.pytorch_wrapper.pt_linspace import PtLinspace
from .modules.pytorch_wrapper.pt_load_model import PtLoadModel
from .modules.pytorch_wrapper.pt_log import PtLog
from .modules.pytorch_wrapper.pt_logical_and import PtLogicalAnd
from .modules.pytorch_wrapper.pt_logical_not import PtLogicalNot
from .modules.pytorch_wrapper.pt_logical_or import PtLogicalOr
from .modules.pytorch_wrapper.pt_logical_xor import PtLogicalXor
from .modules.pytorch_wrapper.pt_lt import PtLt
from .modules.pytorch_wrapper.pt_masked_select import PtMaskedSelect
from .modules.pytorch_wrapper.pt_matmul import PtMatMul
from .modules.pytorch_wrapper.pt_max import PtMax
from .modules.pytorch_wrapper.pt_mean import PtMean
from .modules.pytorch_wrapper.pt_median import PtMedian
from .modules.pytorch_wrapper.pt_min import PtMin
from .modules.pytorch_wrapper.pt_mm import PtMm
from .modules.pytorch_wrapper.pt_mul import PtMul
from .modules.pytorch_wrapper.pt_ne import PtNe
from .modules.pytorch_wrapper.pt_neg import PtNeg
from .modules.pytorch_wrapper.pt_ones import PtOnes
from .modules.pytorch_wrapper.pt_pad import PtPad
from .modules.pytorch_wrapper.pt_permute import PtPermute
from .modules.pytorch_wrapper.pt_pow import PtPow
from .modules.pytorch_wrapper.pt_predict_classification_model import PtPredictClassificationModel
from .modules.pytorch_wrapper.pt_prod import PtProd
from .modules.pytorch_wrapper.pt_rand import PtRand
from .modules.pytorch_wrapper.pt_rand_int import PtRandInt
from .modules.pytorch_wrapper.pt_randn import PtRandn
from .modules.pytorch_wrapper.pt_remainder import PtRemainder
from .modules.pytorch_wrapper.pt_reshape import PtReshape
from .modules.pytorch_wrapper.pt_save_model import PtSaveModel
from .modules.pytorch_wrapper.pt_scatter import PtScatter
from .modules.pytorch_wrapper.pt_show_size import PtShowSize
from .modules.pytorch_wrapper.pt_show_text import PtShowText
from .modules.pytorch_wrapper.pt_sin import PtSin
from .modules.pytorch_wrapper.pt_sinh import PtSinh
from .modules.pytorch_wrapper.pt_size import PtSize
from .modules.pytorch_wrapper.pt_size_create import PtSizeCreate
from .modules.pytorch_wrapper.pt_size_to_numpy import PtSizeToNumpy
from .modules.pytorch_wrapper.pt_size_to_string import PtSizeToString
from .modules.pytorch_wrapper.pt_sqrt import PtSqrt
from .modules.pytorch_wrapper.pt_squeeze import PtSqueeze
from .modules.pytorch_wrapper.pt_std import PtStd
from .modules.pytorch_wrapper.pt_sub import PtSub
from .modules.pytorch_wrapper.pt_sum import PtSum
from .modules.pytorch_wrapper.pt_tan import PtTan
from .modules.pytorch_wrapper.pt_tanh import PtTanh
from .modules.pytorch_wrapper.pt_to_image import PtToImage
from .modules.pytorch_wrapper.pt_to_image_transpose import PtToImageTranspose
from .modules.pytorch_wrapper.pt_to_latent import PtToLatent
from .modules.pytorch_wrapper.pt_to_numpy import PtToNumpy
from .modules.pytorch_wrapper.pt_to_rgb_tensors import PtToRgbTensors
from .modules.pytorch_wrapper.pt_train_classification_model import PtTrainClassificationModel
from .modules.pytorch_wrapper.pt_unsqueeze import PtUnsqueeze
from .modules.pytorch_wrapper.pt_var import PtVar
from .modules.pytorch_wrapper.pt_view import PtView
from .modules.pytorch_wrapper.pt_where import PtWhere
from .modules.pytorch_wrapper.pt_zeros import PtZeros
from .modules.pytorch_wrapper.ptn_conv_model import PtnConvModel
from .modules.pytorch_wrapper.ptn_linear_model import PtnLinearModel
from .modules.pytorch_wrapper.pto_adam import PtoAdam
from .modules.pytorch_wrapper.ptv_dataset import PtvDataset
from .modules.pytorch_wrapper.ptv_dataset_loader import PtvDatasetLoader
from .modules.pytorch_wrapper.ptv_image_folder_dataset import PtvImageFolderDataset
from .modules.pytorch_wrapper.ptv_transforms_resize import PtvTransformsResize
from .modules.pytorch_wrapper.ptv_transforms_to_tensor import PtvTransformsToTensor
from .modules.seaborn_wrapper.sns_bar import SNSBar
from .modules.seaborn_wrapper.sns_boxplot import SNSBoxplot
from .modules.seaborn_wrapper.sns_heatmap import SNSHeatmap
@@ -453,112 +347,6 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = {
"PandasVerticalConcat": PandasVerticalConcat,
"PandasVerticalSplit": PandasVerticalSplit,
"PandasXs": PandasXs,
"PtAbs": PtAbs,
"PtAcos": PtAcos,
"PtAdd": PtAdd,
"PtArange": PtArange,
"PtArgmax": PtArgmax,
"PtArgmin": PtArgmin,
"PtAsin": PtAsin,
"PtAtan": PtAtan,
"PtBitwiseAnd": PtBitwiseAnd,
"PtBitwiseLeftShift": PtBitwiseLeftShift,
"PtBitwiseNot": PtBitwiseNot,
"PtBitwiseOr": PtBitwiseOr,
"PtBitwiseRightShift": PtBitwiseRightShift,
"PtBitwiseXor": PtBitwiseXor,
"PtBmm": PtBmm,
"PtBoolCreate": PtBoolCreate,
"PtCos": PtCos,
"PtCosh": PtCosh,
"PtCrop": PtCrop,
"PtDataLoader": PtDataLoader,
"PtDiv": PtDiv,
"PtEinsum": PtEinsum,
"PtEq": PtEq,
"PtEvaluateClassificationModel": PtEvaluateClassificationModel,
"PtExp": PtExp,
"PtFlatten": PtFlatten,
"PtFloatCreate": PtFloatCreate,
"PtFloorDiv": PtFloorDiv,
"PtFromImage": PtFromImage,
"PtFromImageTranspose": PtFromImageTranspose,
"PtFromLatent": PtFromLatent,
"PtFromNumpy": PtFromNumpy,
"PtFull": PtFull,
"PtGather": PtGather,
"PtGe": PtGe,
"PtGt": PtGt,
"PtIndexSelect": PtIndexSelect,
"PtIntCreate": PtIntCreate,
"PtInterpolateByScaleFactor": PtInterpolateByScaleFactor,
"PtInterpolateToSize": PtInterpolateToSize,
"PtLe": PtLe,
"PtLinspace": PtLinspace,
"PtLoadModel": PtLoadModel,
"PtLog": PtLog,
"PtLogicalAnd": PtLogicalAnd,
"PtLogicalNot": PtLogicalNot,
"PtLogicalOr": PtLogicalOr,
"PtLogicalXor": PtLogicalXor,
"PtLt": PtLt,
"PtMaskedSelect": PtMaskedSelect,
"PtMatMul": PtMatMul,
"PtMax": PtMax,
"PtMean": PtMean,
"PtMedian": PtMedian,
"PtMin": PtMin,
"PtMm": PtMm,
"PtMul": PtMul,
"PtNe": PtNe,
"PtNeg": PtNeg,
"PtOnes": PtOnes,
"PtPad": PtPad,
"PtPermute": PtPermute,
"PtPow": PtPow,
"PtPredictClassificationModel": PtPredictClassificationModel,
"PtProd": PtProd,
"PtRand": PtRand,
"PtRandInt": PtRandInt,
"PtRandn": PtRandn,
"PtRemainder": PtRemainder,
"PtReshape": PtReshape,
"PtSaveModel": PtSaveModel,
"PtScatter": PtScatter,
"PtShowSize": PtShowSize,
"PtShowText": PtShowText,
"PtSin": PtSin,
"PtSinh": PtSinh,
"PtSize": PtSize,
"PtSizeCreate": PtSizeCreate,
"PtSizeToNumpy": PtSizeToNumpy,
"PtSizeToString": PtSizeToString,
"PtSqrt": PtSqrt,
"PtSqueeze": PtSqueeze,
"PtStd": PtStd,
"PtSub": PtSub,
"PtSum": PtSum,
"PtTan": PtTan,
"PtTanh": PtTanh,
"PtToImage": PtToImage,
"PtToImageTranspose": PtToImageTranspose,
"PtToLatent": PtToLatent,
"PtToNumpy": PtToNumpy,
"PtToRgbTensors": PtToRgbTensors,
"PtTrainClassificationModel": PtTrainClassificationModel,
"PtUnsqueeze": PtUnsqueeze,
"PtVar": PtVar,
"PtView": PtView,
"PtWhere": PtWhere,
"PtZeros": PtZeros,
"PtnConvModel": PtnConvModel,
"PtnLinearModel": PtnLinearModel,
"PtoAdam": PtoAdam,
"PtvDataset": PtvDataset,
"PtvDatasetLoader": PtvDatasetLoader,
"PtvImageFolderDataset": PtvImageFolderDataset,
"PtvTransformsResize": PtvTransformsResize,
"PtvTransformsToTensor": PtvTransformsToTensor,
"PyDatetimeToString": PyDatetimeToString,
"PyFloatToString": PyFloatToString,
"PyIntToString": PyIntToString,
@@ -746,112 +534,6 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = {
"PandasVerticalConcat": "Pandas Vertical Concat",
"PandasVerticalSplit": "Pandas Vertical Split",
"PandasXs": "Pandas Xs",
"PtAbs": "Pt Abs",
"PtAcos": "Pt Acos",
"PtAdd": "Pt Add",
"PtArange": "Pt Arange",
"PtArgmax": "Pt Argmax",
"PtArgmin": "Pt Argmin",
"PtAsin": "Pt Asin",
"PtAtan": "Pt Atan",
"PtBitwiseAnd": "Pt Bitwise And",
"PtBitwiseLeftShift": "Pt Bitwise Left Shift",
"PtBitwiseNot": "Pt Bitwise Not",
"PtBitwiseOr": "Pt Bitwise Or",
"PtBitwiseRightShift": "Pt Bitwise Right Shift",
"PtBitwiseXor": "Pt Bitwise Xor",
"PtBmm": "Pt Bmm",
"PtBoolCreate": "Pt Bool Create",
"PtCos": "Pt Cos",
"PtCosh": "Pt Cosh",
"PtCrop": "Pt Crop",
"PtDataLoader": "Pt Data Loader",
"PtDiv": "Pt Div",
"PtEinsum": "Pt Einsum",
"PtEq": "Pt Eq",
"PtEvaluateClassificationModel": "Pt Evaluate Classification Model",
"PtExp": "Pt Exp",
"PtFlatten": "Pt Flatten",
"PtFloatCreate": "Pt Float Create",
"PtFloorDiv": "Pt Floor Div",
"PtFromImage": "Pt From Image",
"PtFromImageTranspose": "Pt From Image Transpose",
"PtFromLatent": "Pt From Latent",
"PtFromNumpy": "Pt From Numpy",
"PtFull": "Pt Full",
"PtGather": "Pt Gather",
"PtGe": "Pt Ge",
"PtGt": "Pt Gt",
"PtIndexSelect": "Pt Index Select",
"PtIntCreate": "Pt Int Create",
"PtInterpolateByScaleFactor": "Pt Interpolate By Scale Factor",
"PtInterpolateToSize": "Pt Interpolate To Size",
"PtLe": "Pt Le",
"PtLinspace": "Pt Linspace",
"PtLoadModel": "Pt Load Model",
"PtLog": "Pt Log",
"PtLogicalAnd": "Pt Logical And",
"PtLogicalNot": "Pt Logical Not",
"PtLogicalOr": "Pt Logical Or",
"PtLogicalXor": "Pt Logical Xor",
"PtLt": "Pt Lt",
"PtMaskedSelect": "Pt Masked Select",
"PtMatMul": "Pt Mat Mul",
"PtMax": "Pt Max",
"PtMean": "Pt Mean",
"PtMedian": "Pt Median",
"PtMin": "Pt Min",
"PtMm": "Pt Mm",
"PtMul": "Pt Mul",
"PtNe": "Pt Ne",
"PtNeg": "Pt Neg",
"PtOnes": "Pt Ones",
"PtPad": "Pt Pad",
"PtPermute": "Pt Permute",
"PtPow": "Pt Pow",
"PtPredictClassificationModel": "Pt Predict Classification Model",
"PtProd": "Pt Prod",
"PtRand": "Pt Rand",
"PtRandInt": "Pt Rand Int",
"PtRandn": "Pt Randn",
"PtRemainder": "Pt Remainder",
"PtReshape": "Pt Reshape",
"PtSaveModel": "Pt Save Model",
"PtScatter": "Pt Scatter",
"PtShowSize": "Pt Show Size",
"PtShowText": "Pt Show Text",
"PtSin": "Pt Sin",
"PtSinh": "Pt Sinh",
"PtSize": "Pt Size",
"PtSizeCreate": "Pt Size Create",
"PtSizeToNumpy": "Pt Size To Numpy",
"PtSizeToString": "Pt Size To String",
"PtSqrt": "Pt Sqrt",
"PtSqueeze": "Pt Squeeze",
"PtStd": "Pt Std",
"PtSub": "Pt Sub",
"PtSum": "Pt Sum",
"PtTan": "Pt Tan",
"PtTanh": "Pt Tanh",
"PtToImage": "Pt To Image",
"PtToImageTranspose": "Pt To Image Transpose",
"PtToLatent": "Pt To Latent",
"PtToNumpy": "Pt To Numpy",
"PtToRgbTensors": "Pt To Rgb Tensors",
"PtTrainClassificationModel": "Pt Train Classification Model",
"PtUnsqueeze": "Pt Unsqueeze",
"PtVar": "Pt Var",
"PtView": "Pt View",
"PtWhere": "Pt Where",
"PtZeros": "Pt Zeros",
"PtnConvModel": "Ptn Conv Model",
"PtnLinearModel": "Ptn Linear Model",
"PtoAdam": "Pto Adam",
"PtvDataset": "Ptv Dataset",
"PtvDatasetLoader": "Ptv Dataset Loader",
"PtvImageFolderDataset": "Ptv Image Folder Dataset",
"PtvTransformsResize": "Ptv Transforms Resize",
"PtvTransformsToTensor": "Ptv Transforms To Tensor",
"PyDatetimeToString": "Py Datetime To String",
"PyFloatToString": "Py Float To String",
"PyIntToString": "Py Int To String",
@@ -1,137 +0,0 @@
# Dog cat classification model training tutorial
This tutorial covers how to use **ComfyUI Data Analysis** to train an image classification model with your own image dataset.
We'll use a **dog and cat image dataset** created specifically for this tutorial, which is available publicly on [my GitHub repo](https://github.com/HowToSD/dog_and_cat_dataset).
Once you complete the tutorial, you can experiment with your own images.
**Disclaimer:** The model architecture is a traditional convolutional neural network (CNN) and is **not state-of-the-art**. This choice keeps the model small, enabling faster training and easier explanation.
---
## Overview of Steps
1. Downloading the dog and cat dataset from the GitHub repo
2. Edit the training workflow
3. Run the training workflow
4. Edit the evaluation workflow
5. Run the evaluation workflow
---
## 1. Download the Dog & Cat Dataset
Visit [the GitHub repo](https://github.com/HowToSD/dog_and_cat_dataset) and go to the **Releases** page.
Click **"Source code (zip)"** to download the zip that contains all the images.
Extract the ZIP file using an unarchiver.
The dataset follows this directory structure:
```
dog_and_cat
train
cats
dogs
val
cats
dogs
```
Take note of the **full paths** to the `train` and `val` directories, as you'll need them in the next step.
---
## 2. Editing the Training Workflow
Drag and drop the below file into ComfyUI:
```
examples/workflow/dog_cat_classification_train_model.json
```
Some nodes will be marked red, indicating they require edits.
The only required changes are the **train** and **val** dataset paths.
Replace them with the paths noted earlier.
---
## 3. Running the Training Workflow
Click **Queue** to start training.
Monitor the console for errors. If training runs smoothly, you should see output like this:
```
Epoch (train) 1/20, Loss: 0.6865
Epoch (val) 1/20, Loss: 0.6801
Epoch (train) 2/20, Loss: 0.6216
Epoch (val) 2/20, Loss: 0.5710
Epoch (train) 3/20, Loss: 0.4998
Epoch (val) 3/20, Loss: 0.4716
Epoch (train) 4/20, Loss: 0.3827
Epoch (val) 4/20, Loss: 0.4045
Epoch (train) 5/20, Loss: 0.2897
Epoch (val) 5/20, Loss: 0.3297
Epoch (train) 6/20, Loss: 0.2243
Epoch (val) 6/20, Loss: 0.2925
Epoch (train) 7/20, Loss: 0.1603
Epoch (val) 7/20, Loss: 0.2916
Epoch (train) 8/20, Loss: 0.1102
Epoch (val) 8/20, Loss: 0.3216
Epoch (train) 9/20, Loss: 0.0916
Epoch (val) 9/20, Loss: 0.2706
Epoch (train) 10/20, Loss: 0.0522
Epoch (val) 10/20, Loss: 0.2220
Epoch (train) 11/20, Loss: 0.0481
Epoch (val) 11/20, Loss: 0.2820
Epoch (train) 12/20, Loss: 0.0228
Epoch (val) 12/20, Loss: 0.2899
Epoch (train) 13/20, Loss: 0.0130
Epoch (val) 13/20, Loss: 0.3056
Epoch (train) 14/20, Loss: 0.0137
Epoch (val) 14/20, Loss: 0.3070
Epoch (train) 15/20, Loss: 0.0200
Epoch (val) 15/20, Loss: 0.2714
Epoch (train) 16/20, Loss: 0.0313
Epoch (val) 16/20, Loss: 0.3108
Epoch (train) 17/20, Loss: 0.0125
Epoch (val) 17/20, Loss: 0.3388
Epoch (train) 18/20, Loss: 0.0174
Epoch (val) 18/20, Loss: 0.2989
Epoch (train) 19/20, Loss: 0.0017
Epoch (val) 19/20, Loss: 0.3165
Epoch (train) 20/20, Loss: 0.0009
Epoch (val) 20/20, Loss: 0.3582
Prompt executed in 253.64 seconds
```
If you encounter an error:
- Ensure dataset paths are correct.
- Reduce **batch size** if your GPU runs out of memory (OOM error).
Once training completes, a **line chart** displaying training progress will appear at the bottom right of the canvas. You don’t need to interpret it initially.
---
## 4. Editing the Evaluation Workflow
Now, let's verify if the model was trained correctly. In this step, we'll feed the validation data into the trained model and compute metrics to assess its performance.
Drag and drop the below file into ComfyUI:
```
examples/workflow/dog_cat_classification_eval_model.json
```
into **ComfyUI**.
Update the **val dataset path**.
---
## 5. Running the Evaluation Workflow
Click **Queue**. The evaluation process runs much faster than training.
Check the **Accuracy** node—it should display a value around **0.9**, confirming successful model training.
Congratulations! You’ve successfully trained a machine learning model from scratch without writing a single line of code.
Now, you can use your own images to train the model in the same way.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

-49
View File
@@ -1,49 +0,0 @@
# Model Training
Experimental PyTorch model training has been added.
No coding is required. Training is as simple as a single click!
Currently, only classification is supported.
The system is designed to be modular. For example, to switch from a linear model to a convolutional model, you only need to replace the model node (see screenshot below).
You can choose to:
* Use your own images
* Use a public dataset
## Using Your Own Images
Check out [the dog and cat classification tutorial](dog_cat_classification_model_training.md).
## Public Datasets
Currently, only Fashion MNIST has been tested. Other public datasets have not been verified yet, though they may work.
If you try one and it doesn't work, please create an issue so I can investigate adding support.
To use the Fashion MNIST dataset, simply drag and drop the workflow files below into ComfyUI. The model will be downloaded automatically.
Linear model
* Training: examples/fashion_mnist_train.json
* Evaluation: examples/fashion_mnist_eval.json
Convolutional model
* Training: examples/fashion_mnist_train_conv.json
* Evaluation: examples/fashion_mnist_eval_conv.json
These training workflows train a FashionMNIST model from scratch effortlessly.
### Training workflow
**Linear model**
![Train](images/fashion_mnist_train.png)
**Conv model**
![Train](images/conv_train.png)
*Close up of the conv node*
![Train](images/conv_train2.png)
### Eval workflow
**Linear model**
![Eval](images/fashion_mnist_eval.png)
**Conv model**
![Eval](images/conv_eval.png)
-148
View File
@@ -99,8 +99,6 @@
| [Pandas Show Series](pandas_show_series.md) | Displays a Pandas Series as text. |
| [Pandas Show Text](pandas_show_text.md) | Displays a string. |
| [Pandas To String](pandas_to_string.md) | Converts a pandas DataFrame to a string representation. |
| [Pt Show Size](pt_show_size.md) | Displays PyTorch Size object as a string. |
| [Pt Show Text](pt_show_text.md) | Displays PyTorch tensor as a string. Note that the tensor is partially printed out when |
## IO
| Node | Description |
| --- | --- |
@@ -127,7 +125,6 @@
| [Pandas Load JSON](pandas_load_json.md) | Loads JSON files into a pandas DataFrame. |
| [Pandas Save CSV](pandas_save_csv.md) | Saves a PandasDataFrame to a CSV file. |
| [Pandas Save JSON](pandas_save_json.md) | Saves a PandasDataFrame to a JSON file. |
| [Pt Save Model](pt_save_model.md) | A wrapper class for saving a PyTorch model. |
## Logical operations
| Node | Description |
| --- | --- |
@@ -178,151 +175,6 @@
| [SNS Line Plot](sns_line.md) | Generates a line plot from a pandas DataFrame using Seaborn. |
| [SNS Pairplot](sns_pairplot.md) | Generates a pairplot from a Pandas DataFrame using Seaborn. |
| [SNS Scatter Plot](sns_scatter.md) | Generates a scatter plot from a pandas DataFrame using Seaborn. |
## PyTorch wrapper - Arithmetic operations
| Node | Description |
| --- | --- |
| [Pt Add](pt_add.md) | Adds two PyTorch tensors. |
| [Pt Div](pt_div.md) | Divides one PyTorch tensor by another element-wise. |
| [Pt Floor Div](pt_floor_divide.md) | Performs element-wise floor division on two PyTorch tensors. |
| [Pt Mul](pt_mul.md) | Multiplies two PyTorch tensors element-wise. |
| [Pt Pow](pt_pow.md) | Raises one PyTorch tensor to the power of another element-wise. |
| [Pt Remainder](pt_remainder.md) | Computes the element-wise remainder of division between two PyTorch tensors. |
| [Pt Sub](pt_sub.md) | Subtracts one PyTorch tensor from another. |
## PyTorch wrapper - Bitwise operations
| Node | Description |
| --- | --- |
| [Pt Bitwise And](pt_bitwise_and.md) | Performs a bitwise AND operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Left Shift](pt_bitwise_left_shift.md) | Performs a bitwise left shift operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Not](pt_bitwise_not.md) | Performs a bitwise NOT operation on a PyTorch tensor element-wise. |
| [Pt Bitwise Or](pt_bitwise_or.md) | Performs a bitwise OR operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Right Shift](pt_bitwise_right_shift.md) | Performs a bitwise right shift operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Xor](pt_bitwise_xor.md) | Performs a bitwise XOR operation on two PyTorch tensors element-wise. |
## PyTorch wrapper - Comparison operations
| Node | Description |
| --- | --- |
| [Pt Eq](pt_eq.md) | Tests whether two PyTorch tensors are equal element-wise. |
| [Pt Ge](pt_ge.md) | Tests whether elements in the first PyTorch tensor are greater than or equal to the corresponding elements in the second tensor. |
| [Pt Gt](pt_gt.md) | Tests whether elements in the first PyTorch tensor are greater than the corresponding elements in the second tensor. |
| [Pt Le](pt_le.md) | Tests whether elements in the first PyTorch tensor are less than or equal to the corresponding elements in the second tensor. |
| [Pt Lt](pt_lt.md) | Tests whether elements in the first PyTorch tensor are less than the corresponding elements in the second tensor. |
| [Pt Ne](pt_ne.md) | Tests whether two PyTorch tensors are not equal element-wise. |
## PyTorch wrapper - Image processing
| Node | Description |
| --- | --- |
| [Pt Crop](pt_crop.md) | Crops a PyTorch tensor to the specified size. The input tensor must have a shape of (c, h, w) or (b, c, h, w). |
| [Pt From Image](pt_from_image.md) | Casts an Image tensor as a PyTorch tensor. |
| [Pt From Image Transpose](pt_from_image_transpose.md) | Casts an image tensor to a PyTorch tensor and transposes it from (H, W, C) to (C, H, W). For rank-4 inputs, the batch axis remains unchanged. |
| [Pt Interpolate By Scale Factor](pt_interpolate_by_scale_factor.md) | Resizes a PyTorch tensor using interpolation by scale factor. The input tensor must have a shape of (c, h, w) or (b, c, h, w). |
| [Pt Interpolate To Size](pt_interpolate_to_size.md) | Resizes a PyTorch tensor using interpolation. The input tensor must have a shape of (c, h, w) or (b, c, h, w). |
| [Pt Pad](pt_pad.md) | Pads a PyTorch tensor to the specified size. Padded area will be black. The input tensor must have a shape of (c, h, w) or (b, c, h, w). |
| [Pt To Image](pt_to_image.md) | Casts a PyTorch tensor as an Image tensor. |
| [Pt To Image Transpose](pt_to_image_transpose.md) | Casts a PyTorch tensor as an Image tensor and transposes it from (C, H, W) to (H, W, C). For rank-4 inputs, the batch axis remains unchanged. |
## PyTorch wrapper - Indexing and Slicing Operations
| Node | Description |
| --- | --- |
| [Pt Gather](pt_gather.md) | Generates a tensor based on the index tensor using PyTorch's `gather` function. |
| [Pt Index Select](pt_index_select.md) | Extracts elements from the input tensor along a specified dimension using an index tensor. |
| [Pt Masked Select](pt_masked_select.md) | Extracts elements from the input tensor whose corresponding value in `masked_tens` is `True`. |
| [Pt Scatter](pt_scatter.md) | Generates a new tensor by replacing values at specified positions using an index tensor. |
| [Pt Where](pt_where.md) | Generates a new tensor by selecting values based on a condition tensor. |
## PyTorch wrapper - Logical operations
| Node | Description |
| --- | --- |
| [Pt Logical And](pt_logical_and.md) | Performs a logical AND operation on two PyTorch tensors element-wise. |
| [Pt Logical Not](pt_logical_not.md) | Performs a logical NOT operation on a PyTorch tensor element-wise. |
| [Pt Logical Or](pt_logical_or.md) | Performs a logical OR operation on two PyTorch tensors element-wise. |
| [Pt Logical Xor](pt_logical_xor.md) | Performs a logical XOR operation on two PyTorch tensors element-wise. |
## PyTorch wrapper - Math operations
| Node | Description |
| --- | --- |
| [Pt Abs](pt_abs.md) | Computes the absolute value of each element in a PyTorch tensor. |
| [Pt Acos](pt_acos.md) | Computes the arccosine (inverse cosine) of a PyTorch tensor element-wise. |
| [Pt Asin](pt_asin.md) | Computes the arcsine (inverse sine) of a PyTorch tensor element-wise. |
| [Pt Atan](pt_atan.md) | Computes the arc tangent (inverse tangent) of a PyTorch tensor element-wise. |
| [Pt Cos](pt_cos.md) | Computes the cosine of a PyTorch tensor element-wise. |
| [Pt Cosh](pt_cosh.md) | Computes the hyperbolic cosine of a PyTorch tensor element-wise. |
| [Pt Exp](pt_exp.md) | Performs an exponential operation on a PyTorch tensor element-wise. |
| [Pt Log](pt_log.md) | Computes the natural logarithm (log base e) of a PyTorch tensor element-wise. |
| [Pt Neg](pt_neg.md) | Computes the negation of each element in a PyTorch tensor. |
| [Pt Sin](pt_sin.md) | Computes the sine of a PyTorch tensor element-wise. |
| [Pt Sinh](pt_sinh.md) | Computes the hyperbolic sine of a PyTorch tensor element-wise. |
| [Pt Sqrt](pt_sqrt.md) | Computes the square root of each element in a PyTorch tensor. |
| [Pt Tan](pt_tan.md) | Computes the tangent of a PyTorch tensor element-wise. |
| [Pt Tanh](pt_tanh.md) | Computes the hyperbolic tangent of a PyTorch tensor element-wise. |
## PyTorch wrapper - Matrix operations
| Node | Description |
| --- | --- |
| [Pt Bmm](pt_bmm.md) | Performs batched matrix multiplication on two 3D PyTorch tensors. |
| [Pt Einsum](pt_einsum.md) | Performs Tensor operations specified in the Einstein summation equation. |
| [Pt Mat Mul](pt_matmul.md) | Performs matrix multiplication on two PyTorch tensors. |
| [Pt Mm](pt_mm.md) | Performs 2D matrix multiplication on two PyTorch tensors. |
## PyTorch wrapper - Reduction operation & Summary statistics
| Node | Description |
| --- | --- |
| [Pt Argmax](pt_argmax.md) | Computes the indices of the maximum values of a PyTorch tensor along the specified dimension(s). |
| [Pt Argmin](pt_argmin.md) | Computes the indices of the minimum values of a PyTorch tensor along the specified dimension(s). |
| [Pt Max](pt_max.md) | Computes the maximum values of a PyTorch tensor along the specified dimension(s). |
| [Pt Mean](pt_mean.md) | Computes the mean of a PyTorch tensor along the specified dimension(s). |
| [Pt Median](pt_median.md) | Computes the median of a PyTorch tensor along the specified dimension(s). |
| [Pt Min](pt_min.md) | Computes the minimum values of a PyTorch tensor along the specified dimension(s). |
| [Pt Prod](pt_prod.md) | Computes the product of a PyTorch tensor along the specified dimension(s). |
| [Pt Std](pt_std.md) | Computes the standard deviation of a PyTorch tensor along the specified dimension(s). |
| [Pt Sum](pt_sum.md) | Computes the sum of a PyTorch tensor along the specified dimension(s). |
| [Pt Var](pt_var.md) | Computes the variance of a PyTorch tensor along the specified dimension(s). |
## PyTorch wrapper - Size object support
| Node | Description |
| --- | --- |
| [Pt Size](pt_size.md) | Extracts the PyTorch Size object of a PyTorch tensor using the size() method. |
| [Pt Size Create](pt_size_create.md) | Creates a PyTorch Size using values entered in the text field. |
| [Pt Size To Numpy](pt_size_to_numpy.md) | Converts PyTorch Size object to NumPy ndarray. |
| [Pt Size To String](pt_size_to_string.md) | Converts PyTorch Size object to a Python string. |
## PyTorch wrapper - Tensor creation
| Node | Description |
| --- | --- |
| [Pt Arange](pt_arange.md) | Creates a PyTorch tensor using `torch.arange` with the specified start, end, and step values. |
| [Pt Bool Create](pt_bool_create.md) | Creates a PyTorch tensor of dtype bool from True or False values entered as a list in the text field. |
| [Pt Float Create](pt_float_create.md) | Creates a PyTorch tensor with 32-bit floating point precision |
| [Pt From Latent](pt_from_latent.md) | Casts a latent tensor as a PyTorch tensor. |
| [Pt From Numpy](pt_from_numpy.md) | Converts a NumPy ndarray to a PyTorch tensor while preserving its data type. |
| [Pt Full](pt_full.md) | Creates a PyTorch tensor filled with a specified value using the size entered in the text field. |
| [Pt Int Create](pt_int_create.md) | Creates a PyTorch tensor with 32-bit integer |
| [Pt Linspace](pt_linspace.md) | Creates a PyTorch tensor using `torch.linspace` with the specified start, end, and steps values. |
| [Pt Ones](pt_ones.md) | Creates a PyTorch tensor of ones using the size entered in the text field. |
| [Pt Rand](pt_rand.md) | Creates a PyTorch tensor with values sampled from a uniform distribution |
| [Pt Rand Int](pt_rand_int.md) | Creates a PyTorch tensor filled with random integers within a specified range using the size entered in the text field. |
| [Pt Randn](pt_randn.md) | Creates a PyTorch tensor with values sampled from a standard normal distribution (mean=0, std=1) |
| [Pt Zeros](pt_zeros.md) | Creates a PyTorch tensor of zeros using the size entered in the text field. |
## PyTorch wrapper - Tensor data conversion
| Node | Description |
| --- | --- |
| [Pt To Latent](pt_to_latent.md) | Casts a PyTorch tensor as a latent tensor. |
| [Pt To Numpy](pt_to_numpy.md) | Converts PyTorch tensor to NumPy ndarray. |
| [Pt To Rgb Tensors](pt_to_rgb_tensors.md) | Splits a PyTorch tensor into R, G, and B tensors. |
## PyTorch wrapper - Training
| Node | Description |
| --- | --- |
| [Pt Data Loader](pt_data_loader.md) | Loads data from a dataset node and creates a PyTorch DataLoader. |
| [Pt Evaluate Classification Model](pt_evaluate_classification_model.md) | Performs inference on test data and computes evaluation metrics. |
| [Pt Load Model](pt_load_model.md) | A wrapper class for saving a PyTorch model. |
| [Pt Predict Classification Model](pt_predict_classification_model.md) | Performs inference on input data. |
| [Pt Train Classification Model](pt_train_classification_model.md) | Trains a classification model using a given dataset, optimizer, and number of epochs. |
| [Ptn Conv Model](ptn_conv_model.md) | A convolutional model consisting of multiple convolutional layers. |
| [Ptn Linear Model](ptn_linear_model.md) | A linear model consisting of dense layers. |
| [Pto Adam](pto_adam.md) | Instantiates the Adam optimizer. |
| [Ptv Dataset](ptv_dataset.md) | A Torchvision Dataset class wrapper. |
| [Ptv Dataset Loader](ptv_dataset_loader.md) | A node to combine the dataset and data loader into a single node. |
| [Ptv Image Folder Dataset](ptv_image_folder_dataset.md) | A Torchvision ImageFolder Dataset class wrapper. |
| [Ptv Transforms Resize](ptv_transforms_resize.md) | Resizes and transforms elements of dataset to PyTorch tensors. |
| [Ptv Transforms To Tensor](ptv_transforms_to_tensor.md) | Transforms elements of dataset to PyTorch tensors. |
## PyTorch wrapper - Transform
| Node | Description |
| --- | --- |
| [Pt Flatten](pt_flatten.md) | Flattens a PyTorch tensor into a 1D tensor. |
| [Pt Permute](pt_permute.md) | Permutes the dimensions of a PyTorch tensor according to the specified order. |
| [Pt Reshape](pt_reshape.md) | Reshapes a PyTorch tensor into a specified shape using `torch.reshape()`. |
| [Pt Squeeze](pt_squeeze.md) | Removes a dimension at the specified position in the input tensor if it is of size 1. |
| [Pt Unsqueeze](pt_unsqueeze.md) | Adds a singleton dimension at the specified position in the input tensor. |
| [Pt View](pt_view.md) | Reshapes a PyTorch tensor into a specified shape using `torch.view()`. |
## Python wrapper
| Node | Description |
| --- | --- |
-17
View File
@@ -1,17 +0,0 @@
# Pt Abs
Computes the absolute value of each element in a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Acos
Computes the arccosine (inverse cosine) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Add
Adds two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-23
View File
@@ -1,23 +0,0 @@
# Pt Arange
Creates a PyTorch tensor using `torch.arange` with the specified start, end, and step values.
The values are parsed from string inputs and converted to numeric types. This allows users to specify
tensor range values in text fields. The function also ensures proper dtype selection.
## Input
| Name | Data type |
|---|---|
| start | String |
| end | String |
| step | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Argmax
Computes the indices of the maximum values of a PyTorch tensor along the specified dimension(s).
Specify the dimension in the `dim` field using an integer as shown below:
```
0
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Argmin
Computes the indices of the minimum values of a PyTorch tensor along the specified dimension(s).
Specify the dimension in the `dim` field using an integer as shown below:
```
0
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Asin
Computes the arcsine (inverse sine) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Atan
Computes the arc tangent (inverse tangent) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Bitwise And
Performs a bitwise AND operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Bitwise Left Shift
Performs a bitwise left shift operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Bitwise Not
Performs a bitwise NOT operation on a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Bitwise Or
Performs a bitwise OR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Bitwise Right Shift
Performs a bitwise right shift operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Bitwise Xor
Performs a bitwise XOR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Bmm
Performs batched matrix multiplication on two 3D PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-22
View File
@@ -1,22 +0,0 @@
# Pt Bool Create
Creates a PyTorch tensor of dtype bool from True or False values entered as a list in the text field.
For example, entering:
```
[True, False, False]
```
will create a 1D boolean tensor.
## Input
| Name | Data type |
|---|---|
| data | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Cos
Computes the cosine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Cosh
Computes the hyperbolic cosine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-23
View File
@@ -1,23 +0,0 @@
# Pt Crop
Crops a PyTorch tensor to the specified size. The input tensor must have a shape of (c, h, w) or (b, c, h, w).
In ComfyUI Analysis, the tensor data type is "TENSOR," while in ComfyUI, the type "IMAGE" is used. To pass image data from ComfyUI to a ComfyUI Analysis node (e.g., this interpolation node), first use the "Pt From Image" node to convert it to a tensor, then transpose the axes from (b, h, w, c) to (b, c, h, w) before passing it to this node.
This transposition can be performed using the "Pt Permute" node with (0, 2, 3, 1). To convert the output back to an image, apply "Pt Permute" with (0, 3, 1, 2) and then use the "Pt To Image" node.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| height | Int |
| width | Int |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-29
View File
@@ -1,29 +0,0 @@
# Pt Data Loader
Loads data from a dataset node and creates a PyTorch DataLoader.
**dataset**
Connect a PtvDataset node that provides the dataset.
**batch size**
Specifies the number of samples per batch.
**shuffle**
If True, shuffles the dataset before each epoch.
## Input
| Name | Data type |
|---|---|
| dataset | Ptvdataset |
| batch_size | Int |
| shuffle | Boolean |
| parameters | String |
## Output
| Data type |
|---|
| Ptdataloader |
<HR>
Category: PyTorch wrapper - Training
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Div
Divides one PyTorch tensor by another element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-26
View File
@@ -1,26 +0,0 @@
# Pt Einsum
Performs Tensor operations specified in the Einstein summation equation.
Specify Einstein summation notation in the first socket.
Specify two tensors in tens_a, tens_b. If you specify the third tensor, specify in tens_c.
Otherwise, leave the socket unconnected.
Sublist format is not supported.
## Input
| Name | Data type |
|---|---|
| equation | String |
| tens_a | Tensor |
| tens_b | Tensor |
| tens_c | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Eq
Tests whether two PyTorch tensors are equal element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
@@ -1,23 +0,0 @@
# Pt Evaluate Classification Model
Performs inference on test data and computes evaluation metrics.
## Input
| Name | Data type |
|---|---|
| model | Ptmodel |
| data_loader | Ptdataloader |
| use_gpu | Boolean |
## Output
| Data type |
|---|
| Float |
| Float |
| Float |
| Float |
| Int |
<HR>
Category: PyTorch wrapper - Training
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Exp
Performs an exponential operation on a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Flatten
Flattens a PyTorch tensor into a 1D tensor.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Transform
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Float Create
Creates a PyTorch tensor with 32-bit floating point precision
using values entered in the text field.
## Input
| Name | Data type |
|---|---|
| data | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Floor Div
Performs element-wise floor division on two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt From Image
Casts an Image tensor as a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| image | Image |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt From Image Transpose
Casts an image tensor to a PyTorch tensor and transposes it from (H, W, C) to (C, H, W). For rank-4 inputs, the batch axis remains unchanged.
## Input
| Name | Data type |
|---|---|
| image | Image |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt From Latent
Casts a latent tensor as a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| latent | Latent |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt From Numpy
Converts a NumPy ndarray to a PyTorch tensor while preserving its data type.
## Input
| Name | Data type |
|---|---|
| array | Ndarray |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-21
View File
@@ -1,21 +0,0 @@
# Pt Full
Creates a PyTorch tensor filled with a specified value using the size entered in the text field.
For example, if you want to create a 4D tensor of batch size=2, channel=3, height=96, width=32 filled with 7, enter:
[2,3,96,32] for size and 7 for value.
## Input
| Name | Data type |
|---|---|
| value | String |
| size | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-59
View File
@@ -1,59 +0,0 @@
# Pt Gather
Generates a tensor based on the index tensor using PyTorch's `gather` function.
Specify the `dim` field using an integer to indicate the axis along which to gather elements.
Each input tensor element is selected based on the index tensor.
For example, consider the following input tensor:
```
[ [10, 20, 30, 40, 50],
[100, 200, 300, 400, 500]]
```
and the corresponding index tensor:
```
[ [0, 4, 3, 2, 0],
[4, 3, 0, 0, 0]]
```
If `dim = 0`, the function scans row-wise, treating each index value as a row index.
If `dim = 1`, it scans column-wise, interpreting each index value as a column index.
Let's analyze the case where `dim = 1`:
* Start at row 0, column 0.
* The index at this position is `index[0, 0] = 0`.
* PyTorch selects the value at position 0 from the array `[10, 20, 30, 40, 50]`, which is `10`.
* The result at this stage is:
```
[[10, ?, ?, ?, ?]
[?, ?, ?, ?, ?]]
```
* Moving to column 1: `index[0, 1] = 4`.
* The value at index 4 in `[10, 20, 30, 40, 50]` is `50`.
* The updated result is:
```
[[10, 50, ?, ?, ?]
[?, ?, ?, ?, ?]]
```
* Repeating this process for all elements constructs the final gathered tensor.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | Int |
| index | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Indexing and Slicing Operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Ge
Tests whether elements in the first PyTorch tensor are greater than or equal to the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Gt
Tests whether elements in the first PyTorch tensor are greater than the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-41
View File
@@ -1,41 +0,0 @@
# Pt Index Select
Extracts elements from the input tensor along a specified dimension using an index tensor.
`dim` specifies the dimension along which the selection occurs.
* For example, for 2D tensors:
** If `dim=0`, `index` selects rows.
** If `dim=1`, `index` selects columns (for 2D tensors).
`index` is a list of indices that will be converted into a tensor.
Example:
```
Input Tensor:
[[1, 2, 3],
[40, 50, 60],
[700, 800, 900]]
index = "[0, 2]"
dim = 0
Output Tensor:
[[1, 2, 3],
[700, 800, 900]]
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | Int |
| index | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Indexing and Slicing Operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Int Create
Creates a PyTorch tensor with 32-bit integer
using values entered in the text field.
## Input
| Name | Data type |
|---|---|
| data | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
@@ -1,23 +0,0 @@
# Pt Interpolate By Scale Factor
Resizes a PyTorch tensor using interpolation by scale factor. The input tensor must have a shape of (c, h, w) or (b, c, h, w).
In ComfyUI Analysis, the tensor data type is "TENSOR," while in ComfyUI, the type "IMAGE" is used. To pass image data from ComfyUI to a ComfyUI Analysis node (e.g., this interpolation node), first use the "Pt From Image" node to convert it to a tensor, then transpose the axes from (b, h, w, c) to (b, c, h, w) before passing it to this node.
This transposition can be performed using the "Pt Permute" node with (0, 2, 3, 1). To convert the output back to an image, apply "Pt Permute" with (0, 3, 1, 2) and then use the "Pt To Image" node.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| scale_factor | Float |
| mode | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Interpolate To Size
Resizes a PyTorch tensor using interpolation. The input tensor must have a shape of (c, h, w) or (b, c, h, w).
In ComfyUI Analysis, the tensor data type is "TENSOR," while in ComfyUI, the type "IMAGE" is used. To pass image data from ComfyUI to a ComfyUI Analysis node (e.g., this interpolation node), first use the "Pt From Image" node to convert it to a tensor, then transpose the axes from (b, h, w, c) to (b, c, h, w) before passing it to this node.
This transposition can be performed using the "Pt Permute" node with (0, 2, 3, 1). To convert the output back to an image, apply "Pt Permute" with (0, 3, 1, 2) and then use the "Pt To Image" node.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| height | Int |
| width | Int |
| mode | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Le
Tests whether elements in the first PyTorch tensor are less than or equal to the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-23
View File
@@ -1,23 +0,0 @@
# Pt Linspace
Creates a PyTorch tensor using `torch.linspace` with the specified start, end, and steps values.
The start and end values are parsed from string inputs and converted to a float.
The steps value is converted to an int.
## Input
| Name | Data type |
|---|---|
| start | String |
| end | String |
| steps | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Load Model
A wrapper class for saving a PyTorch model.
## Input
| Name | Data type |
|---|---|
| model | Ptmodel |
| model_path | String |
## Output
| Data type |
|---|
| Ptmodel |
<HR>
Category: PyTorch wrapper - Training
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Log
Computes the natural logarithm (log base e) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Logical And
Performs a logical AND operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Logical Not
Performs a logical NOT operation on a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Logical Or
Performs a logical OR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Logical Xor
Performs a logical XOR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Lt
Tests whether elements in the first PyTorch tensor are less than the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-34
View File
@@ -1,34 +0,0 @@
# Pt Masked Select
Extracts elements from the input tensor whose corresponding value in `masked_tens` is `True`.
Example:
```
Input Tensor:
[[1, 2, 3],
[40, 50, 60],
[700, 800, 900]]
Masked Tensor:
[[True, False, False],
[False, True, False],
[False, False, True]]
Output Tensor:
[1, 50, 900]
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| masked_tens | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Indexing and Slicing Operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Mat Mul
Performs matrix multiplication on two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Max
Computes the maximum values of a PyTorch tensor along the specified dimension(s).
Specify the dimension(s) in the `dim` field using an integer, a list, or a tuple, as shown below:
```
0, [0], or (1, 2)
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-26
View File
@@ -1,26 +0,0 @@
# Pt Mean
Computes the mean of a PyTorch tensor along the specified dimension(s).
This node supports only floating-point or complex tensors as input.
Specify the dimension(s) in the `dim` field using an integer, a list, or a tuple, as shown below:
```
0, [0], or (1, 2)
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-29
View File
@@ -1,29 +0,0 @@
# Pt Median
Computes the median of a PyTorch tensor along the specified dimension(s).
Specify the dimension(s) in the `dim` field using an integer as shown below:
```
0
```
or
```
1
```
Note that PtMedian calls torch.median(), which returns the lower of the two numbers when the true median falls between them.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Min
Computes the minimum values of a PyTorch tensor along the specified dimension(s).
Specify the dimension(s) in the `dim` field using an integer, a list, or a tuple, as shown below:
```
0, [0], or (1, 2)
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Mm
Performs 2D matrix multiplication on two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Mul
Multiplies two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Ne
Tests whether two PyTorch tensors are not equal element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Neg
Computes the negation of each element in a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-20
View File
@@ -1,20 +0,0 @@
# Pt Ones
Creates a PyTorch tensor of ones using the size entered in the text field.
For example, if you want to create a 4D tensor of batch size=2, channel=3, height=96, width=32, enter:
[2,3,96,32]
## Input
| Name | Data type |
|---|---|
| size | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-23
View File
@@ -1,23 +0,0 @@
# Pt Pad
Pads a PyTorch tensor to the specified size. Padded area will be black. The input tensor must have a shape of (c, h, w) or (b, c, h, w).
In ComfyUI Analysis, the tensor data type is "TENSOR," while in ComfyUI, the type "IMAGE" is used. To pass image data from ComfyUI to a ComfyUI Analysis node (e.g., this interpolation node), first use the "Pt From Image" node to convert it to a tensor, then transpose the axes from (b, h, w, c) to (b, c, h, w) before passing it to this node.
This transposition can be performed using the "Pt Permute" node with (0, 2, 3, 1). To convert the output back to an image, apply "Pt Permute" with (0, 3, 1, 2) and then use the "Pt To Image" node.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| height | Int |
| width | Int |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-25
View File
@@ -1,25 +0,0 @@
# Pt Permute
Permutes the dimensions of a PyTorch tensor according to the specified order.
For example, if a tensor has shape (2, 3, 96, 32) and `new_axes="[0, 3, 1, 2]"`,
the output will have shape (2, 32, 3, 96).
Specify the new axis order in the `new_axes` field using brackets, as shown below:
```
[0, 3, 1, 2]
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| new_axes | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Transform
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Pow
Raises one PyTorch tensor to the power of another element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
@@ -1,22 +0,0 @@
# Pt Predict Classification Model
Performs inference on input data.
## Input
| Name | Data type |
|---|---|
| model | Ptmodel |
| inputs | Tensor |
| class_id_to_name_map | Pydict |
| use_gpu | Boolean |
## Output
| Data type |
|---|
| String |
| Int |
| Float |
<HR>
Category: PyTorch wrapper - Training
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-28
View File
@@ -1,28 +0,0 @@
# Pt Prod
Computes the product of a PyTorch tensor along the specified dimension(s).
Specify the dimension(s) in the `dim` field using an integer as shown below:
```
0
```
or
```
1
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-21
View File
@@ -1,21 +0,0 @@
# Pt Rand
Creates a PyTorch tensor with values sampled from a uniform distribution
using the size entered in the text field.
For example, if you want to create a 4D tensor of batch size=2, channel=3, height=96, width=32, enter:
[2,3,96,32]
## Input
| Name | Data type |
|---|---|
| size | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-22
View File
@@ -1,22 +0,0 @@
# Pt Rand Int
Creates a PyTorch tensor filled with random integers within a specified range using the size entered in the text field.
For example, if you want to create a 4D tensor of batch size=2, channel=3, height=96, width=32 with random integers in the range [0, 10),
enter [2,3,96,32] for size, 0 for min_value, and 10 for max_value.
## Input
| Name | Data type |
|---|---|
| min_value | Int |
| max_value | Int |
| size | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-21
View File
@@ -1,21 +0,0 @@
# Pt Randn
Creates a PyTorch tensor with values sampled from a standard normal distribution (mean=0, std=1)
using the size entered in the text field.
For example, if you want to create a 4D tensor of batch size=2, channel=3, height=96, width=32, enter:
[2,3,96,32]
## Input
| Name | Data type |
|---|---|
| size | String |
| data_type | |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Remainder
Computes the element-wise remainder of division between two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-27
View File
@@ -1,27 +0,0 @@
# Pt Reshape
Reshapes a PyTorch tensor into a specified shape using `torch.reshape()`.
The total number of elements must remain unchanged.
For example, if a tensor has shape (2, 3, 4), and `new_shape="[6, 4]"`,
the output will have shape (6, 4).
Use -1 to automatically infer a dimension, e.g.:
```
[2, -1]
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| new_shape | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Transform
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Save Model
A wrapper class for saving a PyTorch model.
## Input
| Name | Data type |
|---|---|
| model | Ptmodel |
| model_path | String |
## Output
| Data type |
|---|
| String |
<HR>
Category: IO
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Scatter
Generates a new tensor by replacing values at specified positions using an index tensor.
* Target tensor (tens): Some of whose values are replaced.
* Source tensor (src): Values from this tensor replace a part or whole of the target tensor.
* Index tensor (index): Specifies the positions in the target tensor for replacement.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | Int |
| index | String |
| src | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Indexing and Slicing Operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Show Size
Displays PyTorch Size object as a string.
## Input
| Name | Data type |
|---|---|
| size | Ptsize |
## Output
| Data type |
|---|
| String |
<HR>
Category: Display data
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Show Text
Displays PyTorch tensor as a string. Note that the tensor is partially printed out when
the tensor contains more elements than the threshold set internally.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| String |
<HR>
Category: Display data
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Sin
Computes the sine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Sinh
Computes the hyperbolic sine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Size
Extracts the PyTorch Size object of a PyTorch tensor using the size() method.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| Ptsize |
<HR>
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Size Create
Creates a PyTorch Size using values entered in the text field.
## Input
| Name | Data type |
|---|---|
| data | String |
## Output
| Data type |
|---|
| Ptsize |
<HR>
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Size To Numpy
Converts PyTorch Size object to NumPy ndarray.
## Input
| Name | Data type |
|---|---|
| sz | Ptsize |
## Output
| Data type |
|---|
| Ndarray |
<HR>
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Size To String
Converts PyTorch Size object to a Python string.
## Input
| Name | Data type |
|---|---|
| sz | Ptsize |
## Output
| Data type |
|---|
| String |
<HR>
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Sqrt
Computes the square root of each element in a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-20
View File
@@ -1,20 +0,0 @@
# Pt Squeeze
Removes a dimension at the specified position in the input tensor if it is of size 1.
Specifying a tuple of dimensions is not supported yet.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | Int |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Transform
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-28
View File
@@ -1,28 +0,0 @@
# Pt Std
Computes the standard deviation of a PyTorch tensor along the specified dimension(s).
Specify 1 to use Bessel's correction (N-1) for sample standard deviation.
Specify 0 to compute population standard deviation.
Specify the dimension(s) in the `dim` field using an integer, a list, or a tuple, as shown below:
```
0, [0], or (1, 2)
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| correction | Int |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-18
View File
@@ -1,18 +0,0 @@
# Pt Sub
Subtracts one PyTorch tensor from another.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-24
View File
@@ -1,24 +0,0 @@
# Pt Sum
Computes the sum of a PyTorch tensor along the specified dimension(s).
Specify the dimension(s) in the `dim` field using an integer, a list, or a tuple, as shown below:
```
0, [0], or (1, 2)
```
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
| dim | String |
| keepdim | Boolean |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Reduction operation & Summary statistics
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Tan
Computes the tangent of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt Tanh
Computes the hyperbolic tangent of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt To Image
Casts a PyTorch tensor as an Image tensor.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| Image |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt To Image Transpose
Casts a PyTorch tensor as an Image tensor and transposes it from (C, H, W) to (H, W, C). For rank-4 inputs, the batch axis remains unchanged.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| Image |
<HR>
Category: PyTorch wrapper - Image processing
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
-17
View File
@@ -1,17 +0,0 @@
# Pt To Latent
Casts a PyTorch tensor as a latent tensor.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| Latent |
<HR>
Category: PyTorch wrapper - Tensor data conversion
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.

Some files were not shown because too many files have changed in this diff Show More