Extensions/ComfyDL
ComfyUI Extension

ComfyDL

DeepLearning is just a few clicks away!

By Cynthia-lxx·Created 2 months ago·Updated 2 days ago· 6
Cynthia-lxx/ComfyDL
Nodes103
On cloudLocal install
Categoryd2l/TorchOps, d2l/_Legacy/Tensor Basic
Stars6
Updated2 days ago

Nodes (103)

Accuracy

It says Accuracy, but it actually hands you a count

d2l/TorchOps
Activation (DEPRECATED)

Nine activation functions in one node — only two of the knobs do anything

d2l/_Legacy/Tensor Basic
Additive Attention

Additive Attention

d2l/NLP Models
Add & Norm (DEPRECATED)

The residual + layer-norm layer hiding inside every Transformer block

d2l/_Legacy/NLP Models
Area Chart

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

d2l/Visualization
Assign Anchor→BBox

The anchor-matching step behind object detection, exposed as a node

d2l/ObjectDetection
Bananas Detection

The friendliest object-detection dataset in existence

d2l/Datasets
Bar Chart

Turn a tensor into a bar chart with the numbers written on the bars

d2l/Visualization
BLEU Score

BLEU in one node, so you can score a translation by hand

d2l/TorchOps
Box Center→Corner

Bounding boxes in (cx, cy, w, h)? Convert them to corners in one step

d2l/ObjectDetection
Box Corner→Center

Bounding boxes in (x1, y1, x2, y2)? Convert them to center-width-height

d2l/ObjectDetection
Box IoU

Pairwise IoU between two sets of boxes, computed in one shot

d2l/ObjectDetection
Broadcast (DEPRECATED)

Stretch a tensor to a bigger shape without copying the data

d2l/_Legacy/Tensor Basic
Confusion Matrix

See exactly where your classifier gets confused

d2l/Visualization
Conv2D

Convolve a tensor with a kernel — stride and padding included

d2l/Tensor Basic
Corr2D

Cross-correlation with the loops on display, straight from the textbook

d2l/CV Models
DataLoader Info

Num_batches, batch_size, dataset_size

d2l/Datasets
DataLoader Preview

DataLoader Preview

d2l/Datasets
DataLoader Preview (Output)

The same preview grid, but it shows up in your UI automatically

d2l/Datasets
Dataset Stats

Is your dataset actually balanced? Dataset Stats will tell you

d2l/Datasets
Device Info

Which GPU does ComfyUI actually see? This node answers in two ints

d2l/Device Utils
Dot-Product Attention

The scaled dot-product attention behind every transformer, as one node

d2l/NLP Models
Download

ComfyDL's Download node

d2l/Datasets
Download + Extract

One dropdown, download + extract included

d2l/Datasets
Fashion-MNIST

Fashion-MNIST as a ComfyUI dataset

d2l/Datasets
Get Tokens & Segments

[CLS] … [SEP] … [SEP], with segment IDs

d2l/NLP Utils
Gradient Clip

Clamp runaway gradients before they nuke your training

d2l/TorchOps
GRU

The LSTM's cheaper, lighter cousin — as a node you can stack

d2l/NLP Models
Heatmaps to 3D

Extrude a tensor into a mesh you can actually orbit

d2l/Visualization
Histogram

See the distribution inside a tensor in one glance

d2l/Visualization
Image Adjust

Brightness, contrast, and saturation in one pass — 1.0 means leave it alone

image/color
Image Grayscale

Grayscale that keeps all three channels — the sneaky part

image/color
Image Normalize

Normalize an image to z-scores — and know it won't come back to [0,1]

image/color
Image Rotate

Rotate by any angle, counter-clockwise — and expand the canvas or don't

image/transform
Image Stats

What's actually inside that image tensor? Just ask it

image
Init Seq2Seq Weights

Xavier weight init in one node

d2l/NLP Models
LeNet

The 1998 CNN that still teaches everyone deep learning — now a node

d2l/CV Models
Linear Regression

Y = Xw + b as three wires — linear regression without a single line of code

d2l/TorchOps
Load Array → DataLoader

The bridge from raw tensors to a trainable dataset

