Node Reference
CodefyUI ships 158 built-in nodes across 16 categories. Installed plugin packs and your own custom nodes add more.
tip
This table reflects the current release, but the backend is authoritative. Check the live node palette or GET /api/nodes for the nodes available in your installation. Double-click the canvas to search for a node.
| Category | Nodes | Count |
|---|---|---|
| CNN | Conv2d, Conv1d, Conv2dExplicit, ConvTranspose2d, MaxPool2d, AvgPool2d, AdaptiveAvgPool2d, BatchNorm2d, Dropout, Activation | 10 |
| RNN | LSTM, GRU, RNNCell | 3 |
| Transformer | MultiHeadAttention, TransformerEncoder, TransformerDecoder, MoELayer | 4 |
| RL | DQN, PPO, EnvWrapper, RewardModel, KLDivergence, PolicyRollout, PPOClipObjective, GroupRelativeAdvantage, Discount, GridWorldEnv, PreferenceDataset, BradleyTerryLoss, BradleyTerryTrain, RLTrainingLoop | 14 |
| Data | Dataset, ImageFolderDataset, DataLoader, DatasetBatch, Transform, HuggingFaceDataset, KaggleDataset, TensorInput, TextInput, CSVReader, ColumnSelector, RowSelector, Normalize, SyntheticDataset, SyntheticShapes, SyntheticSegmentation, SyntheticSequence, TrainTestSplit, KFoldSplit, DatasetSplit, ResizeTransform, ToTensorTransform, NormalizeTransform, RandomCrop, RandomHorizontalFlip, RandomRotation, ColorJitter, RandAugment, ComposeTransform, TensorDataset | 30 |
| Data Flow | Map, Reduce, Switch | 3 |
| Training | Optimizer, Loss, TrainingLoop, EvaluateModel, LRScheduler, SequentialModel, BackwardOnce | 7 |
| IO | ImageReader, ImageWriter, ImageBatchReader, FileReader, CheckpointSaver, CheckpointLoader, ModelLoader, ModelSaver, Inference, GraphInput, GraphOutput, VideoLoad, VideoWrite | 13 |
| Control | Start | 1 |
| Utility | Print, Reshape, Concat, Flatten, Linear, Visualize, Embedding, PythonScript, ScatterPlot2D, DecisionBoundary | 10 |
| Normalization | BatchNorm1d, LayerNorm, GroupNorm, InstanceNorm2d | 4 |
| Tensor Operations | Add, MatMul, Mean, Multiply, ScalarMultiply, Permute, Softmax, Argmax, Split, Squeeze, Stack, TensorCreate, Unsqueeze, MaskedFill, TensorStats | 15 |
| LLM | LLMChat, Tokenizer, WordVector, TextEmbedding, EmbeddingScatter, CosineSimilarity, AttentionMask, AttentionHeatmap, PositionalEncoding, CausalLMModel, LMCrossEntropyLoss, LMTokenizer, TextCorpusDataset, LMTokenizedDataset, DataMixDataset, PerplexityEvaluate, TextGenerate, DocumentLoader, TextChunker, VectorStore, Retriever, PromptBuilder, HFTextGenerate | 23 |
| Classical | KNN, LinearRegression, LogisticRegression, DecisionTreeClassifier, RandomForestClassifier, SVMClassifier, MLPClassifier, Accuracy, RegressionMetrics | 9 |
| Diffusion | Upsample, TimestepEmbedding, Lerp, GaussianNoise, DDPMSampler, DiffusionUNet, DiffusionTrainingLoop | 7 |
| VLA | VLAModel, VLARollout, VLAActionEval, PushWorldEnv, PushWorldDemos | 5 |
Notable nodes
Start(Control) — defines the execution entry point. Every runnable graph requires one; see Your First Graph.TensorInput(Data) — provides an inline grid for entering explicit tensor values. Teaching Inspector examples use it as their input node.- The transform chain (Data) — nine nodes compose a
transforms.Compose:ResizeTransformresizes to a square;ToTensorTransformconverts a PIL image to a[0, 1]tensor;NormalizeTransformapplies per-channel normalisation and provides presets;RandomCrop,RandomHorizontalFlip,RandomRotation,ColorJitter, andRandAugmentapply augmentations; andComposeTransformjoins two separately constructed chains. See Data and Augmentation for parameters and ordering rules. ImageFolderDataset(Data) — loads images from one directory per class, using the directory structure expected by torchvision'sImageFolder. Its optionalpathinput replaces thepathparam when wired.- The tabular training path (Data, Classical) —
CSVReader→TrainTestSplit→TensorDataset→DataLoader→TrainingLooptrains a neural network on a CSV. SetCSVReader'starget_typetonumberfor a regression target, which then arrives as a list of floats.TensorDatasetpairs features with targets:numbergives float32 targets, a 1-D target becoming[N, 1]to match a model with one output;classgives int64 class indices forCrossEntropyLoss, and the test split'sTensorDatasettakes the training one'sclassesoutput on itsclassesinput so both number each class the same way, even when the test split lacks a class;tokenkeeps integer targets at their shape as int64, such as[N, T]next-token ids forLMCrossEntropyLoss.RegressionMetricscompares predictions with true values and returns MSE, MAE and R², which it also records as run metrics, asAccuracyrecordsaccuracy.KFoldSplittakes the same inputs asTrainTestSplitand holds out one fold of a k-fold split (sklearn'sKFold, orStratifiedKFoldwithstratifyon) asx_valandy_val; a sweep over itsfoldparam from 0 ton_folds- 1 is k-fold cross-validation.LinearRegressiontakes a split'sy_trainlist directly, so a CSV regression needs noColumnSelector. TrainingLoop(Training) — runs training and sends the live loss chart to the Results panel. Its options and the metric series it records are listed in Training loops and loss charts. Its Advanced section contains the memory controlsprecisionandaccumulate_steps(see Training Memory) andstrategy, whoseddptrains one model across the GPUs of a worker run with two or more cards (see Multi-GPU Execution).SequentialModel(Training) — represents a layer stack in one node. Double-click it to open the Model Architecture editor. The editor provides a searchable layer palette grouped by category and a canvas for connecting layers. An architecture must have exactly oneInputnode and oneOutputnode, and merge layers have a port-list editor. The controls include Snap ON/OFF, top-to-bottom Auto Layout, JSON Import and Export, and Apply. Validation rejects cycles. Export downloads the architecture asmodel_architecture.json. Import reads such a file, or a canvas graph.json: its layer nodes become anInput→ layers →Outputchain, or, if it has no layer nodes, aSequentialModelin it is loaded (with several, Select SequentialModel to Import asks which one). Any other file fails with Import failed: No layers or SequentialModel nodes in this file. Canvas params that mean something different in a layer are translated on the way in: aReshapeshape loses its batch entry, anEmbeddingpadding_idxof -1 is dropped, and theLayerNorm,AdaptiveAvgPool2dandMultiHeadAttentionparams are rewritten. The three query, key and value wires of a self-attention node become its one input. A node the layer editor cannot represent (anAddwithalphaother than 1, a cross-attention node, aReshapewith no batch entry) stops the import with a message naming it, and a canvasMean, which reduces one tensor, is left out with a warning. Import replaces what the editor shows; the node changes only when you click Apply.Subtract,ConcatandStackdepend on operand order, so each operand has its own labelled input on the card (a/bonSubtract,in0,in1, ... onConcatandStack) and the operands are taken in that order. An architecture saved before these labels existed keeps the order its connections were drawn in, and the editor labels them in that order when it opens.EmbeddingScatter(LLM) — projects embeddings to 2D with PCA or t-SNE and displays a zoomable scatter plot.AttentionHeatmap(LLM) — forwards attention weights, optionally selecting one head, and forwards optional token labels. The node card displays the weights as a heatmap, and a full-size viewer is available.- Pack-backed backends (LLM) —
WordVector'sglove-50dand sentence-encoder options, and all ofTextEmbedding, load models installed by the Package Center. Options without an installed model are greyed out. If a missing option is the graph's saved value, it remains selectable and displays a warning. Graph execution does not download these models. See Optional Packs for pack sizes, file locations, and encoder guidance. - The language-model chain (LLM) — eight nodes form a training path for a GPT-style decoder:
TextCorpusDatasetreads text rows from the Hugging Face Hub or a local.txt;DataMixDatasetmixes 2 to 6 of those corpora into one:ratiomakesweightsthe share of each corpus intotal_rowsoutput rows, repeating or subsampling rows as needed;interleaveuses every row once, so the share is the corpus sizes andweightsonly spread the corpora through an order fixed byseed;concatreads the corpora one after another as a curriculum;LMTokenizedDatasetcreates fixed-length next-token blocks;DataLoadersupplies batches toTrainingLoop;CausalLMModelprovides the model;LMCrossEntropyLossprovides the loss; andLMTokenizersupplies the shared tokenizer (a tiktoken BPE table, or thebyteandcharencodings for a vocabulary small enough for a character-level model).PerplexityEvaluatescores a held-out split, andTextGeneratesamples from the trained weights. The defaultCausalLMModelhas 203,668,480 parameters; reduced_modelandn_layersfor laptop-scale training. See the Pretrain an LM on TinyStories example in Examples Gallery. - The RAG chain (LLM) — seven nodes use supplied documents as answer context:
DocumentLoaderreads each.mdand.txtin a directory as{text, source};TextChunkercreates embeddable chunks with source names and character offsets;TextEmbeddingcreates vectors;VectorStorestores one[N, D]matrix with the chunk text and searches it with one matrix multiplication;Retrieverreturns the nearesttop_kchunks and their scores;PromptBuilderinserts the chunks and question into a context-only template; andHFTextGenerateruns Qwen2.5-0.5B-Instruct locally.LLMChatcan replaceHFTextGenerateto use Ollama or a hosted provider.TextEmbeddingrequires thesentence-embeddingspack, andHFTextGeneraterequires theragpack. See Fully local RAG and RAG with a chat API in Examples Gallery, and see Optional Packs for the downloads. - The VLA chain (VLA) — the VLA category contains five specialized nodes. A training and evaluation graph connects
PushWorldEnv,PushWorldDemos,VLAModel, andTrainingLoop, then usesVLAActionEvalandVLARollout.PushWorldEnvimplements a language-conditioned 2D push task in torch; distractor pucks make the instruction necessary to identify the goal.PushWorldDemoscreates scripted-expert behaviour-cloning samples and a held-out split.VLAModelcombines a vision stem, byte-level instruction embedding, transformer trunk, and chunked action expert.VLAActionEvalmeasures held-out open-loop MSE against the expert, whileVLARolloutmeasures closed-loop success with receding-horizon execution. The README for Train a VLA on PushWorld recommends a CUDA GPU and reports a run time of about 56 minutes on an RTX 4080. - The RL nodes (RL) —
GridWorldEnvprovides a gridworld without a Gymnasium dependency.PolicyRolloutruns a policy for N episodes and records states, actions, rewards, and logits.Discountcomputes returns,GroupRelativeAdvantagecomputes GRPO's group-mean baseline, andPPOClipObjectivecomputes PPO's clipped surrogate and returns a mask showing which samples used the clipped branch.RewardModelproduces one scalar score per sequence.PreferenceDatasetcreates training and held-out preference pairs;BradleyTerryLosscomputes the preference loss; andBradleyTerryTrainfits a reward head and reports training and held-out accuracy to expose shortcut learning.KLDivergencecomputes the policy-to-reference regularisation term.DQN,PPO, andEnvWrapperintegrate with Gymnasium.RLTrainingLooptrains an agent end to end with REINFORCE, DQN or PPO: wire a model (DQNorSequentialModelfor REINFORCE and DQN, thePPOactor-critic for PPO), an env fromEnvWrapperorGridWorldEnvand anOptimizer, and it runs forepisodesepisodes or until the mean return of the last 20 reachestarget_return, drawing the live loss chart and recordingmean_returnas a run metric. See RLHF reward and KL terms in Examples Gallery. - The diffusion chain (Diffusion) —
GaussianNoisecreates seeded noise and can match an upstream tensor's shape.DiffusionUNetprovides a toy U-Net that maps(x, t)to predicted noise, andDiffusionTrainingLooptrains it.DDPMSamplerperforms the reverse process in one node so the graph remains acyclic; its verbose trace records trajectory snapshots.TimestepEmbedding,Upsample, andLerpsupport an explicit construction of the same operations. The Diffusion examples are Forward diffusion on a digit (GaussianNoiseandLerp), Toy reverse diffusion sampling and Mini U-Net node (GaussianNoise→DiffusionUNet→DDPMSampler). See Examples Gallery. ModelSaver/ModelLoader(IO) — write and read model files. Their defaultstate_dictmode stores tensors and imposes no class-loading requirements. Theirfull_modelmode stores the pickled module and loads it with a restricted unpickler that permits torch and CodefyUI layer classes and the two torch activation functions stored by CodefyUI's transformer layers. See Saving and Loading Models for selection and loading requirements.VideoWrite/VideoLoad(IO) —VideoWriteencodes a frame tensor,(T, C, H, W)or(T, H, W, C), into the media folder (backend/data/media, orassets/mediain a project directory). Withformatatautoit writes an mp4 when anffmpegbinary is onPATHand a gif through Pillow otherwise;mp4requires ffmpeg. The samefilenameoverwrites the previous clip. The Execution Log and the Inspector play an mp4 inline and show a gif as an image, and thepreviewoutput is a PNG of the middle frame.VideoLoaddecodes a video into(T, 3, H, W)frames in[0, 1]plusfpsandnum_frames, and reads a relativepathfrom the media folder. mp4 and webm need theffmpegandffprobebinaries, gif needs only Pillow, andmax_framesandstridelimit how many frames are held in memory.ImageWriter/ImageBatchReader(IO) —ImageWritersaves a tensor as an image under the data directory'soutputfolder (backend/data/output, orassets/outputin a project directory). Itsimageinput takes a(C, H, W)or(H, W)image, or an(N, C, H, W)batch, as float in[0, 1]or uint8. A batch of more than one image is written as one file per image with a zero-padded index after the name (shape.pngbecomesshape_0.png,shape_1.png, ...). Thepath,pathsanddirectoryoutputs name what was written.ImageBatchReaderstacks every matching image in a directory into(N, C, H, W); wiringImageWriter.directoryinto its optionaldirectoryinput replaces thedirectoryparam and runs the read after the write. A wired directory must lie inside the data or examples directories, as the param must. A trigger edge does not order two nodes, so this data edge is what makes the read follow the write.Switch(Data Flow) — forwards one of its inputs, picked by a 0-based index. Theselectorparam sets the index; wiring theselectorport overrides it with a value computed during the run. Wiring the last empty input adds another, up to 16. An index that is out of range or names an unwired input stops the run with an error, and Run refuses aselectorparam that does so before anything runs. The output carries the type of the wired inputs, which must all be the same type. With theselectorparam, the run skips every node that only feeds inputs the Switch does not pick: it is not executed, cached or exported, and its card says not selected. With theselectorport, the choice is made during the run, so every wired input is computed first, and an error in an input the Switch then does not pick still stops the run. When several sources should feed one input, wire them into a Switch.
Port data types
Edges are typed. The built-in data types include: Tensor, Model, Dataset, DataLoader, Optimizer, Loss, Scalar, String, Image, List, Transform, Any, Trigger. The Trigger type is what Start nodes emit to drive execution order, and Transform is what the transform-chain nodes pass to each other.