From c7b06f59065f9e393753b1911a5ae61e7870253f Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sun, 21 Jun 2026 12:52:31 +0200 Subject: [PATCH] feat(workflow): missing nodes defer to ComfyUI Manager installer --- js/nodes_stats.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/js/nodes_stats.js b/js/nodes_stats.js index 9f1cd89..03654cd 100644 --- a/js/nodes_stats.js +++ b/js/nodes_stats.js @@ -722,6 +722,31 @@ async function handleEnable(pkg, temporary, dialog) { } } +// Missing packages are deferred to ComfyUI Manager — the design treats "Missing" +// as handled by Manager like always, and Manager already surfaces missing nodes +// on workflow load. We intentionally do NOT replicate install: a not-installed +// pack's exact spec can't be resolved reliably client-side (mode=local getlist +// exposes no cnr_id and an ambiguous version field, so cnr@latest vs git@unknown +// can't be chosen without risking "cannot resolve install target"). Instead open +// Manager's Custom Nodes Manager (which has a built-in Missing filter); if that +// command isn't available in this ComfyUI build, guide the user to it. +async function handleInstall(pkg, dialog) { + let opened = false; + try { + const cmd = app?.extensionManager?.command; + if (cmd && typeof cmd.execute === "function") { + await cmd.execute("Comfy.Manager.CustomNodesManager.ToggleVisibility"); + opened = true; + } + } catch { /* fall through to guidance */ } + notify( + opened + ? `Opened ComfyUI Manager — choose the "Missing" filter to install ${pkg}.` + : `Install ${pkg} via ComfyUI Manager → "Install Missing Custom Nodes".`, + "info" + ); +} + function setWorkflowButtonsBusy(dialog, busy) { dialog.querySelectorAll(".ns-enable-temp-btn, .ns-enable-perm-btn, .ns-install-btn").forEach((b) => { b.disabled = busy;