Updated readme.

This commit is contained in:
HowToSD
2025-03-28 21:05:56 -07:00
parent 4b7ada2185
commit bb6ef8e1af
+51 -22
View File
@@ -1,37 +1,66 @@
## Update (3/28/2025)
## Update — March 28, 2025
Transformer support has been added.
Check out the new example workflow at `examples/workflows/embedding_transformer_classification.json`. This workflow achieves approximately 83% validation accuracy on the IMDB sentiment classification task using the Hugging Face version of the dataset, which is within the expected range for training a Transformer from scratch with limited data.
**Now with Transformer support**
Train NLP models directly inside ComfyUI. See: [`embedding_transformer_classification.json`](examples/workflows/embedding_transformer_classification.json). Achieves ~83% accuracy on IMDB sentiment with Hugging Face datasets—using only node workflows.
---
# ComfyUI-Pt-Wrapper
ComfyUI-Pt-Wrapper is a spin-off of [ComfyUI-Data-Analysis](https://github.com/HowToSD/ComfyUI-Data-Analysis), designed as a dedicated extension for PyTorch wrapper nodes originally included in the analysis extension.
# ComfyUI-Pt-Wrapper
This extension provides a comprehensive set of nodes for direct operations on PyTorch tensors, along with specialized nodes for machine learning tasks like ResNet.
**ComfyUI-Pt-Wrapper** brings PyTorch model building and training into ComfyUI's node graph environment—**no coding required**.
If you need access to PyTorch's low-level methods (e.g., `add`, `div`, `max`, `where`, `scatter`, `gather`) to manipulate tensors or extract information—or if you're comfortable with ComfyUI and want to explore foundational PyTorch methods —this extension is for you.
It is built for ComfyUI users who want to explore machine learning without writing Python, and for researchers who want to prototype directly in visual workflows. Every operation, from tensor math to full training pipelines, can be configured through nodes.
You can train an image classification model using your own image data **without writing any code**.
Originally a focused spin-off of [ComfyUI-Data-Analysis](https://github.com/HowToSD/ComfyUI-Data-Analysis), this extension supports a wide range of ML workflows in image and text domains.
Check out [this tutorial on classifying dogs and cats](docs/dog_cat_classification_model_training.md).
---
For visualization or analysis features, install ComfyUI-Data-Analysis as well.
## What It Offers
The workflow directory offers user-friendly example workflows for training a high-performing ResNet model on CIFAR-10. One example achieved **94.34% accuracy** on the validation set. While not a state-of-the-art metric, it provides a solid starting point for customizing the workflow to your needs.
- **No-code training workflows** for image and text classification
- Use pre-built model nodes for major architecture such as ResNet, LSTM, GRU, Transformer, or create your own model from various model nodes.
- Perform tensor operations like `add`, `gather`, `scatter`, `where`, etc.
- Support for processing text (e.g. tokenization, embedding) to feed to a model
**ResNet model**
![Train](docs/images/resnet_train.png)
![Eval](docs/images/resnet_eval.png)
---
# Getting Started
If you're interested in direct operations on PyTorch tensors, check out the [Node Reference](docs/reference/node_reference.md) to explore the available nodes and see what operations are supported.
## Example Workflows
If you want to learn PyTorch model training, start with the [Model Training Documentation](docs/model_training.md).
### Dog vs. Cat Classifier — No Code Needed
Train an image classifier on your own dataset—entirely in ComfyUI nodes.
## Contribution
🚫 **This project does not accept pull requests.**
Unsolicited PRs will be **closed without review**.
[Step-by-step guide](docs/dog_cat_classification_model_training.md)
If you have a feature request or improvement suggestion, **please create an Issue instead**.
All submitted issues will be reviewed and prioritized accordingly.
### ResNet on CIFAR-10
Train a ResNet achieving **94.34% validation accuracy**. A flexible baseline for your own image classification tasks.
![Training](docs/images/resnet_train.png)
![Evaluation](docs/images/resnet_eval.png)
### Transformer for Text Classification
Train a text classification model using a configurable Transformer model—all node-based.
[`embedding_transformer_classification.json`](examples/workflows/embedding_transformer_classification.json)
---
## Getting Started
- **Node Overview**: [Node Reference](docs/reference/node_reference.md)
- **Model Training Guide**: [Model Training Documentation](docs/model_training.md)
---
## Contributing
This project does not accept pull requests. Unsolicited PRs will be closed without review.
To suggest a feature or report an issue, open an Issue. All issues are reviewed and prioritized.
---
## Node Reference
Every supported node is documented in detail. Browse the [Node Reference](docs/reference/node_reference.md) to explore tensor operations, models, tokenization, distributions, loss functions, tensor operations and more.
Links in the reference section point directly to individual node docs for quick lookup.