- CLAUDE.md: routing table (what to read for which node domain), the workflow-compatibility contract, harness commands, environment facts, and every import-time side effect. - web/WEB.md: lib/nodes/vendor layer map, lazy CSS injection, power-lora base relationship, import-depth conventions. - AGENTS.md now tracked (was gitignored) and points at CLAUDE.md. - .claude/skills/verify-nodes: one-shot verification skill for any future agent session. - Module docstrings on the remaining split modules; last emoji comment and stale path references cleaned. Schema 68 identical; web checker clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3.2 KiB
web/ — frontend layer map
ComfyUI serves this whole directory as WEB_DIRECTORY and auto-loads every
.js it finds; index.js ALSO imports everything explicitly (ES modules
dedupe, so double-loading is harmless) — keep new files listed in index.js
so loading never depends on the server's glob behavior. scripts/check_web.py
enforces this.
Layers
-
lib/— shared library, originally derived from rgthree-comfy's module split and renamed with themxd_prefix. These are complementary layers, NOT duplicates — don't merge them:mxd_runtime.js— singleton runtime; patchesapp.loadApiJson, canvas copy/paste tracking, toast messages.mxd_utils.js— LiteGraph graph/topology helpers (connection layout, node traversal). Imports frommxd_shared_utils.js.mxd_shared_utils.js— generic helpers (debounce, resolver, array ops,injectCss).mxd_utils_dom.js/mxd_utils_canvas.js/mxd_utils_widgets.js/mxd_utils_menu.js— DOM building, canvas drawing primitives, custom widget classes, model/lora chooser menus.mxd_base_node.js—MxdBaseNode/MxdBaseServerNode+registerForOverridemachinery (how MXD classes replace the stock LiteGraph node class for a Python node).mxd_dialog.js→mxd_dialog_info.js— dialog base → model-info dialogs. CSS is injected LAZILY: the first opened info dialog callsinjectCssonmxd_dialog_base.css(which@imports dialog/buttons/menu css) andmxd_dialog_model_info.css. CSS must stay inlib/next tomxd_dialog_info.js(paths derive from itsimport.meta.url).mxd_api.js/mxd_model_info_service.js/mxd_model_row_widget.js/mxd_smart_search.js/mxd_menu.js/mxd_svgs.js.
-
nodes/— one extension file per node/feature. Each registers viaapp.registerExtensionand targets Python node names inbeforeRegisterNodeDef(names must matchNODE_CLASS_MAPPINGSkeys).power_lora_base.js— shared base for BOTH lora loaders: node machinery, header row, single-strength row widget.power_lora_loader.jsadds the dual model/clip strength mode;ltx2_power_lora_loader.jsadds the five per-layer strength rows. Fix shared bugs in the base, not in the forks. Serialization shapes are frozen (see root CLAUDE.md contract).better_combos.js— folder-tree/grid combo display for the MXD latent loaders (adapted from pysssss; scoped to MXD nodes only; keeps its BOM).live_preview_panel.js— floating panel consuming theMXD_live_preview_*websocket events fromsystem/live_preview.pyandnodes/ltx/preview.py.run_folder.js— wrapsapp.queuePromptfor batch folder runs; uses/mxd/latents/files.
-
vendor/zip_loader/— vendored drag-drop zip workflow importer + bundledjszip.min.js(never lint/format the min file).
Conventions
- Imports of
../../../scripts/app.js(and api.js/ui.js/widgets.js) are ComfyUI-served URLs — the number of../depends on the file's depth underweb/. Files inlib/andnodes/use three../. - UTF-8 without BOM (exception:
nodes/better_combos.js). - After ANY web change run:
C:\Users\user\Documents\ComfyUI\.venv\Scripts\python.exe scripts/check_web.py