comfyui-mcp 0.25.1 → 0.26.0
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 +33 -0
- package/dist/config.js +74 -3
- package/dist/config.js.map +1 -1
- package/dist/orchestrator/gemini-backend.js +6 -6
- package/dist/orchestrator/gemini-backend.js.map +1 -1
- package/dist/orchestrator/index.js +16 -3
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/services/process-control.js +38 -17
- package/dist/services/process-control.js.map +1 -1
- package/dist/services/workflow-converter.js +345 -0
- package/dist/services/workflow-converter.js.map +1 -1
- package/dist/tools/workflow-library.js +42 -6
- package/dist/tools/workflow-library.js.map +1 -1
- package/package.json +3 -2
- package/plugin/skills/comfyui-core/SKILL.md +7 -6
- package/scripts/arena-scenarios.mjs +226 -0
- package/scripts/llm-arena.mjs +1 -222
- package/scripts/runpod-release.mjs +119 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-library.js","sourceRoot":"","sources":["../../src/tools/workflow-library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EACZ,eAAe,GAChB,MAAM,qCAAqC,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EAAE,CAAC;gBACtB,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,MAAM,SAAS,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAClD,MAAM,IAAI,eAAe,CACvB,sEAAsE,SAAS,EAAE,CAClF,CAAC;gBACJ,CAAC;gBACD,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;oBACjE,UAAU,EAAE,IAAI;oBAChB,SAAS,EAAE,IAAI;iBAChB,CAAC,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,OAAO,UAAU,EAAE,CAAC,CAAC;gBAC1E,OAAO,EAAE,OAAO,EAAE,CAAC;YACrB,CAAC;YAED,WAAW;YACX,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,OAAO,UAAU,EAAE,CAAC,CAAC;YAC1E,OAAO,EAAE,OAAO,EAAE,CAAC;QACrB,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,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comfyui-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"mcpName": "io.github.artokun/comfyui-mcp",
|
|
5
|
-
"description": "Local-first, agent-native control plane for ComfyUI
|
|
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",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"lint": "tsc --noEmit",
|
|
35
35
|
"docs:gen": "cross-env COMFYUI_URL=http://127.0.0.1:8188 tsx scripts/gen-tool-docs.ts",
|
|
36
36
|
"runpod:release": "node scripts/runpod-release.mjs",
|
|
37
|
+
"runpod:release:major": "node scripts/runpod-release.mjs major",
|
|
37
38
|
"packs:gen": "node scripts/gen-pack-installers.mjs",
|
|
38
39
|
"packs:validate": "node scripts/validate-manifests.mjs",
|
|
39
40
|
"packs:test": "bash scripts/test-packs.sh",
|
|
@@ -49,10 +49,11 @@ ComfyUI workflows are JSON objects mapping **string node IDs** to node definitio
|
|
|
49
49
|
|
|
50
50
|
### Important: API Format vs Web UI Format
|
|
51
51
|
|
|
52
|
-
- **API format** (
|
|
53
|
-
- **Web UI format** (
|
|
54
|
-
-
|
|
55
|
-
-
|
|
52
|
+
- **API format** (for execution/analysis): `{ "1": { class_type, inputs }, "2": { ... } }` — compact, used by `enqueue_workflow`, `validate_workflow`, `modify_workflow`, etc.
|
|
53
|
+
- **Web UI format** (for saving and frontend editing): `{ "nodes": [...], "links": [...] }` — includes layout positions, sizes, groups, and visual metadata so ComfyUI's canvas can open and edit it
|
|
54
|
+
- Execution tools expect and return **API format**
|
|
55
|
+
- **Saving tools must use Web UI format** so saved workflows stay readable and editable in the ComfyUI frontend — an API-format save "exists" in the library but loads blank in the canvas, which strands users (and tempts agents into creating yet another new workflow instead of reopening the old one)
|
|
56
|
+
- `get_workflow` defaults to `format="api"` for analysis/execution; use `format="ui"` when loading a workflow to re-save or edit in the canvas
|
|
56
57
|
- Muted/bypassed nodes are preserved with `_meta.mode: "muted"` — these are inactive but visible for understanding the workflow
|
|
57
58
|
- Get/Set virtual wire nodes are preserved with `_meta.title` and `Constant` key for tracing data flow
|
|
58
59
|
|
|
@@ -60,8 +61,8 @@ ComfyUI workflows are JSON objects mapping **string node IDs** to node definitio
|
|
|
60
61
|
|
|
61
62
|
- **`analyze_workflow(filename)`** — **use this first** to understand any saved workflow. Returns a structured text summary with sections, node IDs, key settings, virtual wires, and connection graph. No raw JSON — just what you need to reason about the workflow. Supports views: summary (default), overview (mermaid), detail (section mermaid), list, flat.
|
|
62
63
|
- **`list_workflows`** — list all saved workflows in ComfyUI's user library
|
|
63
|
-
- **`get_workflow(filename)`** — load raw workflow JSON. Only use when you need the actual JSON for `enqueue_workflow`, `modify_workflow`, or `save_workflow`. Use `analyze_workflow` instead for understanding.
|
|
64
|
-
- **`save_workflow(filename, workflow)`** — save a workflow to the user library
|
|
64
|
+
- **`get_workflow(filename)`** — load raw workflow JSON. Only use when you need the actual JSON for `enqueue_workflow`, `modify_workflow`, or `save_workflow`. Use `analyze_workflow` instead for understanding. **For `save_workflow`, request `format="ui"`** so the workflow stays editable in the frontend.
|
|
65
|
+
- **`save_workflow(filename, workflow)`** — save a workflow to the user library. **Pass Web UI format (`{ nodes, links }`)** so it can be opened and edited in ComfyUI's canvas; API-format graphs are accepted but the frontend cannot open them.
|
|
65
66
|
|
|
66
67
|
## Data Types
|
|
67
68
|
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// Shared arena scenario set — task prompts + harness-side ground-truth
|
|
2
|
+
// verification, used by BOTH scripts/llm-arena.mjs (compact 3-tool mode) and
|
|
3
|
+
// scripts/llm-arena-full.mjs (full 113-tool surface for the fine-tune
|
|
4
|
+
// pipeline). verify(harnessCall, t) receives a direct (toolName, args) → text
|
|
5
|
+
// callback in either mode and NEVER trusts the model's claims.
|
|
6
|
+
/**
|
|
7
|
+
* Each scenario: task prompt, the underlying tools that count as the "right"
|
|
8
|
+
* primary move, and an optional verify(harnessCall, transcript) ground-truth
|
|
9
|
+
* check the HARNESS runs against ComfyUI itself (never trusts the model).
|
|
10
|
+
*/
|
|
11
|
+
export const SCENARIOS = [
|
|
12
|
+
{
|
|
13
|
+
id: "health",
|
|
14
|
+
title: "Server health & GPU report",
|
|
15
|
+
task: "Check whether the ComfyUI server is healthy and tell me the GPU name and how much free VRAM it has.",
|
|
16
|
+
primary: ["health_check", "get_system_stats"],
|
|
17
|
+
verify: async (_call, t) => /(cuda|nvidia|rtx|gtx|radeon|vram)/i.test(t.finalAnswer),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "models",
|
|
21
|
+
title: "Installed checkpoint discovery",
|
|
22
|
+
task: "Find out which checkpoint models are installed on the ComfyUI server and tell me the name of one of them.",
|
|
23
|
+
primary: ["list_local_models"],
|
|
24
|
+
verify: async (call, t) => {
|
|
25
|
+
const res = await call("list_local_models", { model_type: "checkpoints" });
|
|
26
|
+
const names = [...res.matchAll(/([\w.-]+)\.(safetensors|ckpt|sft|gguf)/gi)].map((m) =>
|
|
27
|
+
m[1].toLowerCase(),
|
|
28
|
+
);
|
|
29
|
+
const answer = t.finalAnswer.toLowerCase();
|
|
30
|
+
return names.some((n) => answer.includes(n) || answer.includes(n.slice(0, 12)));
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "registry",
|
|
35
|
+
title: "Custom-node registry search",
|
|
36
|
+
task: "Find a tool that can search for ComfyUI custom node packs, then use it to search for 'controlnet' and tell me the name of one node pack from its results.",
|
|
37
|
+
primary: ["search_custom_nodes", "search_models"],
|
|
38
|
+
verify: async (_call, t) => t.finalAnswer.trim().length > 0,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "queue",
|
|
42
|
+
title: "Queue inspection",
|
|
43
|
+
task: "How many jobs are currently running or pending in the ComfyUI queue? Answer with the numbers.",
|
|
44
|
+
primary: ["get_queue", "health_check", "get_system_stats"],
|
|
45
|
+
verify: async (_call, t) => /\d/.test(t.finalAnswer),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "generate",
|
|
49
|
+
title: "Text-to-image generation + async polling",
|
|
50
|
+
task:
|
|
51
|
+
"Generate a 512x512 image of a red apple on a wooden table. The generation runs asynchronously — " +
|
|
52
|
+
"after starting it, check its job status until it has finished, then tell me the output filename or asset id.",
|
|
53
|
+
primary: ["generate_image", "enqueue_workflow"],
|
|
54
|
+
// right family but incomplete execution (built a workflow, never enqueued)
|
|
55
|
+
partial: ["create_workflow", "dsl_to_workflow"],
|
|
56
|
+
followup: ["get_job_status", "get_history", "list_output_images", "view_image", "list_assets", "get_queue", "generation_stats"],
|
|
57
|
+
verify: async (call, t) => {
|
|
58
|
+
// ground truth: the prompt_id the model started must be done with outputs
|
|
59
|
+
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
60
|
+
if (!ids.length) return false;
|
|
61
|
+
for (let attempt = 0; attempt < 30; attempt++) {
|
|
62
|
+
const status = await call("get_job_status", { prompt_id: ids[ids.length - 1] });
|
|
63
|
+
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) return true;
|
|
64
|
+
if (/"error":/.test(status)) return false;
|
|
65
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
// ── The GAUNTLET — added when the whole SoTA tier tied 10/10 on the base
|
|
71
|
+
// set. Same server-side verification discipline, but these stress parameter
|
|
72
|
+
// fidelity, error recovery, and multi-render state tracking.
|
|
73
|
+
{
|
|
74
|
+
id: "precision",
|
|
75
|
+
title: "Parameter-exact build + render",
|
|
76
|
+
task:
|
|
77
|
+
"Render a txt2img image with the checkpoint v1-5-pruned-emaonly-fp16.safetensors, EXACTLY 12 sampling steps, " +
|
|
78
|
+
"EXACTLY 384x384 pixels, positive prompt 'a green pear on a table'. Wait until it finishes, then report the prompt_id.",
|
|
79
|
+
primary: ["generate_image", "enqueue_workflow"],
|
|
80
|
+
partial: ["create_workflow", "dsl_to_workflow"],
|
|
81
|
+
verify: async (_call, t) => {
|
|
82
|
+
// ground truth from ComfyUI itself: the EXECUTED graph must carry the
|
|
83
|
+
// exact parameters, and the job must have completed with outputs.
|
|
84
|
+
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
85
|
+
for (const id of ids.reverse()) {
|
|
86
|
+
try {
|
|
87
|
+
const res = await fetch(`${process.env.COMFYUI_URL ?? "http://127.0.0.1:8188"}/history/${id}`);
|
|
88
|
+
const hist = (await res.json())[id];
|
|
89
|
+
if (!hist?.status?.completed) continue;
|
|
90
|
+
const nodes = Object.values(hist.prompt?.[2] ?? {});
|
|
91
|
+
const steps = nodes.some((n) => n.inputs?.steps === 12);
|
|
92
|
+
const size = nodes.some((n) => n.inputs?.width === 384 && n.inputs?.height === 384);
|
|
93
|
+
if (steps && size) return true;
|
|
94
|
+
} catch {
|
|
95
|
+
/* try the next id */
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "breakfix",
|
|
103
|
+
title: "Deliberate failure → diagnose → recover",
|
|
104
|
+
task:
|
|
105
|
+
"First, try to render an image using a checkpoint named exactly 'nonexistent-model.safetensors'. That will fail — " +
|
|
106
|
+
"read the error and explain in ONE sentence why. Then recover: render 'a blue cube' at 512x512 with a checkpoint " +
|
|
107
|
+
"that IS installed, wait for it to complete, and report its prompt_id.",
|
|
108
|
+
primary: ["generate_image", "enqueue_workflow"],
|
|
109
|
+
partial: ["create_workflow"],
|
|
110
|
+
verify: async (call, t) => {
|
|
111
|
+
// (a) the failure actually happened (the bogus name shows up in an error),
|
|
112
|
+
// (b) a real render then completed.
|
|
113
|
+
const sawFailure = /nonexistent-model\.safetensors/.test(t.toolText) && /error|invalid|not (?:found|in)/i.test(t.toolText);
|
|
114
|
+
if (!sawFailure) return false;
|
|
115
|
+
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
116
|
+
for (const id of ids.reverse()) {
|
|
117
|
+
const status = await call("get_job_status", { prompt_id: id });
|
|
118
|
+
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) return true;
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "provenance",
|
|
125
|
+
title: "Generate → find asset → regenerate with override",
|
|
126
|
+
task:
|
|
127
|
+
"Render a 512x512 image of 'a red bicycle' and wait for it to complete. Then find the ASSET it produced " +
|
|
128
|
+
"(the asset registry lists recent assets), and regenerate that asset with a steps=8 override, waiting for the " +
|
|
129
|
+
"second render to complete too. Report both prompt_ids.",
|
|
130
|
+
primary: ["generate_image", "enqueue_workflow"],
|
|
131
|
+
partial: ["create_workflow", "list_assets", "get_asset_metadata"],
|
|
132
|
+
verify: async (call, t) => {
|
|
133
|
+
// regenerate must have actually run, and there must be two DISTINCT
|
|
134
|
+
// completed prompts.
|
|
135
|
+
if (!t.calls.some((c) => c.tool === "regenerate" && c.ok)) return false;
|
|
136
|
+
const ids = [...new Set([...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]))];
|
|
137
|
+
if (ids.length < 2) return false;
|
|
138
|
+
let done = 0;
|
|
139
|
+
for (const id of ids) {
|
|
140
|
+
const status = await call("get_job_status", { prompt_id: id });
|
|
141
|
+
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) done++;
|
|
142
|
+
}
|
|
143
|
+
return done >= 2;
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
// ── The CRUCIBLE — round 3, added when four models tied the gauntlet at
|
|
147
|
+
// 16/16. Custom graph COMPOSITION (no template covers these): one graph
|
|
148
|
+
// with two piped outputs, and a two-stage pipeline chained through the
|
|
149
|
+
// staging tool. All still SD1.5-only and server-verified.
|
|
150
|
+
{
|
|
151
|
+
id: "multiout",
|
|
152
|
+
title: "One graph, two piped outputs",
|
|
153
|
+
task:
|
|
154
|
+
"Build and enqueue ONE single workflow that renders 'a lighthouse at dusk' at 512x512 AND, in the same graph, " +
|
|
155
|
+
"pipes that image through a 2x upscale so the SAME run saves TWO outputs: the 512x512 original and a 1024x1024 " +
|
|
156
|
+
"version. No template does this — compose the graph yourself. Wait for completion and report the prompt_id.",
|
|
157
|
+
primary: ["enqueue_workflow"],
|
|
158
|
+
partial: ["create_workflow", "dsl_to_workflow", "generate_image", "modify_workflow"],
|
|
159
|
+
verify: async (_call, t) => {
|
|
160
|
+
const base = process.env.COMFYUI_URL ?? "http://127.0.0.1:8188";
|
|
161
|
+
const ids = [...new Set([...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]))];
|
|
162
|
+
for (const id of ids.reverse()) {
|
|
163
|
+
try {
|
|
164
|
+
const hist = (await (await fetch(`${base}/history/${id}`)).json())[id];
|
|
165
|
+
if (!hist?.status?.completed) continue;
|
|
166
|
+
// gather every output image of THIS single prompt and read its real
|
|
167
|
+
// pixel size from the PNG header — need two distinct sizes, 2x apart.
|
|
168
|
+
const dims = new Set();
|
|
169
|
+
for (const out of Object.values(hist.outputs ?? {})) {
|
|
170
|
+
for (const img of out.images ?? []) {
|
|
171
|
+
if (img.type !== "output") continue;
|
|
172
|
+
const u = new URL("/view", base);
|
|
173
|
+
u.searchParams.set("filename", img.filename);
|
|
174
|
+
u.searchParams.set("type", "output");
|
|
175
|
+
if (img.subfolder) u.searchParams.set("subfolder", img.subfolder);
|
|
176
|
+
const buf = Buffer.from(await (await fetch(u)).arrayBuffer());
|
|
177
|
+
if (buf.length > 24 && buf.toString("ascii", 1, 4) === "PNG") {
|
|
178
|
+
dims.add(`${buf.readUInt32BE(16)}x${buf.readUInt32BE(20)}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (dims.has("512x512") && dims.has("1024x1024")) return true;
|
|
183
|
+
} catch {
|
|
184
|
+
/* try next id */
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: "pipeline",
|
|
192
|
+
title: "Two-stage pipe via output staging",
|
|
193
|
+
task:
|
|
194
|
+
"Two-stage pipeline. Stage 1: render 'a plain wooden mask' at 512x512 and wait for it to finish. Stage 2: run an " +
|
|
195
|
+
"img2img pass over stage 1's ACTUAL output image with the prompt 'an ornate golden mask' and denoise about 0.55, " +
|
|
196
|
+
"and wait for it too. Do NOT guess file paths — use the staging tool that feeds a previous output into the next " +
|
|
197
|
+
"stage's loader. Report both prompt_ids.",
|
|
198
|
+
primary: ["enqueue_workflow", "generate_image"],
|
|
199
|
+
partial: ["create_workflow", "stage_output_as_input"],
|
|
200
|
+
verify: async (call, t) => {
|
|
201
|
+
// the staging tool must have actually run…
|
|
202
|
+
if (!t.calls.some((c) => c.tool === "stage_output_as_input" && c.ok)) return false;
|
|
203
|
+
const base = process.env.COMFYUI_URL ?? "http://127.0.0.1:8188";
|
|
204
|
+
const ids = [...new Set([...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]))];
|
|
205
|
+
if (ids.length < 2) return false;
|
|
206
|
+
// …and the LAST completed prompt must be a real img2img graph: a
|
|
207
|
+
// LoadImage feeding it and a KSampler with partial denoise.
|
|
208
|
+
for (const id of ids.reverse()) {
|
|
209
|
+
try {
|
|
210
|
+
const hist = (await (await fetch(`${base}/history/${id}`)).json())[id];
|
|
211
|
+
if (!hist?.status?.completed) continue;
|
|
212
|
+
const nodes = Object.values(hist.prompt?.[2] ?? {});
|
|
213
|
+
const hasLoad = nodes.some((n) => n.class_type === "LoadImage");
|
|
214
|
+
const partialDenoise = nodes.some(
|
|
215
|
+
(n) => typeof n.inputs?.denoise === "number" && n.inputs.denoise > 0.2 && n.inputs.denoise < 0.9,
|
|
216
|
+
);
|
|
217
|
+
if (hasLoad && partialDenoise) return true;
|
|
218
|
+
break; // only judge the newest completed prompt as stage 2
|
|
219
|
+
} catch {
|
|
220
|
+
/* try next id */
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return false;
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
];
|
package/scripts/llm-arena.mjs
CHANGED
|
@@ -28,6 +28,7 @@ import { fileURLToPath } from "node:url";
|
|
|
28
28
|
import { dirname, join } from "node:path";
|
|
29
29
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
30
30
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
31
|
+
import { SCENARIOS } from "./arena-scenarios.mjs";
|
|
31
32
|
|
|
32
33
|
const OLLAMA = process.env.OLLAMA_HOST ?? "http://127.0.0.1:11434";
|
|
33
34
|
const MODELS = (process.env.ARENA_MODELS ?? "gemma4:e4b,gemma4:e2b,qwen3:8b,qwen3:4b,llama3.1:8b")
|
|
@@ -48,228 +49,6 @@ const SYSTEM =
|
|
|
48
49
|
"Always look up a tool with describe_tool before running it with call_tool. " +
|
|
49
50
|
"Catalog entries are tool NAMES, not data — complete every task by actually running tools with call_tool.";
|
|
50
51
|
|
|
51
|
-
/**
|
|
52
|
-
* Each scenario: task prompt, the underlying tools that count as the "right"
|
|
53
|
-
* primary move, and an optional verify(harnessCall, transcript) ground-truth
|
|
54
|
-
* check the HARNESS runs against ComfyUI itself (never trusts the model).
|
|
55
|
-
*/
|
|
56
|
-
const SCENARIOS = [
|
|
57
|
-
{
|
|
58
|
-
id: "health",
|
|
59
|
-
title: "Server health & GPU report",
|
|
60
|
-
task: "Check whether the ComfyUI server is healthy and tell me the GPU name and how much free VRAM it has.",
|
|
61
|
-
primary: ["health_check", "get_system_stats"],
|
|
62
|
-
verify: async (_call, t) => /(cuda|nvidia|rtx|gtx|radeon|vram)/i.test(t.finalAnswer),
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: "models",
|
|
66
|
-
title: "Installed checkpoint discovery",
|
|
67
|
-
task: "Find out which checkpoint models are installed on the ComfyUI server and tell me the name of one of them.",
|
|
68
|
-
primary: ["list_local_models"],
|
|
69
|
-
verify: async (call, t) => {
|
|
70
|
-
const res = await call("list_local_models", { model_type: "checkpoints" });
|
|
71
|
-
const names = [...res.matchAll(/([\w.-]+)\.(safetensors|ckpt|sft|gguf)/gi)].map((m) =>
|
|
72
|
-
m[1].toLowerCase(),
|
|
73
|
-
);
|
|
74
|
-
const answer = t.finalAnswer.toLowerCase();
|
|
75
|
-
return names.some((n) => answer.includes(n) || answer.includes(n.slice(0, 12)));
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: "registry",
|
|
80
|
-
title: "Custom-node registry search",
|
|
81
|
-
task: "Find a tool that can search for ComfyUI custom node packs, then use it to search for 'controlnet' and tell me the name of one node pack from its results.",
|
|
82
|
-
primary: ["search_custom_nodes", "search_models"],
|
|
83
|
-
verify: async (_call, t) => t.finalAnswer.trim().length > 0,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: "queue",
|
|
87
|
-
title: "Queue inspection",
|
|
88
|
-
task: "How many jobs are currently running or pending in the ComfyUI queue? Answer with the numbers.",
|
|
89
|
-
primary: ["get_queue", "health_check", "get_system_stats"],
|
|
90
|
-
verify: async (_call, t) => /\d/.test(t.finalAnswer),
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: "generate",
|
|
94
|
-
title: "Text-to-image generation + async polling",
|
|
95
|
-
task:
|
|
96
|
-
"Generate a 512x512 image of a red apple on a wooden table. The generation runs asynchronously — " +
|
|
97
|
-
"after starting it, check its job status until it has finished, then tell me the output filename or asset id.",
|
|
98
|
-
primary: ["generate_image", "enqueue_workflow"],
|
|
99
|
-
// right family but incomplete execution (built a workflow, never enqueued)
|
|
100
|
-
partial: ["create_workflow", "dsl_to_workflow"],
|
|
101
|
-
followup: ["get_job_status", "get_history", "list_output_images", "view_image", "list_assets", "get_queue", "generation_stats"],
|
|
102
|
-
verify: async (call, t) => {
|
|
103
|
-
// ground truth: the prompt_id the model started must be done with outputs
|
|
104
|
-
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
105
|
-
if (!ids.length) return false;
|
|
106
|
-
for (let attempt = 0; attempt < 30; attempt++) {
|
|
107
|
-
const status = await call("get_job_status", { prompt_id: ids[ids.length - 1] });
|
|
108
|
-
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) return true;
|
|
109
|
-
if (/"error":/.test(status)) return false;
|
|
110
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
111
|
-
}
|
|
112
|
-
return false;
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
// ── The GAUNTLET — added when the whole SoTA tier tied 10/10 on the base
|
|
116
|
-
// set. Same server-side verification discipline, but these stress parameter
|
|
117
|
-
// fidelity, error recovery, and multi-render state tracking.
|
|
118
|
-
{
|
|
119
|
-
id: "precision",
|
|
120
|
-
title: "Parameter-exact build + render",
|
|
121
|
-
task:
|
|
122
|
-
"Render a txt2img image with the checkpoint v1-5-pruned-emaonly-fp16.safetensors, EXACTLY 12 sampling steps, " +
|
|
123
|
-
"EXACTLY 384x384 pixels, positive prompt 'a green pear on a table'. Wait until it finishes, then report the prompt_id.",
|
|
124
|
-
primary: ["generate_image", "enqueue_workflow"],
|
|
125
|
-
partial: ["create_workflow", "dsl_to_workflow"],
|
|
126
|
-
verify: async (_call, t) => {
|
|
127
|
-
// ground truth from ComfyUI itself: the EXECUTED graph must carry the
|
|
128
|
-
// exact parameters, and the job must have completed with outputs.
|
|
129
|
-
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
130
|
-
for (const id of ids.reverse()) {
|
|
131
|
-
try {
|
|
132
|
-
const res = await fetch(`${process.env.COMFYUI_URL ?? "http://127.0.0.1:8188"}/history/${id}`);
|
|
133
|
-
const hist = (await res.json())[id];
|
|
134
|
-
if (!hist?.status?.completed) continue;
|
|
135
|
-
const nodes = Object.values(hist.prompt?.[2] ?? {});
|
|
136
|
-
const steps = nodes.some((n) => n.inputs?.steps === 12);
|
|
137
|
-
const size = nodes.some((n) => n.inputs?.width === 384 && n.inputs?.height === 384);
|
|
138
|
-
if (steps && size) return true;
|
|
139
|
-
} catch {
|
|
140
|
-
/* try the next id */
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return false;
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
id: "breakfix",
|
|
148
|
-
title: "Deliberate failure → diagnose → recover",
|
|
149
|
-
task:
|
|
150
|
-
"First, try to render an image using a checkpoint named exactly 'nonexistent-model.safetensors'. That will fail — " +
|
|
151
|
-
"read the error and explain in ONE sentence why. Then recover: render 'a blue cube' at 512x512 with a checkpoint " +
|
|
152
|
-
"that IS installed, wait for it to complete, and report its prompt_id.",
|
|
153
|
-
primary: ["generate_image", "enqueue_workflow"],
|
|
154
|
-
partial: ["create_workflow"],
|
|
155
|
-
verify: async (call, t) => {
|
|
156
|
-
// (a) the failure actually happened (the bogus name shows up in an error),
|
|
157
|
-
// (b) a real render then completed.
|
|
158
|
-
const sawFailure = /nonexistent-model\.safetensors/.test(t.toolText) && /error|invalid|not (?:found|in)/i.test(t.toolText);
|
|
159
|
-
if (!sawFailure) return false;
|
|
160
|
-
const ids = [...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]);
|
|
161
|
-
for (const id of ids.reverse()) {
|
|
162
|
-
const status = await call("get_job_status", { prompt_id: id });
|
|
163
|
-
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) return true;
|
|
164
|
-
}
|
|
165
|
-
return false;
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
id: "provenance",
|
|
170
|
-
title: "Generate → find asset → regenerate with override",
|
|
171
|
-
task:
|
|
172
|
-
"Render a 512x512 image of 'a red bicycle' and wait for it to complete. Then find the ASSET it produced " +
|
|
173
|
-
"(the asset registry lists recent assets), and regenerate that asset with a steps=8 override, waiting for the " +
|
|
174
|
-
"second render to complete too. Report both prompt_ids.",
|
|
175
|
-
primary: ["generate_image", "enqueue_workflow"],
|
|
176
|
-
partial: ["create_workflow", "list_assets", "get_asset_metadata"],
|
|
177
|
-
verify: async (call, t) => {
|
|
178
|
-
// regenerate must have actually run, and there must be two DISTINCT
|
|
179
|
-
// completed prompts.
|
|
180
|
-
if (!t.calls.some((c) => c.tool === "regenerate" && c.ok)) return false;
|
|
181
|
-
const ids = [...new Set([...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]))];
|
|
182
|
-
if (ids.length < 2) return false;
|
|
183
|
-
let done = 0;
|
|
184
|
-
for (const id of ids) {
|
|
185
|
-
const status = await call("get_job_status", { prompt_id: id });
|
|
186
|
-
if (/"done":\s*true/.test(status) && !/"error"/.test(status)) done++;
|
|
187
|
-
}
|
|
188
|
-
return done >= 2;
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
// ── The CRUCIBLE — round 3, added when four models tied the gauntlet at
|
|
192
|
-
// 16/16. Custom graph COMPOSITION (no template covers these): one graph
|
|
193
|
-
// with two piped outputs, and a two-stage pipeline chained through the
|
|
194
|
-
// staging tool. All still SD1.5-only and server-verified.
|
|
195
|
-
{
|
|
196
|
-
id: "multiout",
|
|
197
|
-
title: "One graph, two piped outputs",
|
|
198
|
-
task:
|
|
199
|
-
"Build and enqueue ONE single workflow that renders 'a lighthouse at dusk' at 512x512 AND, in the same graph, " +
|
|
200
|
-
"pipes that image through a 2x upscale so the SAME run saves TWO outputs: the 512x512 original and a 1024x1024 " +
|
|
201
|
-
"version. No template does this — compose the graph yourself. Wait for completion and report the prompt_id.",
|
|
202
|
-
primary: ["enqueue_workflow"],
|
|
203
|
-
partial: ["create_workflow", "dsl_to_workflow", "generate_image", "modify_workflow"],
|
|
204
|
-
verify: async (_call, t) => {
|
|
205
|
-
const base = process.env.COMFYUI_URL ?? "http://127.0.0.1:8188";
|
|
206
|
-
const ids = [...new Set([...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]))];
|
|
207
|
-
for (const id of ids.reverse()) {
|
|
208
|
-
try {
|
|
209
|
-
const hist = (await (await fetch(`${base}/history/${id}`)).json())[id];
|
|
210
|
-
if (!hist?.status?.completed) continue;
|
|
211
|
-
// gather every output image of THIS single prompt and read its real
|
|
212
|
-
// pixel size from the PNG header — need two distinct sizes, 2x apart.
|
|
213
|
-
const dims = new Set();
|
|
214
|
-
for (const out of Object.values(hist.outputs ?? {})) {
|
|
215
|
-
for (const img of out.images ?? []) {
|
|
216
|
-
if (img.type !== "output") continue;
|
|
217
|
-
const u = new URL("/view", base);
|
|
218
|
-
u.searchParams.set("filename", img.filename);
|
|
219
|
-
u.searchParams.set("type", "output");
|
|
220
|
-
if (img.subfolder) u.searchParams.set("subfolder", img.subfolder);
|
|
221
|
-
const buf = Buffer.from(await (await fetch(u)).arrayBuffer());
|
|
222
|
-
if (buf.length > 24 && buf.toString("ascii", 1, 4) === "PNG") {
|
|
223
|
-
dims.add(`${buf.readUInt32BE(16)}x${buf.readUInt32BE(20)}`);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
if (dims.has("512x512") && dims.has("1024x1024")) return true;
|
|
228
|
-
} catch {
|
|
229
|
-
/* try next id */
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return false;
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
id: "pipeline",
|
|
237
|
-
title: "Two-stage pipe via output staging",
|
|
238
|
-
task:
|
|
239
|
-
"Two-stage pipeline. Stage 1: render 'a plain wooden mask' at 512x512 and wait for it to finish. Stage 2: run an " +
|
|
240
|
-
"img2img pass over stage 1's ACTUAL output image with the prompt 'an ornate golden mask' and denoise about 0.55, " +
|
|
241
|
-
"and wait for it too. Do NOT guess file paths — use the staging tool that feeds a previous output into the next " +
|
|
242
|
-
"stage's loader. Report both prompt_ids.",
|
|
243
|
-
primary: ["enqueue_workflow", "generate_image"],
|
|
244
|
-
partial: ["create_workflow", "stage_output_as_input"],
|
|
245
|
-
verify: async (call, t) => {
|
|
246
|
-
// the staging tool must have actually run…
|
|
247
|
-
if (!t.calls.some((c) => c.tool === "stage_output_as_input" && c.ok)) return false;
|
|
248
|
-
const base = process.env.COMFYUI_URL ?? "http://127.0.0.1:8188";
|
|
249
|
-
const ids = [...new Set([...t.toolText.matchAll(/"prompt_id":\s*"([0-9a-f-]{8,})"/g)].map((m) => m[1]))];
|
|
250
|
-
if (ids.length < 2) return false;
|
|
251
|
-
// …and the LAST completed prompt must be a real img2img graph: a
|
|
252
|
-
// LoadImage feeding it and a KSampler with partial denoise.
|
|
253
|
-
for (const id of ids.reverse()) {
|
|
254
|
-
try {
|
|
255
|
-
const hist = (await (await fetch(`${base}/history/${id}`)).json())[id];
|
|
256
|
-
if (!hist?.status?.completed) continue;
|
|
257
|
-
const nodes = Object.values(hist.prompt?.[2] ?? {});
|
|
258
|
-
const hasLoad = nodes.some((n) => n.class_type === "LoadImage");
|
|
259
|
-
const partialDenoise = nodes.some(
|
|
260
|
-
(n) => typeof n.inputs?.denoise === "number" && n.inputs.denoise > 0.2 && n.inputs.denoise < 0.9,
|
|
261
|
-
);
|
|
262
|
-
if (hasLoad && partialDenoise) return true;
|
|
263
|
-
break; // only judge the newest completed prompt as stage 2
|
|
264
|
-
} catch {
|
|
265
|
-
/* try next id */
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return false;
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
];
|
|
272
|
-
|
|
273
52
|
/**
|
|
274
53
|
* Two API dialects, one arena:
|
|
275
54
|
* - ARENA_API=ollama (default): Ollama-native /api/chat — lets us pin num_ctx.
|