@openclaw/comfy-provider 2026.9.4 → 2026.9.6
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/assets/activity.svg +32 -0
- package/assets/icon.png +0 -0
- package/dist/workflow-runtime.js +15 -18
- package/openclaw.plugin.json +49 -1
- package/package.json +7 -5
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
2
|
+
<!--
|
|
3
|
+
Adapted from OpenClaw ui/public/provider-icons/ProviderIcon-comfy.svg.
|
|
4
|
+
Source: @lobehub/icons-static-svg@1.94.0, comfyui.svg
|
|
5
|
+
https://www.npmjs.com/package/@lobehub/icons-static-svg/v/1.94.0
|
|
6
|
+
https://github.com/lobehub/lobe-icons
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
Copyright (c) 2023 LobeHub
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Names and marks remain the property of their respective owners.
|
|
30
|
+
-->
|
|
31
|
+
<path fill="currentColor" fill-rule="evenodd" stroke="none" d="M5.485 23.76c-.568 0-1.026-.207-1.325-.598-.307-.402-.387-.964-.22-1.54l.672-2.315a.605.605 0 00-.1-.536.622.622 0 00-.494-.243H2.085c-.568 0-1.026-.207-1.325-.598-.307-.403-.387-.964-.22-1.54l2.31-7.917.255-.87c.343-1.18 1.592-2.14 2.786-2.14h2.313c.276 0 .519-.18.595-.442l.764-2.633C9.906 1.208 11.155.249 12.35.249l4.945-.008h3.62c.568 0 1.027.206 1.325.597.307.402.387.964.22 1.54l-1.035 3.566c-.343 1.178-1.593 2.137-2.787 2.137l-4.956.01H11.37a.618.618 0 00-.594.441l-1.928 6.604a.605.605 0 00.1.537c.118.153.3.243.495.243l3.275-.006h3.61c.568 0 1.026.206 1.325.598.307.402.387.964.22 1.54l-1.036 3.565c-.342 1.179-1.592 2.138-2.786 2.138l-4.957.01h-3.61z" />
|
|
32
|
+
</svg>
|
package/assets/icon.png
ADDED
|
Binary file
|
package/dist/workflow-runtime.js
CHANGED
|
@@ -28,9 +28,15 @@ function readConfigInteger(config, key) {
|
|
|
28
28
|
}
|
|
29
29
|
function getComfyConfig(cfg) {
|
|
30
30
|
const pluginConfig = cfg?.plugins?.entries?.comfy?.config;
|
|
31
|
-
if (isRecord(pluginConfig)) return
|
|
31
|
+
if (isRecord(pluginConfig)) return {
|
|
32
|
+
config: pluginConfig,
|
|
33
|
+
path: "plugins.entries.comfy.config"
|
|
34
|
+
};
|
|
32
35
|
const legacyConfig = cfg?.models?.providers?.comfy;
|
|
33
|
-
return
|
|
36
|
+
return {
|
|
37
|
+
config: isRecord(legacyConfig) ? legacyConfig : {},
|
|
38
|
+
path: "models.providers.comfy"
|
|
39
|
+
};
|
|
34
40
|
}
|
|
35
41
|
function stripNestedCapabilityConfig(config) {
|
|
36
42
|
const next = { ...config };
|
|
@@ -110,22 +116,11 @@ function setWorkflowInput(params) {
|
|
|
110
116
|
if (!isRecord(inputs)) throw new Error(`Comfy workflow node "${params.nodeId}" is missing an inputs object`);
|
|
111
117
|
inputs[params.inputName] = params.value;
|
|
112
118
|
}
|
|
113
|
-
async function resolveComfyHeadersConfig(value, cfg) {
|
|
119
|
+
async function resolveComfyHeadersConfig(value, cfg, configPath) {
|
|
114
120
|
const headers = new Headers();
|
|
115
121
|
if (!isRecord(value)) return headers;
|
|
116
122
|
for (const [name, headerValue] of Object.entries(value)) {
|
|
117
|
-
const path =
|
|
118
|
-
const inspected = resolveSecretInputString({
|
|
119
|
-
value: headerValue,
|
|
120
|
-
path,
|
|
121
|
-
defaults: cfg.secrets?.defaults,
|
|
122
|
-
mode: "inspect"
|
|
123
|
-
});
|
|
124
|
-
if (inspected.status === "available") {
|
|
125
|
-
headers.set(name, inspected.value);
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
if (inspected.status === "missing") continue;
|
|
123
|
+
const path = `${configPath}.headers[${JSON.stringify(name)}]`;
|
|
129
124
|
const resolved = await resolveConfiguredSecretInputString({
|
|
130
125
|
config: cfg,
|
|
131
126
|
env: process.env,
|
|
@@ -338,7 +333,8 @@ function hasUnavailableComfyHeaderSecret(value, cfg) {
|
|
|
338
333
|
});
|
|
339
334
|
}
|
|
340
335
|
function isComfyCapabilityConfigured(params) {
|
|
341
|
-
const
|
|
336
|
+
const { config } = getComfyConfig(params.cfg);
|
|
337
|
+
const capabilityConfig = getComfyCapabilityConfig(config, params.capability);
|
|
342
338
|
const hasWorkflow = Boolean(resolveComfyWorkflowSource(capabilityConfig).workflow || normalizeOptionalString(capabilityConfig.workflowPath));
|
|
343
339
|
const hasPromptNode = Boolean(normalizeOptionalString(capabilityConfig.promptNodeId));
|
|
344
340
|
if (!hasWorkflow || !hasPromptNode) return false;
|
|
@@ -354,7 +350,8 @@ function isComfyCapabilityConfigured(params) {
|
|
|
354
350
|
});
|
|
355
351
|
}
|
|
356
352
|
async function runComfyWorkflow(params) {
|
|
357
|
-
const
|
|
353
|
+
const { config, path: configPath } = getComfyConfig(params.cfg);
|
|
354
|
+
const capabilityConfig = getComfyCapabilityConfig(config, params.capability);
|
|
358
355
|
const mode = resolveComfyMode(capabilityConfig);
|
|
359
356
|
const workflow = await loadComfyWorkflow(capabilityConfig);
|
|
360
357
|
const promptNodeId = getRequiredConfigString(capabilityConfig, "promptNodeId");
|
|
@@ -396,7 +393,7 @@ async function runComfyWorkflow(params) {
|
|
|
396
393
|
baseUrl: normalizeOptionalString(capabilityConfig.baseUrl),
|
|
397
394
|
defaultBaseUrl: mode === "cloud" ? DEFAULT_COMFY_CLOUD_BASE_URL : DEFAULT_COMFY_LOCAL_BASE_URL,
|
|
398
395
|
allowPrivateNetwork: mode === "local" || explicitAllowPrivateNetwork,
|
|
399
|
-
headers: await resolveComfyHeadersConfig(capabilityConfig.headers, params.cfg),
|
|
396
|
+
headers: await resolveComfyHeadersConfig(capabilityConfig.headers, params.cfg, configPath),
|
|
400
397
|
defaultHeaders: mode === "cloud" ? {
|
|
401
398
|
"X-API-Key": resolvedAuth?.apiKey ?? "",
|
|
402
399
|
"Content-Type": "application/json"
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "comfy",
|
|
3
|
-
"categories": ["
|
|
3
|
+
"categories": ["media"],
|
|
4
4
|
"activation": {
|
|
5
5
|
"onStartup": false
|
|
6
6
|
},
|
|
@@ -185,6 +185,54 @@
|
|
|
185
185
|
]
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
|
+
"configGroups": [
|
|
189
|
+
{
|
|
190
|
+
"id": "comfy-connection",
|
|
191
|
+
"title": "Comfy connection",
|
|
192
|
+
"order": 10,
|
|
193
|
+
"properties": ["mode", "baseUrl", "apiKey", "allowPrivateNetwork", "headers"]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "shared-workflow",
|
|
197
|
+
"title": "Shared workflow",
|
|
198
|
+
"order": 20,
|
|
199
|
+
"properties": [
|
|
200
|
+
"workflowPath",
|
|
201
|
+
"workflow",
|
|
202
|
+
"promptNodeId",
|
|
203
|
+
"promptInputName",
|
|
204
|
+
"seedNodeId",
|
|
205
|
+
"seedInputName",
|
|
206
|
+
"inputImageNodeId",
|
|
207
|
+
"inputImageInputName",
|
|
208
|
+
"outputNodeId"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "image-workflow",
|
|
213
|
+
"title": "Image workflow",
|
|
214
|
+
"order": 30,
|
|
215
|
+
"properties": ["image"]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "video-workflow",
|
|
219
|
+
"title": "Video workflow",
|
|
220
|
+
"order": 40,
|
|
221
|
+
"properties": ["video"]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"id": "music-workflow",
|
|
225
|
+
"title": "Music workflow",
|
|
226
|
+
"order": 50,
|
|
227
|
+
"properties": ["music"]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "execution-limits",
|
|
231
|
+
"title": "Execution limits",
|
|
232
|
+
"order": 60,
|
|
233
|
+
"properties": ["pollIntervalMs", "timeoutMs"]
|
|
234
|
+
}
|
|
235
|
+
],
|
|
188
236
|
"configSchema": {
|
|
189
237
|
"type": "object",
|
|
190
238
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/comfy-provider",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.6",
|
|
4
4
|
"description": "OpenClaw ComfyUI provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.7.2"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.9.
|
|
21
|
+
"pluginApi": ">=2026.9.6"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
24
|
+
"openclawVersion": "2026.9.6",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
"files": [
|
|
36
36
|
"dist/**",
|
|
37
37
|
"openclaw.plugin.json",
|
|
38
|
-
"README.md"
|
|
38
|
+
"README.md",
|
|
39
|
+
"assets/icon.png",
|
|
40
|
+
"assets/activity.svg"
|
|
39
41
|
],
|
|
40
42
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.9.
|
|
43
|
+
"openclaw": ">=2026.9.6"
|
|
42
44
|
},
|
|
43
45
|
"peerDependenciesMeta": {
|
|
44
46
|
"openclaw": {
|