d2l/Datasets
Masked Softmax

The softmax that knows where to look — and where to look away

d2l/TorchOps
MessageBox

A Windows popup that taps you when the graph finishes — if you're on Windows

utilities
Model Clone

A copy of a model that shares nothing — deepcopy, done properly

d2l/Model Utils
Model Forward

Run your model on a tensor — eval mode, no gradients, done

d2l/Model Utils
Model Info

How big is that model? Total params, trainable params, and a summary

d2l/Model Utils
Model Layers

Read your network's mind — every layer, indented, as text

d2l/Model Utils
Model Load

Load weights into a model you already built — the architecture must match

d2l/Model Utils
Model Mode (DEPRECATED)

Train vs eval — the tiny toggle that changes what your model does

d2l/_Legacy/Model Utils
Model Params

Every parameter, its shape, and whether it actually trains

d2l/Model Utils
Model Save

Save a model's weights — only the weights, and only to a .pt

d2l/Model Utils
Multibox Detection

Turn anchor guesses into actual detections — that's non-max suppression

d2l/ObjectDetection
Multibox Prior

Generate every anchor box your detector will ever need

d2l/ObjectDetection
Multibox Target

The node that turns anchor boxes into something a loss can chew on

d2l/ObjectDetection
Multi-Head Attention

How one attention becomes eight

d2l/NLP Models
NMS

How your detector stops drawing fifty boxes on one dog

d2l/ObjectDetection
NoOp

The ComfyDL node that does literally nothing, and that's the point

utilities
Offset Boxes

The regression half of training a single-shot detector

d2l/ObjectDetection
Offset Inverse

Turning a detector's offset predictions back into real boxes

d2l/ObjectDetection
Pie Chart

When you need to actually see your label distribution

d2l/Visualization
Plot

The MATLAB-style line plot hiding inside ComfyUI

d2l/Visualization
Positional Encoding

Attention can't see order — this node gives it a position map

d2l/NLP Models
Position-Wise FFN

The two-layer MLP that every Transformer block repeats

d2l/NLP Models
Random Tensor

ComfyDL's noise generator for testing, init, and inputs

d2l/Tensor Basic
Reshape (DEPRECATED)

The node that fixes 90% of your shape errors in ComfyDL

d2l/_Legacy/Tensor Basic
Residual Block

The Lego brick of every modern CNN, as a node

d2l/CV Models
ResNet-18

A real deep network, assembled in one node

d2l/CV Models
ResNeXt Block

Grouped convolutions without leaving the graph

d2l/CV Models
RNN (high-level)

One line of history, no hand-written math

d2l/NLP Models
RNN Language Model (high-level)

RNN Language Model (high-level)

d2l/NLP Models
RNN Language Model (from scratch)

RNN Language Model (from scratch)

d2l/NLP Models
RNN LM Predict

The payoff node of the LM demo

d2l/NLP Models
RNN (from scratch)

No hidden torch layer, just weights

d2l/NLP Models
Scatter

Seeing 10,000 points instead of 10,000 numbers

d2l/Visualization
Seq2Seq Encoder

Half a machine-translation model, built honestly

d2l/NLP Models
Sequence Mask

The polite way to tell a network to ignore padding

d2l/TorchOps
SGD Step

The node that actually trains your model

d2l/TorchOps
Show BBoxes

The node that makes your detector's output real

d2l/Visualization
Show Heatmaps

Turning attention and weight matrices into something you can see

d2l/Visualization
Show Heatmaps (Output)

Attention, rendered right in the graph

d2l/Visualization
Show Images

A batch of tensors, finally looking like a grid of pictures

d2l/Visualization
Show Trace 2D

Watching an optimizer wander its way to the minimum

d2l/Visualization
Squared Loss

The loss function that taught a generation of regression — half, on purpose

d2l/TorchOps
String → Tensor

Type a matrix by hand and get a tensor — the pack's manual data entry

d2l/Tensor Basic
Synthetic Data

A fake dataset generator that makes your first training loop honest

d2l/TorchOps
Tensor → String

The node that lets you actually see what a tensor is doing

d2l/Tensor Basic
Timer (Benchmark)

