Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

comfyui-node-authoring

БесплатноБез исполняемых скриптовНе проверен

ComfyUI frontend/backend authoring facts: hiding/serializing widgets, DOM event isolation, endpoints, tooltip lookup, canvas hit-testing, sourcemap…

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

comfyui-node-authoring

Facts about how ComfyUI's frontend and backend actually behave, gathered from reverse-engineering the (minified) frontend bundle and from real bugs that shipped despite green tests. These apply to any custom-node pack regardless of build system — hand-authored web/js/*.js, or a TypeScript+bun-build pack (the layout comfyui-node-scaffold generates).

When to Use This Skill

Use this skill when... Use instead when...
Writing or patching a custom node's frontend or backend code Setting up the pack's release/publish pipeline -> comfy-registry-lifecycle
Verifying an undocumented LiteGraph/Vue API shape Smoke-testing the finished pack live -> comfyui-pack-live-smoke

Pack layout

<pack>/
  __init__.py             # NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS, WEB_DIRECTORY
  <name>.py                # backend node(s) + any /<your>/<endpoint> routes
  web/
    js/<name>.js            # vanilla-JS frontend extension (hand-authored layout)
    css/<name>.css          # NOT auto-loaded — inject a <link> from the JS
  # — or, for a TS+bun-build pack (comfyui-node-scaffold) —
  src/index.ts              # TypeScript source; WEB_DIRECTORY = "./web/dist"
  web/dist/                 # built output, committed

The pack directory name becomes the served URL segment (/extensions/<pack-dir>/...). Keep it lowercase-kebab so the path is predictable.

web/dist ships only in the registry tarball, never a bare git clone, for TS-built packs — it's git-ignored. git clone/nightly installs land main without it (the extension is dead until bun run build runs locally); only a correctly-configured registry publish ships a prebuilt frontend. See comfy-registry-lifecycle for the publish-pipeline traps that can silently break this.

Frontend import paths

From a vanilla web/js/<file>.js, reach the comfy frontend exports with 3 ups:

import { app } from "../../../scripts/app.js";

Two ups (the rgthree convention) only works for files at web/<file>.js.

Hiding a widget while keeping it serializable

To take over a node's input UI with a DOM widget while leaving the underlying widget's value reachable by the backend, set BOTH:

widget.hidden = true;
widget.options = widget.options || {};
widget.options.hidden = true;
widget.computeSize = () => [0, -4];
// Belt-and-braces for frontends that position DOM elements regardless of `hidden`:
for (const key of ["element", "inputEl"]) {
    const el = widget[key];
    if (el?.style) el.style.display = "none";
}

The hidden / options.hidden pair is what the frontend reads internally. Setting only widget.type = "hidden_something" (the old pattern) is insufficient — STRING widgets create a DOM input element positioned by canvas coords that ignores the type change.

A non-serializable widget must set widget.serialize = false AND be appended last

When a pack adds a helper widget to a node — a "button" opener, a label, any control the user shouldn't have persisted — it MUST both (1) set widget.serialize = false on the widget object itself and (2) be appended to the end of node.widgets. Getting either wrong silently corrupts the widgets_values of every opened workflow, and the frontend then autosaves the corrupted graph back to disk.

The frontend's save/restore loops key on widget.serialize, not widget.options.serialize:

// save (serialize): index-based, non-compacting
for (const [n, r] of widgets.entries()) { if (r.serialize === false) continue; wv[n] = r.value }
// restore (configure): compacting counter
if (wv) { let t = 0; for (const w of widgets) if (w.serialize !== false) { if (t >= wv.length) break; w.value = wv[t++] } }

Two traps:

  1. addWidget(type, name, value, cb, { serialize: false }) is INEFFECTIVE. addWidget stores the option in widget.options.serialize and never sets widget.serialize — so the loops above still treat the widget as serializable. You must assign widget.serialize = false directly (the frontend's own non-serialized widgets do exactly this).
  2. Position matters even with serialize = false. Save is index-based (wv[rawIndex]) but restore is compacting (wv[t++]). A skipped widget placed before real widgets leaves a hole → a leading null on save → every value shifts by one on the next open. A serializable widget at index 0 (e.g. unshifted in nodeCreated, which runs before configure() restores values) consumes wv[0] outright.
const btn = node.addWidget?.("button", "…", null, cb, { serialize: false });
if (btn) btn.serialize = false;   // the flag the frontend actually checks
// do NOT unshift/splice it to the front — addWidget appends to the end; leave it there

Add a serialize?: boolean field to the pack's local widget interface so this type-checks. To verify live in a devtools console:

const n = app.graph._nodes.find(n
Полный SKILL.md на GitHub

Установить comfyui-node-authoring в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(grep *)
Bash(head *)
Read
Grep
Glob

Вложенные файлы

references/backend-endpoints.mdreferences/frontend-bundle-reverse-engineering.mdreferences/frontend-lookups.mdreferences/live-repro.mdreferences/widget-option-source-gate.md

FAQ

Что делает скилл comfyui-node-authoring?

ComfyUI frontend/backend authoring facts: hiding/serializing widgets, DOM event isolation, endpoints, tooltip lookup, canvas hit-testing, sourcemap verification. Use when writing or patching a custom node's code.

Как установить скилл comfyui-node-authoring?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл comfyui-node-authoring запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить comfyui-node-authoring с