Skip to main content

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.

CategoryNodesCount
CNNConv2d, Conv1d, Conv2dExplicit, ConvTranspose2d, MaxPool2d, AvgPool2d, AdaptiveAvgPool2d, BatchNorm2d, Dropout, Activation10
RNNLSTM, GRU, RNNCell3
TransformerMultiHeadAttention, TransformerEncoder, TransformerDecoder, MoELayer4
RLDQN, PPO, EnvWrapper, RewardModel, KLDivergence, PolicyRollout, PPOClipObjective, GroupRelativeAdvantage, Discount, GridWorldEnv, PreferenceDataset, BradleyTerryLoss, BradleyTerryTrain, RLTrainingLoop14
DataDataset, 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, TensorDataset30
Data FlowMap, Reduce, Switch3
TrainingOptimizer, Loss, TrainingLoop, EvaluateModel, LRScheduler, SequentialModel, BackwardOnce7
IOImageReader, ImageWriter, ImageBatchReader, FileReader, CheckpointSaver, CheckpointLoader, ModelLoader, ModelSaver, Inference, GraphInput, GraphOutput, VideoLoad, VideoWrite13
ControlStart1
UtilityPrint, Reshape, Concat, Flatten, Linear, Visualize, Embedding, PythonScript, ScatterPlot2D, DecisionBoundary10
NormalizationBatchNorm1d, LayerNorm, GroupNorm, InstanceNorm2d4
Tensor OperationsAdd, MatMul, Mean, Multiply, ScalarMultiply, Permute, Softmax, Argmax, Split, Squeeze, Stack, TensorCreate, Unsqueeze, MaskedFill, TensorStats15
LLMLLMChat, Tokenizer, WordVector, TextEmbedding, EmbeddingScatter, CosineSimilarity, AttentionMask, AttentionHeatmap, PositionalEncoding, CausalLMModel, LMCrossEntropyLoss, LMTokenizer, TextCorpusDataset, LMTokenizedDataset, DataMixDataset, PerplexityEvaluate, TextGenerate, DocumentLoader, TextChunker, VectorStore, Retriever, PromptBuilder, HFTextGenerate23
ClassicalKNN, LinearRegression, LogisticRegression, DecisionTreeClassifier, RandomForestClassifier, SVMClassifier, MLPClassifier, Accuracy, RegressionMetrics9
DiffusionUpsample, TimestepEmbedding, Lerp, GaussianNoise, DDPMSampler, DiffusionUNet, DiffusionTrainingLoop7
VLAVLAModel, VLARollout, VLAActionEval, PushWorldEnv, PushWorldDemos5

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: ResizeTransform resizes to a square; ToTensorTransform converts a PIL image to a [0, 1] tensor; NormalizeTransform applies per-channel normalisation and provides presets; RandomCrop, RandomHorizontalFlip, RandomRotation, ColorJitter, and RandAugment apply augmentations; and ComposeTransform joins 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's ImageFolder. Its optional path input replaces the path param when wired.
  • The tabular training path (Data, Classical) — CSVReader → TrainTestSplit → TensorDataset → DataLoader → TrainingLoop trains a neural network on a CSV. Set CSVReader's target_type to number for a regression target, which then arrives as a list of floats. TensorDataset pairs features with targets: number gives float32 targets, a 1-D target becoming [N, 1] to match a model with one output; class gives int64 class indices for CrossEntropyLoss, and the test split's TensorDataset takes the training one's classes output on its classes input so both number each class the same way, even when the test split lacks a class; token keeps integer targets at their shape as int64, such as [N, T] next-token ids for LMCrossEntropyLoss. RegressionMetrics compares predictions with true values and returns MSE, MAE and R², which it also records as run metrics, as Accuracy records accuracy. KFoldSplit takes the same inputs as TrainTestSplit and holds out one fold of a k-fold split (sklearn's KFold, or StratifiedKFold with stratify on) as x_val and y_val; a sweep over its fold param from 0 to n_folds - 1 is k-fold cross-validation. LinearRegression takes a split's y_train list directly, so a CSV regression needs no ColumnSelector.
  • 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 controls precision and accumulate_steps (see Training Memory) and strategy, whose ddp trains 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 one Input node and one Output node, 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 as model_architecture.json. Import reads such a file, or a canvas graph .json: its layer nodes become an Input → layers → Output chain, or, if it has no layer nodes, a SequentialModel in 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: a Reshape shape loses its batch entry, an Embedding padding_idx of -1 is dropped, and the LayerNorm, AdaptiveAvgPool2d and MultiHeadAttention params 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 (an Add with alpha other than 1, a cross-attention node, a Reshape with no batch entry) stops the import with a message naming it, and a canvas Mean, 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, Concat and Stack depend on operand order, so each operand has its own labelled input on the card (a / b on Subtract, in0, in1, ... on Concat and Stack) 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's glove-50d and sentence-encoder options, and all of TextEmbedding, 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: TextCorpusDataset reads text rows from the Hugging Face Hub or a local .txt; DataMixDataset mixes 2 to 6 of those corpora into one: ratio makes weights the share of each corpus in total_rows output rows, repeating or subsampling rows as needed; interleave uses every row once, so the share is the corpus sizes and weights only spread the corpora through an order fixed by seed; concat reads the corpora one after another as a curriculum; LMTokenizedDataset creates fixed-length next-token blocks; DataLoader supplies batches to TrainingLoop; CausalLMModel provides the model; LMCrossEntropyLoss provides the loss; and LMTokenizer supplies the shared tokenizer (a tiktoken BPE table, or the byte and char encodings for a vocabulary small enough for a character-level model). PerplexityEvaluate scores a held-out split, and TextGenerate samples from the trained weights. The default CausalLMModel has 203,668,480 parameters; reduce d_model and n_layers for 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: DocumentLoader reads each .md and .txt in a directory as {text, source}; TextChunker creates embeddable chunks with source names and character offsets; TextEmbedding creates vectors; VectorStore stores one [N, D] matrix with the chunk text and searches it with one matrix multiplication; Retriever returns the nearest top_k chunks and their scores; PromptBuilder inserts the chunks and question into a context-only template; and HFTextGenerate runs Qwen2.5-0.5B-Instruct locally. LLMChat can replace HFTextGenerate to use Ollama or a hosted provider. TextEmbedding requires the sentence-embeddings pack, and HFTextGenerate requires the rag pack. 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, and TrainingLoop, then uses VLAActionEval and VLARollout. PushWorldEnv implements a language-conditioned 2D push task in torch; distractor pucks make the instruction necessary to identify the goal. PushWorldDemos creates scripted-expert behaviour-cloning samples and a held-out split. VLAModel combines a vision stem, byte-level instruction embedding, transformer trunk, and chunked action expert. VLAActionEval measures held-out open-loop MSE against the expert, while VLARollout measures 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) — GridWorldEnv provides a gridworld without a Gymnasium dependency. PolicyRollout runs a policy for N episodes and records states, actions, rewards, and logits. Discount computes returns, GroupRelativeAdvantage computes GRPO's group-mean baseline, and PPOClipObjective computes PPO's clipped surrogate and returns a mask showing which samples used the clipped branch. RewardModel produces one scalar score per sequence. PreferenceDataset creates training and held-out preference pairs; BradleyTerryLoss computes the preference loss; and BradleyTerryTrain fits a reward head and reports training and held-out accuracy to expose shortcut learning. KLDivergence computes the policy-to-reference regularisation term. DQN, PPO, and EnvWrapper integrate with Gymnasium. RLTrainingLoop trains an agent end to end with REINFORCE, DQN or PPO: wire a model (DQN or SequentialModel for REINFORCE and DQN, the PPO actor-critic for PPO), an env from EnvWrapper or GridWorldEnv and an Optimizer, and it runs for episodes episodes or until the mean return of the last 20 reaches target_return, drawing the live loss chart and recording mean_return as a run metric. See RLHF reward and KL terms in Examples Gallery.
  • The diffusion chain (Diffusion) — GaussianNoise creates seeded noise and can match an upstream tensor's shape. DiffusionUNet provides a toy U-Net that maps (x, t) to predicted noise, and DiffusionTrainingLoop trains it. DDPMSampler performs the reverse process in one node so the graph remains acyclic; its verbose trace records trajectory snapshots. TimestepEmbedding, Upsample, and Lerp support an explicit construction of the same operations. The Diffusion examples are Forward diffusion on a digit (GaussianNoise and Lerp), Toy reverse diffusion sampling and Mini U-Net node (GaussianNoise → DiffusionUNet → DDPMSampler). See Examples Gallery.
  • ModelSaver / ModelLoader (IO) — write and read model files. Their default state_dict mode stores tensors and imposes no class-loading requirements. Their full_model mode 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) — VideoWrite encodes a frame tensor, (T, C, H, W) or (T, H, W, C), into the media folder (backend/data/media, or assets/media in a project directory). With format at auto it writes an mp4 when an ffmpeg binary is on PATH and a gif through Pillow otherwise; mp4 requires ffmpeg. The same filename overwrites the previous clip. The Execution Log and the Inspector play an mp4 inline and show a gif as an image, and the preview output is a PNG of the middle frame. VideoLoad decodes a video into (T, 3, H, W) frames in [0, 1] plus fps and num_frames, and reads a relative path from the media folder. mp4 and webm need the ffmpeg and ffprobe binaries, gif needs only Pillow, and max_frames and stride limit how many frames are held in memory.
  • ImageWriter / ImageBatchReader (IO) — ImageWriter saves a tensor as an image under the data directory's output folder (backend/data/output, or assets/output in a project directory). Its image input 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.png becomes shape_0.png, shape_1.png, ...). The path, paths and directory outputs name what was written. ImageBatchReader stacks every matching image in a directory into (N, C, H, W); wiring ImageWriter.directory into its optional directory input replaces the directory param 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. The selector param sets the index; wiring the selector port 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 a selector param that does so before anything runs. The output carries the type of the wired inputs, which must all be the same type. With the selector param, 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 the selector port, 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.