Is the GPU actually faster? This node settles the argument with a stopwatch

utilities
Tokenize

From raw text to tokens — the first step in every NLP workflow here

d2l/NLP Utils
Transformer Encoder (DEPRECATED)

A BERT-class encoder you build (and see into) yourself

d2l/_Legacy/NLP Models
Transformer Encoder Block (DEPRECATED)

One Transformer encoder block, the Lego brick of BERT

d2l/_Legacy/NLP Models
Transpose

Swap any two dimensions — and learn why order matters so much

d2l/Tensor Basic
Truncate/Pad

Force every sequence to the same length, the boring way that just works

d2l/TorchOps
Try All GPUs

One node, every GPU on your machine, comma-separated

d2l/Device Utils
Try GPU

Ask for GPU 0, get told 'cpu' instead — the failover node

d2l/Device Utils
Update Discriminator

One training step for the critic — where GAN loss actually comes from

d2l/GAN
Update Generator

The generator fights back — one step at fooling the critic

d2l/GAN
Vocab Build

Turn a pile of tokens into a real vocabulary — the pack's index-maker

d2l/NLP Utils
Vocab Decode

Numbers back to words — the node that makes model output readable

d2l/NLP Utils
Vocab Encode

Words in, numbers out — the node that makes text computable

d2l/NLP Utils
VOC Classes

The 21 names behind every PASCAL VOC segmentation label

d2l/Segmentation
VOC Colormap→Label

The lookup table that turns VOC's colors into class numbers

d2l/Segmentation
VOC Label Indices

VOC's color-coded masks, converted to class indices you can train on

d2l/Segmentation
VOC Random Crop

Crop the image and its label together, so the segmentation data stays honest

d2l/Segmentation
VOC Segmentation

A 2 GB dataset that appears at your doorstep (and where it hides)

d2l/Datasets
?

The '?' node has one toggle and it opens a browser tab — don't flip it at work

utilities
Readme

Banner

<div align="center"> <h1>ComfyDL</h1> <p>DeepLearning is just a few clicks away!</p> <a href="./README_zh.md">中文版本 / Chinese</a> </div>

What's This?

ComfyDL lets you build deep learning workflows — from CNNs to BERT and beyond — by connecting nodes in ComfyUI, not by writing code. Built on a foundation inspired by the d2l codebase, it keeps evolving as we develop more useful nodes — visual, educational, and great for rapid prototyping. Drag, connect, and see results instantly.

ComfyDL has its own GUI version: ComfyDL_UI ships ComfyDL as a built-in node pack on top of a ComfyUI runtime fork — see Installation.

Examples in Action

Note: The example workflows that used to ship with ComfyDL have been archived. They predate the ongoing node refactor, so they no longer match the current node set and are no longer offered as workflow templates in the UI. They are kept for reference under example_workflows/_archived/, and a fresh set of runnable examples will be published once the refactor is complete.

The Mysterious "?"

A tiny node with a toggle that does... something. Try it and see.

The Mysterious ?


Installation

There are two ways to run ComfyDL: the GUI build, or the classic manual install into an existing ComfyUI.

Option 1 — the GUI build: ComfyDL_UI

ComfyDL_UI is a runtime fork of ComfyUI that already ships ComfyDL as a built-in node pack. No custom_nodes step, no separate dependency install, no manual wiring — only the fork itself:

git clone https://github.com/Cynthia-lxx/ComfyDL_UI
cd ComfyDL_UI
penv\Scripts\python.exe main.py     # Windows
penv/bin/python main.py             # Linux / macOS

Its README covers the details: https://github.com/Cynthia-lxx/ComfyDL_UI#readme.

Option 2 — the classic manual install into an existing ComfyUI

This option requires ComfyUI. If you don't have it, download from: https://github.com/Comfy-Org/ComfyUI

  1. Navigate to your custom_nodes folder:

    <img src="./assets/1.png" alt="custom_nodes folder location" width="400" />
  2. Clone this repository:

    git clone https://github.com/Cynthia-lxx/ComfyDL ./ComfyDL
    
  3. Install dependencies:

    pip install -r ./ComfyDL/requirements.txt
    
  4. Restart ComfyUI. You should see the new ComfyDL nodes appear in the node menu.


