dsh-comfyui 0.3.0-beta.2 → 0.3.0-beta.5
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.en.md +34 -14
- package/README.md +35 -15
- package/client/client.js +547 -63
- package/client/client.js.map +1 -1
- package/lib/comfyui.d.ts +61 -1
- package/lib/comfyui.js +93 -6
- package/lib/config.d.ts +26 -0
- package/lib/config.js +11 -0
- package/lib/convert.js +64 -13
- package/lib/index.js +22 -4
- package/lib/params.d.ts +53 -1
- package/lib/params.js +192 -10
- package/lib/proxy.js +67 -29
- package/lib/routes.js +328 -44
- package/lib/skill.js +40 -7
- package/lib/store.d.ts +15 -3
- package/lib/store.js +48 -12
- package/lib/tools.d.ts +13 -14
- package/lib/tools.js +87 -8
- package/package.json +5 -1
package/README.en.md
CHANGED
|
@@ -22,24 +22,26 @@
|
|
|
22
22
|
|
|
23
23
|
- `comfyui_run` — submit a ComfyUI API-format workflow, or pick a built-in template, and get the generated media back. Two modes: `sync` (wait and return media) and `async` (start a background job, collect with `job_output` — ideal for video).
|
|
24
24
|
- `comfyui_object_info` — list the node definitions of your ComfyUI server so the agent can build valid workflows on the fly.
|
|
25
|
-
- `comfyui_workflow` — list and run runnable workflows from the plugin library. `action: list` also reports graph workflows you saved on the ComfyUI server and whether each has been **extracted** into runnable workflows; unextracted graphs are flagged so the agent tells you to extract them in the panel first.
|
|
25
|
+
- `comfyui_workflow` — list and run runnable workflows from the plugin library. `action: list` also reports your ComfyUI server address and local install dirs (the `env` field), plus graph workflows you saved on the ComfyUI server and whether each has been **extracted** into runnable workflows; unextracted graphs are flagged so the agent tells you to extract them in the panel first. `action: refresh` re-derives one workflow's parameter snapshot by id and saves it back (force-rescans the TTS voice library first, then updates option/number metadata from the current node definitions) — run it after the voice library or node definitions changed.
|
|
26
26
|
|
|
27
27
|
### UI panel
|
|
28
28
|
|
|
29
29
|
Right-docked; open from the sidebar rail — three tabs:
|
|
30
30
|
|
|
31
31
|
- **Workflows** — the plugin library of runnable (API) workflows: create / edit / run / delete, plus "Import file" to load an API-format `.json` directly. The **ComfyUI-saved graphs** section auto-detects graph workflows you saved in ComfyUI, shows which runnable workflows were extracted from each, and offers **extract** with per-graph analysis: a canvas often holds several independent flows, so you choose extract all / extract per component / extract main flow only. Workflows can be classified with **tags** (see below).
|
|
32
|
-
- **Assets** — everything the plugin generated, newest first, with a detail view and download links.
|
|
32
|
+
- **Assets** — everything the plugin generated, newest first, with a detail view and download links. Hovering a card reveals a red trash button; it opens a confirmation dialog listing the files, and confirming removes the index record and deletes the matching files from the ComfyUI output directory. ComfyUI itself has no API for deleting output files, so the plugin touches the filesystem directly: files are only really deleted when DSH can reach that directory (same-machine installs); otherwise just the record goes and the dialog says so.
|
|
33
33
|
- **Queue** — a task center over ComfyUI's unified jobs API (`/api/jobs`): every task across the live queue **and** history in five states (pending / in progress / completed / failed / cancelled), filterable by state, with per-task progress bars (plugin-submitted jobs), preview thumbnails, failure messages and duration, plus actions — delete, interrupt, rerun, clear queue/history, free memory. Tasks the plugin queued are marked with their workflow name.
|
|
34
34
|
|
|
35
35
|
<p align="center"><img src="images/panel.png" width="70%" alt="Main panel: workflows / assets / queue" title="Main panel: workflows / assets / queue" /></p>
|
|
36
36
|
|
|
37
37
|
### Load area
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
A media loader in the style of ComfyUI's LoadImage node, sitting at the top of the Workflows tab: besides images, the picker also lists the video and audio files available to the ComfyUI loader nodes (LoadVideo / LoadAudio).
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
41
|
+
- **Multiple slots**: the load area is a list of slots — a lone slot stretches across the panel, two or more share a fixed width and wrap into rows. "+ Add slot" at the bottom appends one; an empty slot reads "Slot N / Add media" and fills on click; hovering a slot reveals an **×** in its corner that deletes it, and the picker's first tile ("None") empties a slot while keeping it. Filled slots fill the workflow's unset loader parameters in order — a two-reference workflow just needs two slots, with no file names for the agent to guess.
|
|
42
|
+
- Clicking any slot opens a picker window with a nav bar (All / Imported / Generated), a type filter, a paste/upload drop zone on the right, and a masonry grid of every loadable image / video / audio file in the ComfyUI `input` directory plus everything the plugin generated. **Video and audio play right in the card** (clicking the player only plays, it never selects); clicking the file name under a card picks it and closes the window. File kind is decided by extension, and each loader's input key is read from the ComfyUI node definition (`LoadImage.image` / `LoadVideo.file` / `LoadAudio.audio`), so no media type goes missing.
|
|
43
|
+
- Load-area media are the **default inputs**: unset loader parameters are filled from the slots in order (slot 1 → first image parameter, slot 2 → second; video/audio parameters take slots of their own kind) — the agent does not need to name a file. Parameters with no matching slot keep the workflow's authored value.
|
|
44
|
+
- **Visible to the agent**: `comfyui_workflow action: list` reports a `loadArea` field (slot count, how many are filled, and the file list), so the agent knows what the user loaded without asking.
|
|
43
45
|
- **Resolution auto-match**: uploads record their pixel size; when a run leaves `width`/`height` unset, they default to the source image's actual size.
|
|
44
46
|
- **Hash naming + dedup**: uploads are renamed to `original_shorthash.ext` (SHA-256 first 10 hex); re-uploading an identical file reuses the existing name instead of storing a duplicate. The picker refreshes live after uploads.
|
|
45
47
|
- Selecting a **generated** image copies it from the output directory into `input` on the fly, so image-loading nodes can use it.
|
|
@@ -56,7 +58,7 @@ Classify runnable workflows with preset categories (image-to-image / text-to-ima
|
|
|
56
58
|
|
|
57
59
|
### Media proxy
|
|
58
60
|
|
|
59
|
-
Generated files stream through a same-origin route (`/comfyui/media`),
|
|
61
|
+
Generated files are addressed by `filename + subfolder + type` and stream through a same-origin route (`/comfyui/media`), never through ComfyUI's in-memory history — older results in the asset panel keep opening after a ComfyUI restart or a history clear, as long as the file is still in the output directory. The browser never talks to ComfyUI directly: no CORS, no mixed-content, no API key in the page, and remote ComfyUI installs work unchanged. The media URL base is auto-detected: on every page load the browser self-reports the origin it actually uses via `/comfyui/ping` (LAN IP / domain / reverse proxy all produce working links), or you can pin it explicitly with the `mediaHost` config key.
|
|
60
62
|
|
|
61
63
|
### Tool card
|
|
62
64
|
|
|
@@ -64,13 +66,13 @@ Results render as a media wall (images/videos with download links) right in the
|
|
|
64
66
|
|
|
65
67
|
### Settings page
|
|
66
68
|
|
|
67
|
-
A ComfyUI section in the DH settings where you can edit the server URL, API-key env var,
|
|
69
|
+
A ComfyUI section in the DH settings where you can edit the server URL (`baseUrl`), API-key env var (`apiKeyEnv`), media base URL (`mediaHost`), the local ComfyUI install directories (`comfyuiDirs`, multiple allowed — mapped dirs / multiple installs; the agent uses them to locate your ComfyUI files and the TTS voice library without asking), test the connection, and switch the plugin UI language (Chinese / English — stored in the browser, applies to the whole plugin UI), all without touching `cordis.yml`. The data directory and asset cap are configured in `cordis.yml` only and are not exposed in the settings page.
|
|
68
70
|
|
|
69
71
|
<p align="center"><img src="images/settings.png" width="70%" alt="ComfyUI settings page (with UI language switch)" title="ComfyUI settings page (with UI language switch)" /></p>
|
|
70
72
|
|
|
71
73
|
### Companion skill
|
|
72
74
|
|
|
73
|
-
A runtime skill (`dsh-comfyui-workflows`) registered through `ctx.skills.register`: the agent learns the graph-vs-runnable model, canvas analysis rules (connected components, bypassed groups, dangling nodes), when to ask you about extract mode, and the extraction tech rules.
|
|
75
|
+
A runtime skill (`dsh-comfyui-workflows`) registered through `ctx.skills.register`: the agent learns the graph-vs-runnable model, canvas analysis rules (connected components, bypassed groups, dangling nodes), when to ask you about extract mode, and the extraction tech rules. The skill also carries the **local environment** story (read `env.comfyuiDirs` from `comfyui_workflow list`) and the **TTS-Audio-Suite voice-library workflow** (one unified flow: refresh the snapshot first, then query — refresh via the `/api/tts-audio-suite/voice-library?refresh=1` endpoint plus `action: refresh` to re-derive and write the snapshot back; query prefers the HTTP endpoint, otherwise lists `{comfyuiDir}/models/voices` etc.; a new voice rejected at run time = stale snapshot), so the agent never has to dig through the plugin's source again.
|
|
74
76
|
|
|
75
77
|
### Graph workflows vs runnable workflows
|
|
76
78
|
|
|
@@ -92,23 +94,34 @@ Extraction follows the live `/object_info`: rewires Reroute/bypass pass-throughs
|
|
|
92
94
|
Every runnable workflow carries an adjustable **parameter set** (`parameters`) so one workflow can produce different results per run:
|
|
93
95
|
|
|
94
96
|
- **Auto-detected (conservative)**: prompt text inputs, resolution (`EmptyLatentImage` width/height), sampler steps (`KSampler.steps`), and seed (`KSampler.seed`, randomized per run by default). Sampling-related inputs (cfg/denoise) and model selections stay as authored.
|
|
95
|
-
- **Advanced parameters**: the panel's workflow editor can expose any node input as a custom parameter (pick node → pick input → name it), and edit each parameter's name, label, default, and random toggle.
|
|
97
|
+
- **Advanced parameters**: the panel's workflow editor can expose any node input as a custom parameter (pick node → pick input → name it), and edit each parameter's name, label, default, and random toggle. The list offers every widget value of the node (a loader's `upload` entry included); inputs currently driven by a link are left out, since they carry no editable value and exposing one would only fight the connection.
|
|
98
|
+
- **Boolean parameters use a checkbox**: pick `true` / `false` directly; at run time the `"true"` / `"false"` / `0` / `1` spellings are accepted too (defaults stored as strings by older versions are normalized instead of being silently dropped).
|
|
99
|
+
- **Int vs. float number parameters**: the declared input type (`INT` / `FLOAT`) is read from the ComfyUI node definition, so FLOAT inputs like `cfg` or `denoise` accept decimals while INT inputs like `steps` or `seed` are rounded at run time; unknown types are treated as decimals. Each row shows `number/int` or `number/float`, with range and step in the tooltip.
|
|
96
100
|
- **Agent-facing**: the parameter list is written into the workflow's input notes (`inputs` field) and shown by `comfyui_workflow` `action: list`; `action: run` accepts `parameters: {"prompt": "...", "seed": 42}` overrides — explicit values win over random/default, omitted parameters use their defaults.
|
|
101
|
+
- **Parameter snapshot & refresh**: a parameter's options/number metadata (`options`, `numberKind`, …) is copied from the ComfyUI node definitions **at save time** and is never auto-updated afterwards (noticeable with growing lists like the voice library or uploaded files). Refresh it via `comfyui_workflow action: refresh { id }`, or — from other programs — the same-origin route `POST /comfyui/workflows/refresh-params` (body `{ "id": ... }`). Refreshing only touches derived fields; your hand-added advanced parameters and authored defaults are preserved. Until refreshed, `action: list` may be missing new voices and `action: run` will reject them.
|
|
97
102
|
- **Load-area integration**: an unset image-type parameter is filled with the load-area's current source image, and unset `width`/`height` are auto-matched to that image's recorded pixel size. Explicit values always win, so the agent can still override both.
|
|
98
103
|
|
|
99
104
|
## Requirements
|
|
100
105
|
|
|
101
|
-
- DeepSeek Harness (web profile) — the plugin targets the `web`
|
|
106
|
+
- DeepSeek Harness (web / desktop profile) — the plugin targets the `web` and `desktop` profiles (web side requires `@deepseek-ai/dsh-web-app` ≥ 0.1.0-rc.6).
|
|
102
107
|
- A running [ComfyUI](https://github.com/comfystack/ComfyUI) server (default `http://127.0.0.1:8188`).
|
|
103
108
|
- For the `video` template: the [ComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper) custom nodes and Wan 2.1 model files.
|
|
104
109
|
|
|
105
110
|
## Installation
|
|
106
111
|
|
|
112
|
+
Web profile:
|
|
113
|
+
|
|
107
114
|
```sh
|
|
108
115
|
dsh plugin --profile web add dsh-comfyui
|
|
109
116
|
```
|
|
110
117
|
|
|
111
|
-
|
|
118
|
+
Desktop profile:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
dsh plugin --profile desktop add dsh-comfyui
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then restart the corresponding app (web server or desktop app; host-side rows mount at boot). The panel trigger appears in the sidebar rail, the settings section "ComfyUI" appears in the settings page, and the agent gains `comfyui_run`, `comfyui_object_info`, `comfyui_workflow`, and the `dsh-comfyui-workflows` skill immediately.
|
|
112
125
|
|
|
113
126
|
### API key (remote servers)
|
|
114
127
|
|
|
@@ -137,10 +150,14 @@ The plugin reads a `comfyui` section from `cordis.yml` (or the settings page):
|
|
|
137
150
|
config:
|
|
138
151
|
baseUrl: http://127.0.0.1:8188
|
|
139
152
|
apiKeyEnv: COMFYUI_API_KEY
|
|
140
|
-
timeoutMs:
|
|
153
|
+
timeoutMs: 900000
|
|
141
154
|
maxMediaItems: 12
|
|
142
155
|
dataDir: ''
|
|
143
156
|
maxAssets: 200
|
|
157
|
+
mediaHost: ''
|
|
158
|
+
outputDir: ''
|
|
159
|
+
comfyuiDirs:
|
|
160
|
+
- 'D:\ComfyUI'
|
|
144
161
|
```
|
|
145
162
|
|
|
146
163
|
| Key | Default | Description |
|
|
@@ -148,14 +165,17 @@ The plugin reads a `comfyui` section from `cordis.yml` (or the settings page):
|
|
|
148
165
|
| `baseUrl` | `http://127.0.0.1:8188` | ComfyUI HTTP server base URL |
|
|
149
166
|
| `apiKeyEnv` | `COMFYUI_API_KEY` | Env-variable / credential name for the optional API key |
|
|
150
167
|
| `connectTimeoutMs` | `10000` | Per-request connect/read timeout |
|
|
151
|
-
| `timeoutMs` | `
|
|
168
|
+
| `timeoutMs` | `900000` | Sync generation wait budget (15 min; raise for video) |
|
|
152
169
|
| `pollIntervalMs` | `1000` | History polling interval while waiting |
|
|
153
170
|
| `maxMediaItems` | `12` | Max media items returned per workflow |
|
|
154
171
|
| `maxMediaBytes` | `67108864` | Max bytes the media proxy streams per file |
|
|
155
172
|
| `dataDir` | *(DSH data dir)* | Where the workflow library and asset index live (`$DSH_HOME/data/dsh-comfyui` by default) |
|
|
156
173
|
| `maxAssets` | `200` | Max entries kept in the asset index |
|
|
174
|
+
| `mediaHost` | `''` (auto-detect) | External base URL for generated media (e.g. `http://192.168.1.5:3080`); empty auto-uses the origin the browser actually reaches this server with |
|
|
175
|
+
| `outputDir` | `''` (inferred) | ComfyUI's output directory on this machine, used to locate files when deleting an asset; empty infers it from the paths ComfyUI reports, and deletion falls back to removing the index record when it cannot (e.g. a remote ComfyUI) |
|
|
176
|
+
| `comfyuiDirs` | `[]` | Local ComfyUI install root(s) (multiple allowed: mapped dirs / multiple installs). The agent reads them via `env.comfyuiDirs` from `comfyui_workflow list` to locate models, custom nodes and the TTS-Audio-Suite voice library directly |
|
|
157
177
|
|
|
158
|
-
## Roadmap & design boundaries
|
|
178
|
+
## Roadmap & design boundaries
|
|
159
179
|
|
|
160
180
|
Confirmed scope decisions for this phase:
|
|
161
181
|
|
package/README.md
CHANGED
|
@@ -22,24 +22,26 @@
|
|
|
22
22
|
|
|
23
23
|
- `comfyui_run` —— 提交 ComfyUI API 格式的工作流,或选用内置模板,返回生成的媒体。两种模式:`sync`(等待并返回媒体)与 `async`(后台任务,用 `job_output` 收集结果——视频生成强烈建议)。
|
|
24
24
|
- `comfyui_object_info` —— 列出你的 ComfyUI 服务器支持的节点定义,让 Agent 能当场构造合法的工作流。
|
|
25
|
-
- `comfyui_workflow` —— 列出并运行插件库中的可运行工作流。`action: list`
|
|
25
|
+
- `comfyui_workflow` —— 列出并运行插件库中的可运行工作流。`action: list` 还会报告你的 ComfyUI 服务器地址与本机 ComfyUI 目录(`env` 字段),以及你在 ComfyUI 端保存的图工作流和每个是否已**提取**出可运行执行流;未提取的会明确标注,Agent 会先转告你在面板里点"提取"。`action: refresh` 按 id 重算某个工作流的参数快照并写回(先强制 TTS 音色库重扫,再按最新节点定义更新参数的选项/数值声明)——音色库或节点定义变更后跑它。
|
|
26
26
|
|
|
27
27
|
### UI 面板
|
|
28
28
|
|
|
29
29
|
右侧停靠;从侧边栏轨道打开——三个页签:
|
|
30
30
|
|
|
31
31
|
- **工作流** —— 插件库(可运行的 API 工作流):新建 / 编辑 / 运行 / 删除,支持"导入文件"直接加载 API 格式 `.json`。"ComfyUI 端保存"分区自动检测你在 ComfyUI 里保存的图工作流,显示每个已提取出的执行流,并提供**提取**:画布上往往躺着多个独立流程,可整体提取 / 按分量提取 / 只提取主流程。工作流可用**标签**分类(见下)。
|
|
32
|
-
- **资产** ——
|
|
32
|
+
- **资产** —— 插件生成的所有结果,最新在前,带详情视图和下载链接。鼠标悬停卡片右上角出现红色垃圾桶,点击弹出确认框(列出将删除的文件名),确认后移除索引记录并删除 ComfyUI 输出目录里的对应文件。ComfyUI 自身没有删除输出文件的接口,这一步由插件直接操作文件系统,因此只有当 DSH 能访问到输出目录(通常是同机部署)时才会真正删文件,否则只移除记录并在对话框里说明。
|
|
33
33
|
- **队列** —— 基于 ComfyUI 统一任务 API(`/api/jobs`)的任务中心:实时队列**和**历史里所有任务按五态展示(待生成 / 生成中 / 已完成 / 失败 / 已取消),可按状态筛选;插件提交的任务带进度条(进度来自 ComfyUI WS 的 progress 事件),终态任务带预览缩略图、失败原因与耗时;支持操作:删除、中断、重跑、清空队列/历史、释放内存。插件提交的任务标注工作流名。
|
|
34
34
|
|
|
35
35
|
<p align="center"><img src="images/panel.png" width="70%" alt="插件主面板:工作流 / 资产 / 队列" title="插件主面板:工作流 / 资产 / 队列" /></p>
|
|
36
36
|
|
|
37
37
|
### 加载区
|
|
38
38
|
|
|
39
|
-
仿 ComfyUI LoadImage
|
|
39
|
+
仿 ComfyUI LoadImage 节点的媒体加载器,位于工作流页顶部:除图片外,选择窗口也会列出 ComfyUI 加载节点(LoadVideo / LoadAudio)可用的视频与音频文件。
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
41
|
+
- **多加载位**:加载区由若干加载位组成——只有一个时横向铺满面板,两个及以上时等宽排列并自动换行。底部"+ 添加加载区"新增加载位;空加载位显示"加载位 N / 添加素材",点击即可放入;鼠标悬停在任一加载位右上角会出现 **×**,点击删除该加载位;在选择窗口第一格选"空"则只清空该位、保留加载位。已放入的素材按顺序填进工作流里未显式指定的加载参数——两张参考图的工作流放两个加载位即可,Agent 无需点名文件。
|
|
42
|
+
- 点击任一加载位打开加载窗口:上方导航条(全部 / 已导入 / 已生成)、类型筛选、右侧粘贴/上传区、下方瀑布流网格展示 ComfyUI `input` 目录里图像 / 视频 / 音频的全部可加载文件 + 插件生成的全部结果。**视频与音频可就地播放试听**(卡片内自带播放器,点播放器只播放、不会误选);点卡片下方的文件名即选定并关闭窗口。加载文件的类型按扩展名判定,加载节点的输入键从 ComfyUI 节点定义读取(`LoadImage.image` / `LoadVideo.file` / `LoadAudio.audio`),不会漏掉某一类媒体。
|
|
43
|
+
- 加载区素材即**默认输入**:工作流运行中未显式指定的加载参数按加载位顺序自动填入(第 1 位 → 第 1 个图片参数,第 2 位 → 第 2 个;视频/音频参数各取同类型加载位)——无需指定文件名。没有对应加载位的参数保持工作流原值。
|
|
44
|
+
- **Agent 可见**:`comfyui_workflow action: list` 的输出带 `loadArea`(加载位数量、已放入素材数、文件清单),Agent 能直接知道用户加载了几个素材、分别是什么。
|
|
43
45
|
- **分辨率自动匹配**:上传时记录像素尺寸;运行时不传 `width`/`height` 则自动用源图实际分辨率。
|
|
44
46
|
- **哈希命名 + 去重**:上传重命名为 `原名_短哈希.ext`(SHA-256 前 10 位十六进制);重复上传相同文件直接复用已有文件名,不产生重复存储。上传后列表实时刷新。
|
|
45
47
|
- 选中**已生成**的图时会自动从输出目录复制到 `input`,图像加载节点即可使用。
|
|
@@ -56,7 +58,7 @@
|
|
|
56
58
|
|
|
57
59
|
### 媒体代理
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
生成文件按 `文件名 + 子目录 + 类型` 经同源路由(`/comfyui/media`)转发,不依赖 ComfyUI 的内存态历史记录——重启 ComfyUI 或清空历史后,资产面板里的旧结果照样能打开(只要文件还在输出目录)。浏览器不直接接触 ComfyUI:没有 CORS、没有混合内容、页面里不出现 API Key,远程 ComfyUI 部署也可直接使用。媒体 URL 的访问地址自动检测:页面加载时浏览器经 `/comfyui/ping` 自报实际访问的 origin(局域网 IP / 域名 / 反向代理都能拼出正确的链接),也可用配置键 `mediaHost` 显式指定基址。
|
|
60
62
|
|
|
61
63
|
### 工具卡片
|
|
62
64
|
|
|
@@ -64,13 +66,13 @@
|
|
|
64
66
|
|
|
65
67
|
### 设置页
|
|
66
68
|
|
|
67
|
-
DH 设置里新增 "ComfyUI"
|
|
69
|
+
DH 设置里新增 "ComfyUI" 分区:改服务器地址(`baseUrl`)、API Key 环境变量名(`apiKeyEnv`)、媒体访问地址(`mediaHost`)、本机 ComfyUI 安装目录(`comfyuiDirs`,可多条——目录映射 / 多实例;Agent 据此直接定位你的 ComfyUI 文件与 TTS 音色库,无需再询问)、测试连接,并可切换插件界面语言(中文 / English——存于浏览器,作用于整个插件 UI),无需改动 `cordis.yml`。数据目录与资产上限只通过 `cordis.yml` 配置,不在设置页暴露。
|
|
68
70
|
|
|
69
71
|
<p align="center"><img src="images/settings.png" width="70%" alt="ComfyUI 设置页(含界面语言切换)" title="ComfyUI 设置页(含界面语言切换)" /></p>
|
|
70
72
|
|
|
71
73
|
### 配套 skill
|
|
72
74
|
|
|
73
|
-
通过 `ctx.skills.register` 注册的运行时 skill(`dsh-comfyui-workflows`):让 Agent 掌握图工作流 vs 执行流的概念、画布分析规则(连通分量、绕过组、悬空节点)、何时该询问你提取方式,以及图→API 提取的技术规则。
|
|
75
|
+
通过 `ctx.skills.register` 注册的运行时 skill(`dsh-comfyui-workflows`):让 Agent 掌握图工作流 vs 执行流的概念、画布分析规则(连通分量、绕过组、悬空节点)、何时该询问你提取方式,以及图→API 提取的技术规则。skill 还附带了**本机环境**说明(从 `comfyui_workflow list` 的 `env` 读你的 ComfyUI 目录)与**TTS-Audio-Suite 音色库查询**(统一流程:先刷新快照再查询——刷新用 ComfyUI 的 `/api/tts-audio-suite/voice-library?refresh=1` + `action: refresh` 重算写回快照,查询优先走 HTTP 接口、其次直接列 `{comfyuiDir}/models/voices` 等目录;新音色运行被拒 = 快照过期),Agent 不必反复翻插件源码。
|
|
74
76
|
|
|
75
77
|
### 图工作流 vs 可运行工作流(提取执行流)
|
|
76
78
|
|
|
@@ -92,23 +94,34 @@ ComfyUI 分两层:
|
|
|
92
94
|
每个可运行工作流带一组**可调参数**(`parameters`),让同一流程按需生成不同结果:
|
|
93
95
|
|
|
94
96
|
- **自动识别(保守集)**:提取时自动提取 提示词(文本输入节点)、分辨率(`EmptyLatentImage` 宽高)、采样步数(`KSampler.steps`)、种子(`KSampler.seed`,默认**每次运行随机**)。采样相关(cfg/denoise)与模型选择不暴露,保持工作流原样。
|
|
95
|
-
- **高级参数**:面板"编辑工作流"里可手动暴露任意节点的任意输入为参数(选节点 → 选输入 →
|
|
97
|
+
- **高级参数**:面板"编辑工作流"里可手动暴露任意节点的任意输入为参数(选节点 → 选输入 → 命名),并调整每个参数的名称、显示名、默认值、是否随机。输入列表列出该节点全部 widget 值(含加载节点的 `upload` 项),当前由连线驱动的输入不列出——它们没有可编辑的值,暴露出来只会和连线打架。
|
|
98
|
+
- **布尔参数用勾选框编辑**:`true` / `false` 直接点选;运行时也接受 `"true"` / `"false"` / `0` / `1` 这些写法(旧版本存成字符串的默认值会自动归一,不再被静默忽略)。
|
|
99
|
+
- **数字参数区分整数/小数**:从 ComfyUI 节点定义读取输入的声明类型(`INT` / `FLOAT`),`cfg`、`denoise` 这类 FLOAT 参数可直接填小数,`steps`、`seed` 这类 INT 参数在运行时四舍五入;类型未知时按小数处理。参数行会标出 `number/int`、`number/float`,鼠标悬停显示取值范围与步长。
|
|
96
100
|
- **Agent 感知**:参数清单自动写入工作流的"参数说明"(`inputs` 字段),`comfyui_workflow` 工具的 `action: list` 会展示;`action: run` 接受 `parameters: {"prompt": "...", "seed": 42}` 覆盖——显式传值优先于随机/默认,未传参数用默认值。
|
|
97
|
-
-
|
|
101
|
+
- **参数快照与刷新**:每个参数的选项/数值声明(`options`、`numberKind` 等)在**保存工作流那一刻**从 ComfyUI 节点定义拷贝,之后不会自动更新(音色库、上传文件这类会长大的列表尤其明显)。刷新手段:Agent 用 `comfyui_workflow action: refresh { id }`;其他程序可调同源路由 `POST /comfyui/workflows/refresh-params`(body `{ "id": ... }`)。刷新只更新派生字段,**不会**动你手动加的高级参数与默认值;不刷新时,`action: list` 的选项可能缺新音色、`action: run` 传新音色会被拒绝。
|
|
102
|
+
- **加载区联动**:未显式指定的加载参数按加载位顺序自动填入(同类型匹配);未传的 `width`/`height` 自动匹配源图记录的像素尺寸。显式传值始终优先,Agent 仍可覆盖两者,并能从 `action: list` 的 `loadArea` 字段看到用户加载了什么。
|
|
98
103
|
|
|
99
104
|
## 环境要求
|
|
100
105
|
|
|
101
|
-
- DeepSeek Harness(web profile)—— 本插件面向 `web` profile
|
|
106
|
+
- DeepSeek Harness(web / desktop profile)—— 本插件面向 `web` 与 `desktop` profile(web 端要求 `@deepseek-ai/dsh-web-app` ≥ 0.1.0-rc.6)。
|
|
102
107
|
- 一个运行中的 [ComfyUI](https://github.com/comfystack/ComfyUI) 服务器(默认 `http://127.0.0.1:8188`)。
|
|
103
108
|
- 使用 `video` 模板需要 [ComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper) 自定义节点和 Wan 2.1 模型文件。
|
|
104
109
|
|
|
105
110
|
## 安装
|
|
106
111
|
|
|
112
|
+
Web 端(web profile):
|
|
113
|
+
|
|
107
114
|
```sh
|
|
108
115
|
dsh plugin --profile web add dsh-comfyui
|
|
109
116
|
```
|
|
110
117
|
|
|
111
|
-
|
|
118
|
+
桌面端(desktop profile):
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
dsh plugin --profile desktop add dsh-comfyui
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
然后重启对应应用(Web 服务或桌面端;Host 端行在启动时挂载)。侧边栏轨道出现面板入口,设置页出现 "ComfyUI" 分区,Agent 立即获得 `comfyui_run`、`comfyui_object_info`、`comfyui_workflow` 与 `dsh-comfyui-workflows` skill。
|
|
112
125
|
|
|
113
126
|
### API Key(远程服务器)
|
|
114
127
|
|
|
@@ -137,10 +150,14 @@ Agent 会选用模板,或用 `comfyui_object_info` 探查你的服务器,或
|
|
|
137
150
|
config:
|
|
138
151
|
baseUrl: http://127.0.0.1:8188
|
|
139
152
|
apiKeyEnv: COMFYUI_API_KEY
|
|
140
|
-
timeoutMs:
|
|
153
|
+
timeoutMs: 900000
|
|
141
154
|
maxMediaItems: 12
|
|
142
155
|
dataDir: ''
|
|
143
156
|
maxAssets: 200
|
|
157
|
+
mediaHost: ''
|
|
158
|
+
outputDir: ''
|
|
159
|
+
comfyuiDirs:
|
|
160
|
+
- 'D:\ComfyUI'
|
|
144
161
|
```
|
|
145
162
|
|
|
146
163
|
| 键 | 默认值 | 说明 |
|
|
@@ -148,14 +165,17 @@ Agent 会选用模板,或用 `comfyui_object_info` 探查你的服务器,或
|
|
|
148
165
|
| `baseUrl` | `http://127.0.0.1:8188` | ComfyUI HTTP 服务器地址 |
|
|
149
166
|
| `apiKeyEnv` | `COMFYUI_API_KEY` | 可选 API Key 的环境变量/凭据名 |
|
|
150
167
|
| `connectTimeoutMs` | `10000` | 单次请求连接/读取超时 |
|
|
151
|
-
| `timeoutMs` | `
|
|
168
|
+
| `timeoutMs` | `900000` | 同步生成的等待预算(15 分钟;视频请调大) |
|
|
152
169
|
| `pollIntervalMs` | `1000` | 等待完成时的历史轮询间隔 |
|
|
153
170
|
| `maxMediaItems` | `12` | 每个工作流最多返回的媒体条数 |
|
|
154
171
|
| `maxMediaBytes` | `67108864` | 媒体代理单文件流式传输上限(字节) |
|
|
155
172
|
| `dataDir` | *(DSH 数据目录)* | 工作流库与资产索引存放位置(默认 `$DSH_HOME/data/dsh-comfyui`) |
|
|
156
173
|
| `maxAssets` | `200` | 资产索引最多保留的条数 |
|
|
174
|
+
| `mediaHost` | `''`(自动检测) | 生成媒体的外网访问基址(如 `http://192.168.1.5:3080`);留空自动使用浏览器实际访问本服务器的地址 |
|
|
175
|
+
| `outputDir` | `''`(自动推断) | ComfyUI 在本机的输出目录,删除资产时用它定位文件;留空则从 ComfyUI 返回的文件路径自动推断,推断不出(如远程部署)时只删索引记录 |
|
|
176
|
+
| `comfyuiDirs` | `[]` | 本机 ComfyUI 安装目录列表(可多条:目录映射 / 多实例)。Agent 通过 `comfyui_workflow list` 的 `env.comfyuiDirs` 读取,据此定位 models、自定义节点与 TTS-Audio-Suite 音色库等文件 |
|
|
157
177
|
|
|
158
|
-
## Roadmap
|
|
178
|
+
## Roadmap 与设计边界
|
|
159
179
|
|
|
160
180
|
本阶段确认的范围决策:
|
|
161
181
|
|