Skip to main content

Plugin Packs

Educational ("Edu") nodes ship as installable plugin packs, organised by direction so each maps onto a hands-on textbook module and installs cumulatively as you progress.

cdui plugin install foundations deep rl # full textbook companion
cdui plugin list
cdui plugin info deep # manifest, lessons covered, node names
cdui plugin search attention # query the catalog
cdui plugin install foo/bar # third-party pack from GitHub
cdui plugin uninstall deep

What's available

PackHands-on modulesEdu nodes
foundationsI1 Data Representation · I2 Classical MLEdu-ColumnStats, Edu-KNN, Edu-LinearRegression, Edu-LogisticRegression, Edu-TokenEmbedding, Edu-FFN
deepI3 Vision · I4 SequencesEdu-CrossAttention, Edu-ResBlock, Edu-SelfAttention, Edu-MultiHeadAttention, Edu-Patchify
rlI5 Reinforcement LearningEdu-PolicyGradient

Each Edu node decomposes a single lesson concept into a chain of named steps that the Teaching Inspector renders one row at a time — Edu-ColumnStats shows the population-std formula as sum → divide → deviations² → variance → sqrt; Edu-PolicyGradient exposes softmax → gather → log → baseline → loss; Edu-Patchify makes unfold → permute → flatten visible. Switch on Verbose mode in the Settings popover to capture them.

How packs are stored

  • Built-in direction packs live in plugins/<id>/ inside the repo and are activated in place (no copies).
  • Third-party packs are downloaded as a pinned-SHA tarball into <USER_DATA>/plugins/<id>/ and AST-validated before install.
  • A lockfile at <USER_DATA>/plugins/installed.json records every install, so cdui start rediscovers them on the next launch.

Plugin nodes are namespaced to avoid collisions and to self-document graphs — built-in nodes use a bare name like Conv2d, while plugin nodes are qualified like foundations:Edu-KNN.

Writing your own plugin

The fastest start is cdui plugin new, which scaffolds a ready-to-edit plugin in one command:

cdui plugin new my-plugin # backend-only skeleton
cdui plugin new my-plugin --ui # also a React frontend wired to the SDK

It generates a manifest, an example node, a test (with the cdui_plugins.<id> namespace shim so pytest works locally), and — with --ui — a Vite + React ui/ whose src/sdk/ is the typed plugin SDK. The plugin lands in ./my-plugin/; link it with cdui plugin dev (below) and start editing.

For a richer reference, fork the Official Plugin Template — a working, MIT-licensed plugin with two example nodes, a sample example graph, a test suite, and a fully-commented manifest. Its README walks through every field and the AST security gate.

# Install the template itself to see the pattern live
cdui plugin install treeleaves30760/CodefyUI-Plugin-Official

# After forking
cdui plugin install your-username/your-fork

A pack ships any of: a nodes/ directory (auto-discovered), a presets/ directory, an examples/ directory, and an assets/ directory (mounted at /plugins/<id>/assets/<file>). A cdui.plugin.toml manifest declares the id, version, requires_codefyui, content directories, and lesson metadata.

:::warning Breaking change (v0.3) The chapter packs c1c6 were repackaged into three direction packs foundations / deep / rl, and every Edu node's type id gained a dash (EduKNNEdu-KNN). Saved graphs referencing the old cN:EduFoo types must be updated to <pack>:Edu-Foo and the packs reinstalled with cdui plugin install foundations deep rl. :::

Local development

You don't need to push to GitHub between iterations while building a plugin. Link your working directory and CodefyUI loads it in place:

cdui plugin link ./my-plugin # register the local dir in place (no copy)
# ...edit nodes/ or frontend/...
cdui plugin reload # pick up changes in a running server
cdui plugin unlink my-plugin # remove the link — your files are untouched

Even simpler, dev links and watches in one command, hot-reloading on every save:

cdui plugin dev ./my-plugin # link + watch; reloads on every change

Run the server in another terminal (cdui start or cdui dev). dev polls the plugin's manifest, nodes/, presets/, and frontend/; --once links and reloads a single time (no watch), and --interval tunes the poll frequency. link, dev, and reload reach the server on its configured port (CODEFYUI_PORT, default 8000), so running on a non-default port needs no extra flags.

link reads the id from your cdui.plugin.toml and records the directory's absolute path in the lockfile as source_kind = "local", so discovery walks your working tree directly. The AST security gate is skipped for linked plugins (it's your own code, and a warning says so); unlink drops only the lockfile entry, never your files. After editing Python nodes, cdui plugin reload (or cdui plugin dev) reloads them. Frontend edits to a linked plugin reload automatically too — while a linked plugin is installed the editor watches for reloads and re-mounts the plugin's UI in place, no browser refresh needed.

:::tip Dev data isolation Running plugin commands through scripts/dev.py — or setting CODEFYUI_USER_DATA_DIR — keeps a clone's lockfile inside the repo (.codefyui_dev/) instead of the machine-wide user-data dir, so multiple clones don't clobber each other. :::

REST API

EndpointMethodDescription
/api/pluginsGETList installed plugin packs.
/api/plugins/{id}GETGet a plugin's manifest + README.
/api/plugins/reloadPOSTHot-reload all node and preset sources.