Function Overview

The built-in node library ships 177 nodes across 32 categories — 109 provided by ComfyDL plus 68 ComfyUI core nodes (Network & LayersActivation 14 + Basic 8 + Normalization 7

  • Regularization 1 + Training 11 + Pooling 2 + Convolution 2; modelloaders 7
  • merging 11 + latent 2 + conditioning 2; 3dPreview 3D 1) that were added on top of it:

| Category | Count | Description | |---|---|---| | CV Models | 5 | CNN fundamentals & model construction | | Datasets | 10 | Dataset download, load, preview & stats | | Device Utils | 3 | GPU/CPU device utilities | | GAN | 2 | GAN training updates | | Model Utils | 7 | Model info, mode, forward, layers, params, clone & persistence | | NLP Models | 13 | RNN/GRU/RNNLM, attention & Seq2Seq building blocks | | NLP Utils | 5 | Text tokenization & vocabularies | | ObjectDetection | 10 | Anchor boxes, IoU, NMS | | Segmentation | 4 | VOC semantic segmentation tools | | Tensor Basic | 5 | Tensor I/O, conv, transpose, broadcast, activation | | TorchOps | 10 | Loss, optimization, metrics | | Visualization | 13 | Plots, charts & bounding box visualization | | d2l/_Legacy/Model Utils | 1 | Deprecated (soft-archived): Model Mode; use the core Training Mode | | d2l/_Legacy/NLP Models | 3 | Deprecated (soft-archived): Add & Norm, Transformer Encoder Block/Encoder | | d2l/_Legacy/Tensor Basic | 3 | Deprecated (soft-archived): Broadcast, Reshape, Activation | | image (Comfy core) | 1 | Per-channel image batch statistics | | image/color (Comfy core) | 3 | Grayscale, normalize & brightness/contrast/saturation | | image/transform (Comfy core) | 1 | Arbitrary-angle rotation + canvas expand | | utilities (Comfy core) | 4 | MessageBox, NoOp pass-through & benchmark timer | | conversion | 6 | |

The 20 categories above are the ones ComfyDL itself provides; the other 12 categories of the shipped library (Network & Layers/*, model/* and 3d, 68 nodes in total) are pure ComfyUI core categories.

For the complete node reference, see FUNCTIONS.md (English) or FUNCTIONS_zh.md (中文).


Repository Layout

ComfyDL/
├── src/d2lcore/     # D2L-inspired core implementation — a reference layer (torch.py, ...)
├── nodes/           # ComfyUI node definitions (thin mapping layer)
│                    #   incl. self-developed model_utils.py, image_tools.py &
│                    #   nlp model wrappers (model_nlp.py, model_attention.py, model_seq2seq.py)
└── example_workflows/  # Archived sample workflow JSONs (see _archived/, no longer offered as templates)

Note: A mirror copy of src/d2lcore/ also exists at the repository root as d2lcore/ (outside the plugin folder). They must be kept in sync whenever the D2L core logic is modified.


License

This project is licensed under the GNU General Public License v3.0 (or any later version) — see the LICENSE file for details. ComfyDL is distributed as the node pack of the ComfyDL_UI project and follows the same license; upstream ComfyUI keeps its own copyright and maintainers.


Special Thanks

ComfyDL stands on the shoulders of the incredible d2l (Dive into Deep Learning) community.

  • Codebase: We heavily reference and adapt implementations from the d2l-pytorch repository. Its clear, textbook-grade code serves as a high-quality reference and starting point for many of our nodes — and continues to guide the development of new ones. We are deeply grateful to all contributors who made this resource available under the permissive MIT-0 license.
  • Inspiration: The design and pedagogical philosophy behind this project are fundamentally inspired by the book 《Dive into Deep Learning》 (《动手学深度学习》PyTorch版), which offers one of the most accessible and practical paths to mastering deep learning.

This project would not exist without their vision and generosity. We encourage everyone to explore the original book and repository:

  • Book (Chinese): https://zh.d2l.ai/
  • GitHub Repository: https://github.com/dsgiitr/d2l-pytorch

Meow~