comfyui-mcp 0.49.0 → 0.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -10
- package/dist/comfyui/cloud-client.js +2 -2
- package/dist/comfyui/cloud-client.js.map +1 -1
- package/dist/config.js +22 -0
- package/dist/config.js.map +1 -1
- package/dist/orchestrator/agent-backend.js +9 -0
- package/dist/orchestrator/agent-backend.js.map +1 -1
- package/dist/orchestrator/antigravity-backend.js +3 -2
- package/dist/orchestrator/antigravity-backend.js.map +1 -1
- package/dist/orchestrator/call-tool-admission.js +160 -0
- package/dist/orchestrator/call-tool-admission.js.map +1 -0
- package/dist/orchestrator/chatgpt-oauth-backend.js +3 -2
- package/dist/orchestrator/chatgpt-oauth-backend.js.map +1 -1
- package/dist/orchestrator/claude-backend.js +300 -3
- package/dist/orchestrator/claude-backend.js.map +1 -1
- package/dist/orchestrator/codex-backend.js +3 -2
- package/dist/orchestrator/codex-backend.js.map +1 -1
- package/dist/orchestrator/gemini-backend.js +3 -2
- package/dist/orchestrator/gemini-backend.js.map +1 -1
- package/dist/orchestrator/grok-backend.js +5 -3
- package/dist/orchestrator/grok-backend.js.map +1 -1
- package/dist/orchestrator/index.js +169 -137
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/orchestrator/ollama-backend.js +3 -2
- package/dist/orchestrator/ollama-backend.js.map +1 -1
- package/dist/orchestrator/panel-agent.js +89 -19
- package/dist/orchestrator/panel-agent.js.map +1 -1
- package/dist/orchestrator/panel-tools.js +955 -81
- package/dist/orchestrator/panel-tools.js.map +1 -1
- package/dist/orchestrator/pi-backend.js +3 -2
- package/dist/orchestrator/pi-backend.js.map +1 -1
- package/dist/orchestrator/session-store.js +22 -0
- package/dist/orchestrator/session-store.js.map +1 -1
- package/dist/services/civitai-resolver.js +22 -7
- package/dist/services/civitai-resolver.js.map +1 -1
- package/dist/services/comfy-cli.js +1 -1
- package/dist/services/download-jobs.js +1 -1
- package/dist/services/extra-paths.js +7 -7
- package/dist/services/extra-paths.js.map +1 -1
- package/dist/services/graph-query.js +10 -4
- package/dist/services/graph-query.js.map +1 -1
- package/dist/services/manager-config.js +11 -2
- package/dist/services/manager-config.js.map +1 -1
- package/dist/services/model-resolver.js +4 -4
- package/dist/services/model-resolver.js.map +1 -1
- package/dist/services/node-authoring.js +3 -3
- package/dist/services/node-authoring.js.map +1 -1
- package/dist/services/node-dev.js +3 -3
- package/dist/services/node-dev.js.map +1 -1
- package/dist/services/node-management.js +185 -9
- package/dist/services/node-management.js.map +1 -1
- package/dist/services/node-snapshots.js +117 -12
- package/dist/services/node-snapshots.js.map +1 -1
- package/dist/services/node-verify.js +1 -1
- package/dist/services/node-verify.js.map +1 -1
- package/dist/services/output-dir.js +1 -1
- package/dist/services/output-dir.js.map +1 -1
- package/dist/services/panel-installer.js +466 -6
- package/dist/services/panel-installer.js.map +1 -1
- package/dist/services/panel-pending-cancel.js +446 -0
- package/dist/services/panel-pending-cancel.js.map +1 -0
- package/dist/services/panel-pin-guard.js +50 -3
- package/dist/services/panel-pin-guard.js.map +1 -1
- package/dist/services/panel-sync.js +3 -20
- package/dist/services/panel-sync.js.map +1 -1
- package/dist/services/process-control.js +132 -8
- package/dist/services/process-control.js.map +1 -1
- package/dist/services/queue-manager.js +1 -1
- package/dist/services/queue-manager.js.map +1 -1
- package/dist/services/queue-monitor.js +1 -1
- package/dist/services/queue-monitor.js.map +1 -1
- package/dist/services/queue-monitor.self-attribution.test.js +1 -1
- package/dist/services/queue-monitor.self-attribution.test.js.map +1 -1
- package/dist/services/ui-bridge.js +180 -17
- package/dist/services/ui-bridge.js.map +1 -1
- package/dist/services/update-comfyui.js +29 -2
- package/dist/services/update-comfyui.js.map +1 -1
- package/dist/services/workspace-env.js +3 -3
- package/dist/services/workspace-env.js.map +1 -1
- package/dist/tools/api-nodes.js +1 -1
- package/dist/tools/api-nodes.js.map +1 -1
- package/dist/tools/batches.js +1 -1
- package/dist/tools/batches.js.map +1 -1
- package/dist/tools/compact.js +32 -6
- package/dist/tools/compact.js.map +1 -1
- package/dist/tools/extra-paths.js +1 -1
- package/dist/tools/extra-paths.js.map +1 -1
- package/dist/tools/generate-3d.js +2 -2
- package/dist/tools/generate-3d.js.map +1 -1
- package/dist/tools/install-panel.js +62 -22
- package/dist/tools/install-panel.js.map +1 -1
- package/dist/tools/model-explorer.js +175 -117
- package/dist/tools/model-explorer.js.map +1 -1
- package/dist/tools/queue-management.js +117 -135
- package/dist/tools/queue-management.js.map +1 -1
- package/dist/tools/run-template.js +4 -4
- package/dist/tools/run-template.js.map +1 -1
- package/dist/tools/vocabulary.js +123 -19
- package/dist/tools/vocabulary.js.map +1 -1
- package/dist/tools/workflow-autoload.js +5 -5
- package/dist/tools/workflow-autoload.js.map +1 -1
- package/dist/tools/workflow-execute.js +1 -1
- package/dist/tools/workflow-execute.js.map +1 -1
- package/dist/tools/workspace-env.js +53 -28
- package/dist/tools/workspace-env.js.map +1 -1
- package/docs/design/panel-surface.txt +1 -0
- package/docs/design/tool-surface.txt +3 -0
- package/package.json +2 -2
- package/plugin/commands/batch.md +1 -1
- package/plugin/commands/gen.md +2 -2
- package/plugin/scripts/monitor-progress.mjs +1 -1
- package/plugin/skills/comfyui-core/SKILL.md +15 -13
- package/plugin/skills/director/SKILL.md +1 -1
- package/plugin/skills/ltxv2-video/SKILL.md +1 -1
- package/plugin/skills/troubleshooting/SKILL.md +1 -1
- package/plugin/skills/video-extend/SKILL.md +1 -1
- package/plugin/skills/workflow-layout/SKILL.md +4 -5
- package/scripts/arena-scenarios.mjs +5 -5
- package/scripts/check-tool-vocabulary.mts +9 -0
- package/scripts/gen-tool-docs.ts +31 -10
|
@@ -29,7 +29,7 @@ export async function registerAutoloadedWorkflows(server) {
|
|
|
29
29
|
}
|
|
30
30
|
// A tool name here comes from a FILENAME (slugify, src/services/workflow-autoload.ts),
|
|
31
31
|
// so it is user-controlled and can collide. Before this guard, saving a workflow as
|
|
32
|
-
// `
|
|
32
|
+
// `get_history.json` made the SDK throw "Tool get_history is already registered" and the
|
|
33
33
|
// MCP server FAILED TO START — a user bricking their own install by naming a file,
|
|
34
34
|
// with an error that names a tool rather than the file to rename.
|
|
35
35
|
//
|
|
@@ -38,10 +38,10 @@ export async function registerAutoloadedWorkflows(server) {
|
|
|
38
38
|
// `my_flow`).
|
|
39
39
|
//
|
|
40
40
|
// RETIRED names are reserved too, not just live ones. Otherwise the consolidation
|
|
41
|
-
// creates a worse failure than the one it removes: once
|
|
42
|
-
// pre-existing
|
|
41
|
+
// creates a worse failure than the one it removes: once a name is retired, a
|
|
42
|
+
// pre-existing <name>.json stops being "skipped, name taken" and becomes a
|
|
43
43
|
// REGISTERED tool, so a model still holding the old name silently ENQUEUES the
|
|
44
|
-
// user's workflow instead of
|
|
44
|
+
// user's workflow instead of calling the replacement. A 404 is recoverable; a wrong
|
|
45
45
|
// action that looks like it worked is not.
|
|
46
46
|
const taken = new Set([...TOOL_NAMES, ...DEAD_NAMES.map((d) => d.name)]);
|
|
47
47
|
for (const wf of discovered) {
|
|
@@ -62,7 +62,7 @@ export async function registerAutoloadedWorkflows(server) {
|
|
|
62
62
|
const description = `Enqueue the autoloaded ComfyUI workflow "${wf.toolName}" ` +
|
|
63
63
|
`(loaded from ${basename(wf.filePath)}) for execution and return immediately ` +
|
|
64
64
|
`with its prompt_id and queue position — it does NOT wait for the result; ` +
|
|
65
|
-
`poll
|
|
65
|
+
`poll queue (action:"status") or get_history afterwards. Requires a running ComfyUI server. ` +
|
|
66
66
|
`Each parameter below substitutes a PARAM_* placeholder in the saved workflow, and ` +
|
|
67
67
|
`all parameters are required. Params: ${paramSummary || "(none)"}`;
|
|
68
68
|
server.tool(wf.toolName, description, shape, async (args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-autoload.js","sourceRoot":"","sources":["../../src/tools/workflow-autoload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA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,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAe;4BACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;gCACE,MAAM,EAAE,UAAU;gCAClB,IAAI,EAAE,EAAE,CAAC,QAAQ;gCACjB,SAAS,EAAE,MAAM,CAAC,SAAS;gCAC3B,eAAe,EAAE,MAAM,CAAC,eAAe;6BACxC,EACD,IAAI,EACJ,CAAC,CACF;yBACF;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;YAChC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,qCAAqC,EAAE;YACjD,IAAI,EAAE,EAAE,CAAC,QAAQ;YACjB,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;SAC/B,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { getTracker } from "../services/generation-tracker.js";
|
|
|
8
8
|
import { extractSettings } from "../services/workflow-settings-extractor.js";
|
|
9
9
|
import { logger } from "../utils/logger.js";
|
|
10
10
|
export function registerWorkflowExecuteTools(server) {
|
|
11
|
-
server.tool("enqueue_workflow", "Submit a ComfyUI workflow for execution and return immediately with the prompt_id and queue position. Does not wait for completion. Use
|
|
11
|
+
server.tool("enqueue_workflow", "Submit a ComfyUI workflow for execution and return immediately with the prompt_id and queue position. Does not wait for completion. Use queue (action:\"status\") to check progress later, or get_history to retrieve results and images after completion.", {
|
|
12
12
|
workflow: z
|
|
13
13
|
.record(z.string(), z.any())
|
|
14
14
|
.describe("ComfyUI workflow in API format (node ID -> {class_type, inputs})"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execute.js","sourceRoot":"","sources":["../../src/tools/workflow-execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,eAAe,E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nvironment, } from "../services/workspace-env.js";
|
|
3
3
|
import { errorToToolResult } from "../utils/errors.js";
|
|
4
|
+
/**
|
|
5
|
+
* The three workspace tools collapsed into one action-parameterized `workspace`
|
|
6
|
+
* tool (0.49.0 surface consolidation, slice 6).
|
|
7
|
+
*
|
|
8
|
+
* SHAPE: a FLAT object with an `action` enum — deliberately NOT a
|
|
9
|
+
* z.discriminatedUnion, which the MCP SDK renders as a schema with ZERO visible
|
|
10
|
+
* parameters, hiding every input from the model.
|
|
11
|
+
*
|
|
12
|
+
* REQUIREDNESS: only `action` can be schema-required — `path` is required by
|
|
13
|
+
* set_default and meaningless for get/list. Every VALUE constraint the old
|
|
14
|
+
* tools had is unchanged at the zod layer (`path` keeps its .min(1), so an
|
|
15
|
+
* empty string fails exactly as it did before); the handler enforces per-action
|
|
16
|
+
* PRESENCE and names the missing field — the one deliberate behavioural
|
|
17
|
+
* difference a flat enum permits. Each branch calls the same workspace-env
|
|
18
|
+
* service the old tool called, with the same arguments, and returns the
|
|
19
|
+
* identical JSON content block.
|
|
20
|
+
*/
|
|
4
21
|
export function registerWorkspaceEnvTools(server) {
|
|
5
|
-
server.tool("
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
catch (err) {
|
|
13
|
-
return errorToToolResult(err);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
server.tool("set_default_workspace", "Persist a default ComfyUI workspace path to the MCP config file (mirrors `comfy-cli set-default`). The value is stored under the OS config dir (e.g. ~/.config/comfyui-mcp/workspace.json) and reported by get_workspace/list_workspaces. Does NOT change the live API target.", {
|
|
22
|
+
server.tool("workspace", "Inspect and manage ComfyUI workspaces (local installs). Driven by the `action` parameter:\n" +
|
|
23
|
+
'- action:"get" — Report the active ComfyUI workspace (mirrors `comfy-cli which`): the local installation path being used (from COMFYUI_PATH or auto-detection), the source of that path, any persisted default workspace, and the resolved API target the MCP server talks to.\n' +
|
|
24
|
+
'- action:"set_default" — Persist a default ComfyUI workspace path to the MCP config file (mirrors `comfy-cli set-default`). The value is stored under the OS config dir (e.g. ~/.config/comfyui-mcp/workspace.json) and reported by action:"get"/action:"list". Does NOT change the live API target. `path` is REQUIRED, e.g. {action:"set_default", path:"/opt/ComfyUI"}.\n' +
|
|
25
|
+
'- action:"list" — List known/auto-detected ComfyUI installations on this machine. Scans common install locations across macOS, Linux, and Windows and marks which one is active and which is the saved default.', {
|
|
26
|
+
action: z
|
|
27
|
+
.enum(["get", "set_default", "list"])
|
|
28
|
+
.describe('Which workspace operation to perform. "get" and "list" take no other parameters; "set_default" requires `path`.'),
|
|
17
29
|
path: z
|
|
18
30
|
.string()
|
|
19
31
|
.min(1)
|
|
20
|
-
.
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('action:"set_default" — REQUIRED absolute path to a ComfyUI installation directory to remember as the default workspace.'),
|
|
21
34
|
}, async (args) => {
|
|
22
35
|
try {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const json = (value) => ({
|
|
37
|
+
content: [{ type: "text", text: JSON.stringify(value, null, 2) }],
|
|
38
|
+
});
|
|
39
|
+
switch (args.action) {
|
|
40
|
+
case "get":
|
|
41
|
+
return json(await getWorkspace());
|
|
42
|
+
case "set_default":
|
|
43
|
+
// path cannot be schema-required in a flat shape, so the handler
|
|
44
|
+
// enforces per-action presence and names the missing field — the
|
|
45
|
+
// same information the old per-tool schema gave a caller.
|
|
46
|
+
//
|
|
47
|
+
// ABSENCE only, never falsiness: an empty `path` fails the .min(1)
|
|
48
|
+
// value constraint exactly as it did before this consolidation,
|
|
49
|
+
// and the service's own non-empty validation still answers.
|
|
50
|
+
if (args.path === undefined) {
|
|
51
|
+
throw new Error('workspace action:"set_default" requires `path` — the absolute path to a ComfyUI installation directory.');
|
|
52
|
+
}
|
|
53
|
+
return json(await setDefaultWorkspace(args.path));
|
|
54
|
+
case "list":
|
|
55
|
+
return json(await listWorkspaces());
|
|
56
|
+
default: {
|
|
57
|
+
// Unreachable given the zod enum, but a clear runtime guard beats a
|
|
58
|
+
// silent undefined if the schema and switch ever drift apart.
|
|
59
|
+
const exhaustive = args.action;
|
|
60
|
+
throw new Error(`Unknown workspace action "${String(exhaustive)}". Expected one of: get, set_default, list.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
38
63
|
}
|
|
39
64
|
catch (err) {
|
|
40
65
|
return errorToToolResult(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-env.js","sourceRoot":"","sources":["../../src/tools/workspace-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,IAAI,CACT,
|
|
1
|
+
{"version":3,"file":"workspace-env.js","sourceRoot":"","sources":["../../src/tools/workspace-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,IAAI,CACT,WAAW,EACX,6FAA6F;QAC3F,kRAAkR;QAClR,8WAA8W;QAC9W,iNAAiN,EACnN;QACE,MAAM,E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;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,4vBAA4vB,EAC5vB,EAAE,EACF,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,cAAc,EAAE,CAAC;YACpC,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC1E,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comfyui-mcp",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.2",
|
|
4
4
|
"mcpName": "io.github.artokun/comfyui-mcp",
|
|
5
5
|
"description": "Local-first, agent-native control plane for ComfyUI — MCP server + autonomous sidebar agent that drives your live graph in natural language on ANY LLM: Claude/ChatGPT/Gemini on your subscription (no API key), free local models via Ollama (fully offline), or any hosted model via an OpenAI-compatible endpoint (DeepSeek, GLM, MiMo, OpenRouter). Generate images, video & audio, author and run workflows, manage models and custom nodes; a compact tool-router mode keeps even 4B models effective, and a built-in LLM Arena benchmarks them on real ComfyUI tasks. Also a Claude Code plugin with skills, slash commands, and installer packs. Local, LAN, VPS, or Comfy Cloud.",
|
|
6
6
|
"homepage": "https://comfyui-mcp.artokun.io/docs",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@stable-canvas/comfyui-client": "^1.5.9",
|
|
63
63
|
"better-sqlite3": "^12.6.2",
|
|
64
64
|
"dotenv": "^16.4.7",
|
|
65
|
-
"sharp": "^0.
|
|
65
|
+
"sharp": "^0.35.3",
|
|
66
66
|
"ws": "^8.21.0",
|
|
67
67
|
"yaml": "^2.9.0",
|
|
68
68
|
"zod": "^4.0.0"
|
package/plugin/commands/batch.md
CHANGED
|
@@ -56,7 +56,7 @@ The user wants to generate multiple images while sweeping across different param
|
|
|
56
56
|
|
|
57
57
|
This monitors all jobs simultaneously via ComfyUI's WebSocket and reports step-by-step progress and completion for each. ComfyUI processes them sequentially from its queue. Continue the conversation while waiting.
|
|
58
58
|
|
|
59
|
-
**Fallback**: If the script is unavailable, poll `
|
|
59
|
+
**Fallback**: If the script is unavailable, poll `queue` (action:"status") for each prompt_id until done.
|
|
60
60
|
|
|
61
61
|
8. **Present results.** After all runs complete, show a summary table:
|
|
62
62
|
- Each row: parameter values used, status (success/error), output file
|
package/plugin/commands/gen.md
CHANGED
|
@@ -51,13 +51,13 @@ The user wants to generate an image using ComfyUI. Their prompt is provided as t
|
|
|
51
51
|
node "${CLAUDE_PLUGIN_ROOT}/scripts/monitor-progress.mjs" <prompt_id>
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
This connects to ComfyUI's WebSocket and prints real-time step progress (e.g., `step 3/14 (21%)`), then reports completion with output filenames. You do NOT need to poll `
|
|
54
|
+
This connects to ComfyUI's WebSocket and prints real-time step progress (e.g., `step 3/14 (21%)`), then reports completion with output filenames. You do NOT need to poll `queue` (action:"status") — the background task handles everything.
|
|
55
55
|
|
|
56
56
|
Continue the conversation while waiting. Check the background task output when notified it completed.
|
|
57
57
|
|
|
58
58
|
If the job fails, the monitor prints error details (node, message). Use `get_history` for the full traceback if needed.
|
|
59
59
|
|
|
60
|
-
**Fallback**: If the background script is unavailable, use `
|
|
60
|
+
**Fallback**: If the background script is unavailable, use `queue` (action:"status") to poll until `done` is true.
|
|
61
61
|
|
|
62
62
|
7. **Show the result.** Once the background monitor reports completion, use `list_output_images` (limit 1) to find the newest image. Read it with the Read tool to display it to the user.
|
|
63
63
|
|
|
@@ -255,7 +255,7 @@ function checkStalls() {
|
|
|
255
255
|
job.stallWarned = true;
|
|
256
256
|
if (job.status === "running" && job.step > 0) {
|
|
257
257
|
console.log(
|
|
258
|
-
`[STALL] ${short(promptId)} | No progress for ${idleSec}s (stuck at step ${job.step}/${job.maxSteps}, elapsed ${totalSec}s) — possible OOM or hang. Try
|
|
258
|
+
`[STALL] ${short(promptId)} | No progress for ${idleSec}s (stuck at step ${job.step}/${job.maxSteps}, elapsed ${totalSec}s) — possible OOM or hang. Try queue (action:"cancel") then clear_vram, or restart_comfyui.`,
|
|
259
259
|
);
|
|
260
260
|
} else if (job.status === "running") {
|
|
261
261
|
console.log(
|
|
@@ -131,7 +131,7 @@ SetLatentNoiseMask (samples, mask) → LATENT → KSampler.latent_image
|
|
|
131
131
|
|
|
132
132
|
1. `create_workflow` with template `"txt2img"` and your params
|
|
133
133
|
2. `enqueue_workflow` with the returned JSON — returns `prompt_id` immediately
|
|
134
|
-
3. Poll `
|
|
134
|
+
3. Poll `queue` (action:"status") with the `prompt_id` until `done` is true
|
|
135
135
|
4. Use `list_output_images` (limit 1) to find the generated image, then `Read` to display it
|
|
136
136
|
|
|
137
137
|
### Inspect & Modify
|
|
@@ -200,27 +200,29 @@ The script connects to ComfyUI's WebSocket and reports:
|
|
|
200
200
|
3. Continue conversation — results appear when jobs finish
|
|
201
201
|
4. Use `list_output_images` or `Read` to display the generated images
|
|
202
202
|
|
|
203
|
-
**Do NOT** poll `
|
|
203
|
+
**Do NOT** poll `queue` (action:"status") in a loop. The background monitor replaces polling entirely.
|
|
204
204
|
|
|
205
|
-
**Fallback**: If the monitor script is unavailable, use `
|
|
205
|
+
**Fallback**: If the monitor script is unavailable, use `queue` (action:"status") to poll until `done` is true.
|
|
206
206
|
|
|
207
207
|
### Queue Management
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
- `
|
|
212
|
-
- `
|
|
213
|
-
- `
|
|
209
|
+
One tool, `queue`, driven by its `action` parameter:
|
|
210
|
+
|
|
211
|
+
- `queue` (action:"list") — shows running/pending job counts and prompt_ids
|
|
212
|
+
- `queue` (action:"status") — check if a specific prompt_id is running, pending, or done
|
|
213
|
+
- `queue` (action:"cancel") — interrupt a running job (pass optional `prompt_id` to target a specific one)
|
|
214
|
+
- `queue` (action:"cancel_queued") — remove a specific pending job from the queue by `prompt_id`
|
|
215
|
+
- `queue` (action:"clear") — remove all pending jobs (does NOT stop the currently running job)
|
|
214
216
|
|
|
215
217
|
**When to use queue tools:**
|
|
216
|
-
- To check status: `
|
|
217
|
-
- To abort: `
|
|
218
|
-
- To start fresh: `
|
|
218
|
+
- To check status: `queue` (action:"status") for a quick boolean check (prefer background monitor for ongoing tracking)
|
|
219
|
+
- To abort: `queue` (action:"cancel") stops what's running now; `queue` (action:"cancel_queued") removes a pending one
|
|
220
|
+
- To start fresh: `queue` (action:"clear") then optionally `queue` (action:"cancel")
|
|
219
221
|
|
|
220
222
|
### Monitoring & Recovery
|
|
221
223
|
|
|
222
224
|
- `get_system_stats` — GPU, VRAM, Python version, OS details
|
|
223
|
-
- `
|
|
225
|
+
- `queue` (action:"list") — see running/pending jobs (also listed above under Queue Management)
|
|
224
226
|
|
|
225
227
|
**When ComfyUI is unresponsive or crashed:**
|
|
226
228
|
1. Try `get_system_stats` — if it fails, ComfyUI is down
|
|
@@ -230,7 +232,7 @@ The script connects to ComfyUI's WebSocket and reports:
|
|
|
230
232
|
|
|
231
233
|
**When a job appears hung (monitor shows `[STALL]`):**
|
|
232
234
|
1. Check `get_system_stats` — look at VRAM usage (OOM causes hangs)
|
|
233
|
-
2. Try `
|
|
235
|
+
2. Try `queue` (action:"cancel") to interrupt the stuck job
|
|
234
236
|
3. If cancel fails, use `restart_comfyui` to force-restart
|
|
235
237
|
4. Use `clear_vram` after restart to free GPU memory before retrying
|
|
236
238
|
|
|
@@ -27,7 +27,7 @@ This pipeline drives the user's live canvas across many stages, so two habits ar
|
|
|
27
27
|
|
|
28
28
|
- **Inspect node modes before each render.** After loading any pack/template/subgraph and before `panel_run`, check each node's `mode` (`panel_graph_outline` marks [bypass]/[mute]; `panel_query_graph` detail rows carry it). A `bypass` node is skipped (passes input through); a `mute` node and everything downstream don't execute. If the path/branch/switch you need is bypassed or muted, enable it with `panel_set_node_mode` (set the wanted node `active`, the unwanted one `bypass`/`mute`). Never assume a switch or route is already active.
|
|
29
29
|
- **Verify the output matches before moving on.** Every Phase-N render is a gate: actually LOOK at the produced frame/clip (view it) and confirm it matches the intent BEFORE advancing or reporting progress. If it's wrong, diagnose (wrong prompt path? a bypassed/muted builder or switch? wrong widget? wrong ref image?), fix, and rerun. Do NOT declare a phase done or report progress you haven't verified.
|
|
30
|
-
- **Confirm VIDEO renders via the filesystem, not /history.** For a `VHS_VideoCombine` / LTX / WAN clip, do NOT rely on `get_history` / `
|
|
30
|
+
- **Confirm VIDEO renders via the filesystem, not /history.** For a `VHS_VideoCombine` / LTX / WAN clip, do NOT rely on `get_history` / `queue` (action:"status") to confirm it exists — VHS-style video nodes write the .mp4 but frequently do NOT register an output in ComfyUI's `/history` (prompt shows done, empty outputs, no error). Confirm the file with `list_output_images` (now lists videos too, tagged `kind: "video"`) by `filename_prefix` + fresh mtime, then chain it forward with `stage_output_as_input`.
|
|
31
31
|
- **Bypass completed stages before queuing the next one.** If you build the multi-stage pipeline on ONE canvas (e.g. Krea2 → LTX → WAN) rather than running each phase in isolation, once a stage has run and its output is captured/staged, `panel_set_node_mode(mode:"bypass")` that stage's nodes BEFORE you `panel_run` the next stage — otherwise `panel_run` re-executes the whole graph and you pay for / wait on already-finished work (a real, costly failure mode). Keep only the active stage live; feed the prior output forward with `stage_output_as_input` (bypass the producer, feed its captured output to the consumer's loader).
|
|
32
32
|
|
|
33
33
|
## CRITICAL: Character Consistency
|
|
@@ -235,7 +235,7 @@ Connect the optional `latent` input for latent-aware shift scaling.
|
|
|
235
235
|
> (and similar video nodes) write the .mp4 but frequently do **NOT** register the
|
|
236
236
|
> output in ComfyUI's `/history` — the prompt shows done with an empty outputs map
|
|
237
237
|
> and no error. Do **NOT** conclude the render "silently dropped" from
|
|
238
|
-
> `get_history` / `
|
|
238
|
+
> `get_history` / `queue` (action:"status") alone. Confirm the file with
|
|
239
239
|
> **`list_output_images`** (it now lists videos too, with `kind: "video"`) — match
|
|
240
240
|
> the `filename_prefix` (e.g. `ltxv2_….mp4`) and check the mtime is fresh — then
|
|
241
241
|
> chain it into the next stage with `stage_output_as_input`.
|
|
@@ -455,7 +455,7 @@ The response includes:
|
|
|
455
455
|
|
|
456
456
|
```
|
|
457
457
|
get_system_stats() # GPU info, VRAM, Python/PyTorch versions
|
|
458
|
-
|
|
458
|
+
queue(action="list") # Running and pending jobs
|
|
459
459
|
get_logs(max_lines=50, keyword="error") # Recent error logs
|
|
460
460
|
```
|
|
461
461
|
|
|
@@ -376,7 +376,7 @@ in**:
|
|
|
376
376
|
/history.** `VHS_VideoCombine` writes the .mp4 but frequently does **NOT**
|
|
377
377
|
register the output in ComfyUI's `/history` (the prompt shows done with no
|
|
378
378
|
output and no error). Do **NOT** decide the render "silently dropped" from
|
|
379
|
-
`get_history` / `
|
|
379
|
+
`get_history` / `queue` (action:"status") alone — confirm the file with
|
|
380
380
|
**`list_output_images`** (it now lists videos, each tagged `kind: "video"`):
|
|
381
381
|
match the `filename_prefix` and check the mtime is fresh, then stage it.
|
|
382
382
|
0. **Stage the output clip as the next run's input** with
|
|
@@ -17,10 +17,9 @@ real node sizes and rail positions first, then compute positions from them.
|
|
|
17
17
|
- all **`groups`** (`id`, `title`, `color`, `bounding [x,y,w,h]`),
|
|
18
18
|
- and — only when inside a subgraph — the **`rails`**: the `input` / `output` boundary
|
|
19
19
|
node positions. Everything below is computed from these numbers.
|
|
20
|
-
- `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
presets: red/brown/green/blue/pale_blue/cyan/purple/yellow/black)
|
|
20
|
+
- `panel_edit_node({node_id, pos?, size?, title?, collapsed?, preset?|color?|bgcolor?})`
|
|
21
|
+
atomically moves, resizes, retitles, collapses, or color-codes a node. Widget
|
|
22
|
+
values remain on their dedicated tool; execution mode is available as `mode` when needed.
|
|
24
23
|
- **Groups** (colored boxes; nodes stay put): `panel_create_group` (pass `node_ids` to
|
|
25
24
|
auto-wrap, or `bounds [x,y,w,h]`; `color` hex), `panel_move_group`, `panel_edit_group`,
|
|
26
25
|
`panel_remove_group`.
|
|
@@ -115,7 +114,7 @@ nodes expanded — and consider `panel_promote_widget` to surface the one key wi
|
|
|
115
114
|
|
|
116
115
|
1. `panel_query_graph {fields:'detail', limit:200, max_chars:60000}` — capture `pos`/`size`/`groups` (and `rails` inside each subgraph).
|
|
117
116
|
2. Compute layers + overlap-free positions from the real sizes.
|
|
118
|
-
3. `
|
|
117
|
+
3. `panel_edit_node` for each node (or bulk only when the same presentation change is intended).
|
|
119
118
|
4. Per subgraph: enter → lay out inner nodes → `panel_move_rail` both rails → exit.
|
|
120
119
|
5. Optional: `panel_create_group` bands around the root columns (and `panel_remove_group`
|
|
121
120
|
any stranded empty groups left behind by earlier edits).
|
|
@@ -41,7 +41,7 @@ export const SCENARIOS = [
|
|
|
41
41
|
id: "queue",
|
|
42
42
|
title: "Queue inspection",
|
|
43
43
|
task: "How many jobs are currently running or pending in the ComfyUI queue? Answer with the numbers.",
|
|
44
|
-
primary: ["
|
|
44
|
+
primary: ["queue", "health_check", "get_system_stats"],
|
|
45
45
|
verify: async (_call, t) => /\d/.test(t.finalAnswer),
|
|
46
46
|
},
|
|
47
47
|
{
|
|
@@ -53,13 +53,13 @@ export const SCENARIOS = [
|
|
|
53
53
|
primary: ["generate_image", "enqueue_workflow"],
|
|
54
54
|
// right family but incomplete execution (built a workflow, never enqueued)
|
|
55
55
|
partial: ["create_workflow", "dsl_to_workflow"],
|
|
56
|
-
followup: ["
|
|
56
|
+
followup: ["queue", "get_history", "list_output_images", "view_image", "list_assets", "generation_stats"],
|
|
57
57
|
verify: async (call, t) => {
|
|
58
58
|
// ground truth: the prompt_id the model started must be done with outputs
|
|
59
59
|
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
60
60
|
if (!ids.length) return false;
|
|
61
61
|
for (let attempt = 0; attempt < 30; attempt++) {
|
|
62
|
-
const status = await call("
|
|
62
|
+
const status = await call("queue", { action: "status", prompt_id: ids[ids.length - 1] });
|
|
63
63
|
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) return true;
|
|
64
64
|
if (/"error":/.test(status)) return false;
|
|
65
65
|
await new Promise((r) => setTimeout(r, 2000));
|
|
@@ -114,7 +114,7 @@ export const SCENARIOS = [
|
|
|
114
114
|
if (!sawFailure) return false;
|
|
115
115
|
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
116
116
|
for (const id of ids.reverse()) {
|
|
117
|
-
const status = await call("
|
|
117
|
+
const status = await call("queue", { action: "status", prompt_id: id });
|
|
118
118
|
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) return true;
|
|
119
119
|
}
|
|
120
120
|
return false;
|
|
@@ -137,7 +137,7 @@ export const SCENARIOS = [
|
|
|
137
137
|
if (ids.length < 2) return false;
|
|
138
138
|
let done = 0;
|
|
139
139
|
for (const id of ids) {
|
|
140
|
-
const status = await call("
|
|
140
|
+
const status = await call("queue", { action: "status", prompt_id: id });
|
|
141
141
|
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) done++;
|
|
142
142
|
}
|
|
143
143
|
return done >= 2;
|
|
@@ -107,6 +107,15 @@ const SELF = new Set([
|
|
|
107
107
|
// Same, for 0.49.0 slice 3: asserts as FIXTURES that the eight retired
|
|
108
108
|
// comfy_cli_* names are in DEAD_NAMES with `comfy_cli` replacements.
|
|
109
109
|
"src/__tests__/tools/comfy-cli.test.ts",
|
|
110
|
+
// Same, for 0.49.0 slice 4: asserts as FIXTURES that the eight retired
|
|
111
|
+
// queue/jobs names are in DEAD_NAMES with `queue` replacements.
|
|
112
|
+
"src/__tests__/tools/queue-management.test.ts",
|
|
113
|
+
// Same, for 0.49.0 slice 5: asserts as FIXTURES that the three retired
|
|
114
|
+
// model_metadata_* names are in DEAD_NAMES with `model_metadata` replacements.
|
|
115
|
+
"src/__tests__/tools/model-explorer.test.ts",
|
|
116
|
+
// Same, for 0.49.0 slice 6: asserts as FIXTURES that the three retired
|
|
117
|
+
// workspace names are in DEAD_NAMES with `workspace` replacements.
|
|
118
|
+
"src/__tests__/tools/workspace-env.test.ts",
|
|
110
119
|
// Same, for the #659 retired-name error: these pass dead names to call_tool /
|
|
111
120
|
// the ollama dispatch as FIXTURES and assert the error quotes the ledger's
|
|
112
121
|
// replacement — the names are call arguments under test, not live guidance.
|
package/scripts/gen-tool-docs.ts
CHANGED
|
@@ -93,9 +93,7 @@ const CATEGORIES: Array<{
|
|
|
93
93
|
icon: "play",
|
|
94
94
|
description: "Enqueue workflows — one at a time, from a named template, or as a batch — and inspect the queue, jobs, history, and system stats.",
|
|
95
95
|
tools: [
|
|
96
|
-
"enqueue_workflow", "rerun_generation", "get_system_stats", "
|
|
97
|
-
"get_queued_workflow", "move_queued_job", "edit_queued_job",
|
|
98
|
-
"cancel_job", "cancel_queued_job", "clear_queue", "get_history", "get_logs",
|
|
96
|
+
"enqueue_workflow", "rerun_generation", "get_system_stats", "queue", "get_history", "get_logs",
|
|
99
97
|
"health_check", "calculate", "diagnose_run",
|
|
100
98
|
// Template execution: run_template is an enqueue entrypoint, and
|
|
101
99
|
// get_template_schema is the lookup you make first to fill its overrides.
|
|
@@ -147,7 +145,7 @@ const CATEGORIES: Array<{
|
|
|
147
145
|
"download_status", "cancel_download",
|
|
148
146
|
"remove_model", "list_extra_paths", "add_extra_path", "remove_extra_path",
|
|
149
147
|
"get_embeddings", "clear_vram",
|
|
150
|
-
"
|
|
148
|
+
"model_metadata",
|
|
151
149
|
],
|
|
152
150
|
},
|
|
153
151
|
{
|
|
@@ -179,7 +177,7 @@ const CATEGORIES: Array<{
|
|
|
179
177
|
description: "Install/update ComfyUI and the sidebar panel, self-update the MCP server, apply a setup manifest, manage workspaces, inspect the environment, configure ComfyUI-Manager, report issues.",
|
|
180
178
|
tools: [
|
|
181
179
|
"install_comfyui", "update_comfyui", "update_all", "install_panel", "self_update",
|
|
182
|
-
"apply_manifest", "
|
|
180
|
+
"apply_manifest", "workspace",
|
|
183
181
|
"get_environment", "configure_manager", "report_issue",
|
|
184
182
|
],
|
|
185
183
|
},
|
|
@@ -291,10 +289,16 @@ function typeLabel(s: JsonSchema): string {
|
|
|
291
289
|
}
|
|
292
290
|
|
|
293
291
|
function esc(text: string): string {
|
|
294
|
-
// Keep MDX happy: collapse whitespace
|
|
292
|
+
// Keep MDX happy: collapse INLINE whitespace per line but preserve line breaks —
|
|
293
|
+
// a newline-separated list in a tool description must stay a list in the docs,
|
|
294
|
+
// not render as one long paragraph — and escape characters MDX would parse as
|
|
295
295
|
// JSX — angle brackets (e.g. "<COMFYUI_PATH>") and curly braces (expressions).
|
|
296
296
|
const map: Record<string, string> = { "<": "<", ">": ">", "{": "{", "}": "}" };
|
|
297
|
-
return text
|
|
297
|
+
return text
|
|
298
|
+
.split("\n")
|
|
299
|
+
.map((line) => line.replace(/\s+/g, " ").trim())
|
|
300
|
+
.join("\n")
|
|
301
|
+
.replace(/[<>{}]/g, (m) => map[m]);
|
|
298
302
|
}
|
|
299
303
|
|
|
300
304
|
function renderParam(name: string, schema: JsonSchema, required: boolean): string {
|
|
@@ -309,7 +313,24 @@ function renderParam(name: string, schema: JsonSchema, required: boolean): strin
|
|
|
309
313
|
return `<ParamField ${attrs.join(" ")}>\n ${body.join(" ") || "—"}\n</ParamField>`;
|
|
310
314
|
}
|
|
311
315
|
|
|
312
|
-
|
|
316
|
+
// Most examples can be derived from JSON Schema required fields. Flat action
|
|
317
|
+
// schemas deliberately keep action-specific required fields optional in that
|
|
318
|
+
// schema (the MCP SDK does not render discriminated unions correctly), so they
|
|
319
|
+
// need a complete, valid representative call here instead of an unusable
|
|
320
|
+
// action-only skeleton.
|
|
321
|
+
const EXAMPLE_ARG_OVERRIDES: Readonly<Record<string, Readonly<Record<string, unknown>>>> = {
|
|
322
|
+
model_metadata: {
|
|
323
|
+
action: "read",
|
|
324
|
+
category: "loras",
|
|
325
|
+
name: "my_model.safetensors",
|
|
326
|
+
},
|
|
327
|
+
workspace: {
|
|
328
|
+
action: "set_default",
|
|
329
|
+
path: "/opt/ComfyUI",
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
function exampleArgs(toolName: string, jsonSchema: JsonSchema): Record<string, unknown> {
|
|
313
334
|
const out: Record<string, unknown> = {};
|
|
314
335
|
const props = jsonSchema.properties ?? {};
|
|
315
336
|
const required = new Set(jsonSchema.required ?? []);
|
|
@@ -322,7 +343,7 @@ function exampleArgs(jsonSchema: JsonSchema): Record<string, unknown> {
|
|
|
322
343
|
else if (s.type === "array") out[name] = [];
|
|
323
344
|
else out[name] = `<${name}>`;
|
|
324
345
|
}
|
|
325
|
-
return out;
|
|
346
|
+
return { ...out, ...EXAMPLE_ARG_OVERRIDES[toolName] };
|
|
326
347
|
}
|
|
327
348
|
|
|
328
349
|
function firstSentence(desc: string): string {
|
|
@@ -366,7 +387,7 @@ function renderTool(t: CapturedTool): string {
|
|
|
366
387
|
|
|
367
388
|
lines.push("### Example", "");
|
|
368
389
|
lines.push("<Note>Example coming soon — the call below is a generated skeleton.</Note>", "");
|
|
369
|
-
const args = exampleArgs(json);
|
|
390
|
+
const args = exampleArgs(t.name, json);
|
|
370
391
|
lines.push("```json", JSON.stringify({ tool: t.name, arguments: args }, null, 2), "```", "");
|
|
371
392
|
lines.push("---", "");
|
|
372
393
|
return lines.join("\n");
|