@logictan/dsh-imagegen 1.5.13
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/LICENSE +201 -0
- package/README.md +407 -0
- package/cordis.patch.yml +12 -0
- package/docs/skill-config.md +172 -0
- package/lib/client.js +69794 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +10123 -0
- package/lib/locale-tables-B2442vjN.js +2387 -0
- package/lib/locale-tables-BLbJfsrX.js +2384 -0
- package/lib/locale-tables.js +2 -0
- package/package.json +84 -0
- package/src/templates/canghe-cases.json +11126 -0
- package/src/templates/cases.json +10196 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
# dsh-imagegen
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.npmjs.com/package/@logictan/dsh-imagegen"><img src="https://img.shields.io/npm/v/@logictan/dsh-imagegen?color=cb3837&logo=npm&label=npm" alt="npm" /></a>
|
|
5
|
+
|
|
6
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-3b82f6.svg" alt="License" /></a>
|
|
7
|
+
|
|
8
|
+
<a href="https://github.com/dale0525/dsh-plugins"><img src="https://img.shields.io/badge/platform-DeepSeek%20Harness-111827" alt="Platform" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<div align="center">
|
|
12
|
+
|
|
13
|
+
## DeepSeek Harness 最好用的 AI 生图工作台
|
|
14
|
+
|
|
15
|
+
**无限画布** 自由编排 · **电商套图** 一键成套 · **对话生图** 连续编辑 · **画廊** 资产沉淀
|
|
16
|
+
|
|
17
|
+
[快速开始](#quick-start) · [无限画布](#canvas) · [电商模式](#ecommerce) · [文生图 / 图生图](#txt2img) · [画廊](#gallery) · [配置](#configuration) · [交流群](#community)
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
`dsh-imagegen` 是 DeepSeek Harness(DSH)的原生 AI 图像工作台。配置任意 OpenAI 兼容生图接口后,Agent 对话生图、`/edit_image` 斜杠命令连续编辑、多模型并列对比、多来源案例模板库与画廊资产管理都在同一个窗口完成;电商模式能把一张商品图扩展成主图、卖点图、场景图等一整套商品视觉。生成任务由宿主进程排队执行,不卡界面、不打断对话,图片也不必在多个工具之间来回搬运。
|
|
22
|
+
|
|
23
|
+
<a id="quick-start"></a>
|
|
24
|
+
## 快速开始
|
|
25
|
+
|
|
26
|
+
前置条件:已安装 [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) 和 Node.js 20+。
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
dsh plugin --profile web add @logictan/dsh-imagegen
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
安装后重启 `dsh web`,侧边栏的“新会话”入口会变成“新会话 / 生图”双 Tab(Windows 如遇 PowerShell 脚本策略限制,请使用 `dsh.cmd`)。
|
|
33
|
+
|
|
34
|
+
首次使用:
|
|
35
|
+
|
|
36
|
+
1. 打开“设置 → 插件 → VisioWork”,添加一个提供方,填入 API 地址和密钥,点击“检测可用模型”,勾选生图模型后保存。
|
|
37
|
+
2. 点击“生图”Tab,输入一句提示词,生成第一张图。
|
|
38
|
+
3. 想让 Agent 也能画图?保持“允许 Agent 调用生图”开启即可(默认开启)。
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><b>其他安装方式与升级</b></summary>
|
|
42
|
+
|
|
43
|
+
**让 Agent 帮你安装** —— 将下面内容直接发给 DSH、Codex 或其他 coding agent:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
用 dsh plugin --profile web add @logictan/dsh-imagegen 安装 AI 生图插件。完成后重启 dsh web,点击“新会话 / 生图”中的“生图” Tab,并打开设置中的 VisioWork 配置。
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**从 Release 安装** —— 从 [GitHub Releases](https://github.com/dale0525/dsh-plugins/releases) 下载目标版本的 tgz 后执行:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
dsh plugin --profile web add <下载路径>/logictan-dsh-imagegen-<版本号>.tgz
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**升级与回滚** —— 重复执行 `add` 命令即可更新到最新版;面板打开时也会自动检测新版本,出现顶部横幅后可在线更新,完成后重启 `dsh web` 生效。渠道配置、历史记录和画廊数据由 DSH 宿主保存,正常升级不会清空。需要固定版本时,使用 `@logictan/dsh-imagegen@<版本号>` 或指定 Release tgz。
|
|
56
|
+
|
|
57
|
+
</details>
|
|
58
|
+
|
|
59
|
+
<div align="center">
|
|
60
|
+
<img src="docs/images/infinite-canvas-demo.gif" alt="无限画布演示:连线节点、悬停快速添加与弹簧 Dock" width="100%" />
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<a id="canvas"></a>
|
|
64
|
+
## 无限画布
|
|
65
|
+
|
|
66
|
+
顶部导航切换到「无限画布」,在节点图上组织 AI 创作:图片节点、文本节点与生成配置节点自由摆放(新建画布自带一组文本 + 配置节点开箱即用),拖动节点左右两侧的圆点即可连线,拖动画布边缘或按住空格 / Ctrl 平移,滚轮缩放(5%–500%)。
|
|
67
|
+
|
|
68
|
+
<div align="center">
|
|
69
|
+
<img src="docs/images/infinite-canvas.png" alt="无限画布:文本与图片节点连线驱动生成配置,参考图与提示词外接" width="100%" />
|
|
70
|
+
<p><sub>文本节点提供提示词、图片节点作为参考图,连线到生成配置节点即可出图并继续串接</sub></p>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
- **连线即工作流**:把图片节点连线到「生成配置」节点就是参考图(第一张为图生图底图),把文本节点连线过来就是提示词;配置节点上显示「已连接 N 个输入节点」。连线上有流向动画与箭头,一眼可见数据从哪来到哪去。
|
|
74
|
+
- **悬停快速添加**:鼠标放到节点右侧的加号上,直接弹出「文本 / 图片 / 配置 / 文件」选择菜单,选中的新节点自动落到右侧并连线(自动避让已有节点并把画布带到新节点前);按住加号拖动仍是自由连线,配置节点后不再叠加配置节点。
|
|
75
|
+
- **生成配置节点**:选中后在节点正下方浮出生成器,直接写提示词(或改写连线进来的文本),选模型、比例、清晰度与张数(1–4 张),点发送即提交;结果图片自动出现在配置节点右侧并保留连线关系,可以继续串到下一个配置节点迭代。
|
|
76
|
+
- **素材入库**:历史记录与画廊的每张图一键「加入画布」,本地图片支持拖拽到画布或直接粘贴剪贴板截图;空图片节点可点击上传。
|
|
77
|
+
- **图片节点工具**:图片节点悬停工具条提供四个能力 —— **标注**(在图片上拖框,松开后从框上拉出一条引导线并挂上一张提示词卡片:卡片跟随图片移动、不需要连任何线;生成时自动读取框与提示词,把红框烧进参考图并附带坐标约束;结果图会与干净原图合成,红框标记不会出现在成品里,框外区域也保证与原图一致;重试同样会重建标记图)、**移除背景**(本地抠图,直接产出带透明通道的 PNG,不消耗额度)、**图层拆分**(调用视觉聊天模型把图拆成背景 / 元素 / 文字图层节点,文字层可改字号、加粗与颜色,人物与装饰元素各自独立可移动)、**模型选择**(为这个节点指定模型,重试与相连的生成配置节点默认沿用)。
|
|
78
|
+
- **文本节点排版**:文本节点头部可调字号(A- / A+)、加粗与文字颜色,图层拆分产出的文字层同样可直接编辑。
|
|
79
|
+
- **画布操作**:框选多选、Shift 加选、整体拖动、四角等比缩放、右键菜单、双击空白快速建节点、复制 / 粘贴 / 副本(Ctrl+C/V/D)、撤销重做(Ctrl+Z / Ctrl+Shift+Z);把图片节点放大后再标注会更顺手,缩放后标注框按比例跟随。左下角小地图可点击跳转,底部工具条悬浮居中(reactbits Dock 式弹簧放大与悬浮标签):文本、涂鸦、**文件**、配置、模板库、**技能库**,以及背景 / 小地图 / 适应内容等视图项;其中「文件」直接弹出上传并把文件落成文件节点。
|
|
80
|
+
- **背景与视图**:13 种背景一键切换 —— 点阵 / 网格线 / 波浪线 / 滚动方格 / 点场 / 互动点阵 / 浮动线条 / 流体扰动 / 液态以太 / 故障终端 / 丝绸 / 星系 / 空白。其中一组移植自 [React Bits](https://www.reactbits.dev) 的动效背景并做了无依赖重写:「液态以太」是随鼠标搅动的 WebGL 流体速度场,「浮动线条」是指针会压弯的发光波形,「星系」是四层视差星野(鼠标推开星星),「丝绸」是缓慢流动的绸面光泽,「故障终端」是带扫描线与故障位移的 CRT 字符场;「波浪线 / 滚动方格 / 点场 / 互动点阵」为画布 2D 实现,支持鼠标扰动与点击冲击波。浅色 / 深色画布会自动切换明暗墨色,新建画布默认使用液态以太;「适应全部内容」一键回正视图。
|
|
81
|
+
- **数据与多窗口**:画布按项目保存在宿主数据目录(`~/.dsh/dsh-imagegen/canvas`),支持多项目管理与重命名;多窗口同时编辑时保存冲突自动按服务端进度重试合并;旧版本画布数据自动迁移到新结构。
|
|
82
|
+
|
|
83
|
+
### 文件节点
|
|
84
|
+
|
|
85
|
+
画布新增**文件节点**:在空白处右键「添加文件节点 / 上传文件」,或直接把文件拖进画布即可建节点;空节点点击也能上传。
|
|
86
|
+
|
|
87
|
+
- **任意文件**:单文件上限 50MB,宿主按内容寻址落盘(sha256),文档、表格、PDF、压缩包、音视频都可以放上来。
|
|
88
|
+
- **安全边界**:`.exe / .bat / .ps1 / .js / .html / .svg` 等脚本与可执行扩展名会被浏览器与宿主两侧拒绝;除下面列出的可预览类型外,资源一律以 `application/octet-stream` + `attachment` 返回,HTML/SVG 一类的标记永远不会被内联渲染。
|
|
89
|
+
- **节点内预览**:文件内容直接在节点里读,不用先下载,并尽量**按原文件的样子还原** ——
|
|
90
|
+
- **Markdown**:渲染成富文本(标题、列表、表格、引用、代码块、链接),全屏可切「渲染 / 源码」;
|
|
91
|
+
- **DOCX**:还原文档结构 —— 标题层级、加粗 / 斜体、项目与编号列表、表格;
|
|
92
|
+
- **PPTX**:一页一张幻灯片卡片,显示页码、标题、正文要点与内嵌图片;
|
|
93
|
+
- **文本 / 代码 / JSON / YAML / XML**:宿主解码后显示原文(上限 12 万字符,超出部分给出提示),带行数与滚动,首次渲染先用随资源下发的 8KB 摘要,随后补齐全文;
|
|
94
|
+
- **CSV / TSV / XLSX**:解析成表格渲染(首行作为表头,最多 300 行 × 40 列),支持带引号的多行单元格;
|
|
95
|
+
- **ODT / ODP**:从 ODF 容器中抽取正文文本;
|
|
96
|
+
- **PDF**:交给浏览器内置阅读器内联显示(宿主以 `application/pdf` + `inline` 返回);
|
|
97
|
+
- **音频 / 视频**:`<audio>` / `<video>` 直接播放,宿主支持 HTTP Range,进度条可拖动;
|
|
98
|
+
- **ZIP**:列出压缩包目录(名称 / 大小 / 文件夹,最多 400 项);
|
|
99
|
+
- 其他二进制(如 `.doc`、`.tiff`、7z/rar)给出本地化说明,仍可下载或用技能处理。
|
|
100
|
+
- 以上解析都在宿主侧限量执行(字数 / 行数 / 页数 / 图片字节预算),超大文件只截断不卡顿。
|
|
101
|
+
- **全屏阅读器**:双击节点、点悬浮工具条的「放大预览」或右键菜单同名项,在浮层里查看全文 / 整表 / 整页 / 整副幻灯片,Markdown 可在「渲染 / 源码」间切换,可一键复制内容、在新标签页打开媒体、下载文件,Esc 或点遮罩关闭。
|
|
102
|
+
- **工具条**:技能、下载、放大预览、复制、删除。
|
|
103
|
+
|
|
104
|
+
### 画布技能
|
|
105
|
+
|
|
106
|
+
任意图片 / 文本 / 文件节点(生成配置节点除外)的悬浮工具条与右键菜单都有**「技能」**入口,技能把节点内容交给模型或 Agent 继续加工,结果以新节点 + 连线回到画布(运行只产出草稿,仍由浏览器写入文档)。
|
|
107
|
+
|
|
108
|
+
内置动作:
|
|
109
|
+
|
|
110
|
+
| 技能 | 适用节点 | 说明 |
|
|
111
|
+
| --- | --- | --- |
|
|
112
|
+
| 文本润色 `polish.text` | 文本 | 更正式 / 更口语 / 更短 / 扩写,或自定义指令 |
|
|
113
|
+
| 图片描述 `describe.image` | 图片 | 视觉模型读出内容,产出可继续当提示词用的文本节点 |
|
|
114
|
+
| 内容抽取 `extract.content` | 文件、图片 | 文本 / 代码直接解码,OOXML(pptx/docx/xlsx)、ODF、PDF 抽取正文(PDF 依赖 FlateDecode 文本流,扫描件请配合 OCR 技能) |
|
|
115
|
+
| 图片转可编辑 PPT `ppt.fromImages` | 图片 | 重任务:驱动本机 `image-to-editable-ppt` 技能,产出 `.pptx` 文件节点 |
|
|
116
|
+
|
|
117
|
+
- **两层执行**:轻量技能直接调用「提示词增强」所配置的聊天模型(不额外占 Agent 会话);重任务技能会启动一个**无头 DSH Agent**,把技能正文注入 Agent 的独立系统提示区,并在磁盘上物化输入文件(`<工作目录>/<画布>/<任务>/input|output`),让 Agent 用真实工具跑完整流水线。
|
|
118
|
+
- **运行卡片与连线**:技能开始执行的瞬间,源节点会**延生出一条流动虚线,连到一张运行卡片**上 —— 卡片显示技能名、轻量/重任务角标、阶段步骤条(排队 → 准备输入 → 执行 → 收集产物)、已用时,并可直接取消;重任务执行中每产出文件都会实时提示(如「已产出 2 个文件」)。完成后卡片自动让位给真正的结果节点与连线;失败时卡片保留错误信息,可一键重试或关闭。刷新页面或切换画布后,未完成的运行会自动恢复卡片。
|
|
119
|
+
- **重任务先确认**:长任务技能的菜单会标「重任务」角标,点击后弹出确认框,显示成本提示与前置条件;确认后才创建 Agent,并可在运行卡片上取消。
|
|
120
|
+
- **多节点批量**:多选同类型节点后运行技能会串行覆盖这些节点;一次最多 12 个输入节点。
|
|
121
|
+
- **多选与来源**:技能产出的节点带来源标记,指向它读了哪些节点。
|
|
122
|
+
- **随节点顺手润色**:文本节点工具条的 ✨ 按钮直接弹出风格菜单,一键覆盖原文(Ctrl+Z 撤销);多选文本节点时同样按顺序批量处理。
|
|
123
|
+
|
|
124
|
+
#### 需要自己装的技能
|
|
125
|
+
|
|
126
|
+
画布会自动列出本机 `~/.dsh/skills` 下**可被模型调用**的所有技能(菜单里 id 形如 `skill:<名称>`),并按其自述与 frontmatter 判断轻量 / 重任务。`image-to-editable-ppt` 属于长任务技能,需要你自行安装;它的图片后端可以直接在下面的「技能配置」里填,插件会调用它自己的 `editppt config` 写进 `~/.editppt/config.yaml`。
|
|
127
|
+
|
|
128
|
+
#### 技能库(在线安装 / 上传安装)
|
|
129
|
+
|
|
130
|
+
底部 Dock 的**「技能库」**按钮打开管理面板,不用手敲文件系统:
|
|
131
|
+
|
|
132
|
+
- **在线安装**:粘贴 GitHub 仓库 / 仓库子目录 / 单个 `SKILL.md`(`blob` 链接)/ 任意 git 地址 / zip 地址,一行一个。GitHub 走 `codeload` 归档下载,**不依赖本机 git**;其他 git 地址回退到 `git clone --depth 1`(非交互、180 秒超时)。
|
|
133
|
+
- **上传安装**:点虚线框选择或直接把 zip **拖进虚线框**(≤50MB;解压后总量同样有上限)。压缩包先解到临时目录,确认里面有 `SKILL.md` 且 frontmatter 的 `name` 合法后才落到 `~/.dsh/skills`。在线安装区位于面板顶部,已安装列表移到下方,每条带大小与配置 / 卸载操作。
|
|
134
|
+
- **卸载**:列表里逐条删除(目录、以及扁平的 `<name>.md` 都能识别)。
|
|
135
|
+
- **热加载**:`~/.dsh/skills` 由宿主的技能监听器看着,装完即出现在技能菜单里,**不需要重启**。
|
|
136
|
+
- **没装也能看懂**:菜单里需要外部技能的行会标出「未安装」并给出「去安装」;运行失败若原因是技能缺失,提示条上直接带安装按钮并把上游地址填好。提示条现在固定在画布**顶部**,不会再被底部内容挡住。
|
|
137
|
+
|
|
138
|
+
#### 技能配置(技能自己声明,面板统一渲染)
|
|
139
|
+
|
|
140
|
+
技能过去只能靠文档手敲命令行或改 dotfile 配自己的密钥 / 后端。现在技能可以在 `SKILL.md` 旁边放一份 `skill.config.json` 声明要什么、怎么生效,技能库面板会把它渲染成表单:
|
|
141
|
+
|
|
142
|
+
- **字段**:`string` / `secret` / `boolean` / `number` / `select`,可标 `required`、给默认值与说明;
|
|
143
|
+
- **生效步骤**:`command`(无 shell、按数组参数执行技能自带的 CLI,如 `editppt config …`)或 `file`(物化一份配置文件,`~` 展开、拒绝 `..` 逃逸与 DSH 主目录控制文件);
|
|
144
|
+
- **两个按钮**:「保存」只存值;「保存并应用」存完按顺序执行声明的步骤,并逐步回显结果;
|
|
145
|
+
- **密钥**:存进插件设置的 `role('secret')` 字典(脱敏存储),表单只显示「已设置 / 未设置」,命令回显里也会替换成 `•••`;密钥永不出现在运行目录、清单或提示词里;
|
|
146
|
+
- **节点菜单**:声明了必填字段却还没配的技能会显示「需要配置:…」和「去配置」,点开直接定位到该技能的表单;
|
|
147
|
+
- **已知技能配方**:`image-to-editable-ppt` 插件内置了一份配方(图片 API 密钥 / 地址 / 模型 + 可选 PaddleOCR token,走 `editppt config`),所以上游还没带声明时也能开箱配置;技能自带声明永远优先。
|
|
148
|
+
|
|
149
|
+
格式、边界与安全规则见 [`docs/skill-config.md`](docs/skill-config.md)。没声明配置的技能行为不变:面板只给通用提示,仍按它自己的文档 / 让 Agent 配置。
|
|
150
|
+
|
|
151
|
+
#### 相关设置
|
|
152
|
+
|
|
153
|
+
「设置 → 插件 → AI 生图」新增**无限画布技能**分组:
|
|
154
|
+
|
|
155
|
+
- **画布技能**:总开关,关闭后节点上不再出现技能菜单。
|
|
156
|
+
- **允许重任务技能**:关闭后只保留轻量技能(不会启动无头 Agent)。
|
|
157
|
+
- **技能白名单**:逗号或换行分隔的技能名;留空表示允许本机全部技能。
|
|
158
|
+
- **重任务工作目录**:无头 Agent 的工作目录,留空使用数据目录下的 `canvas/runs`。
|
|
159
|
+
- **重任务超时(分钟)**:超时自动取消(填 0 不超时)。
|
|
160
|
+
- **重任务 Agent 预设**:指定重任务使用的 Agent 预设名。
|
|
161
|
+
- **检测技能环境**:一键查看可用技能数量与无头 Agent 是否可用。
|
|
162
|
+
|
|
163
|
+
<a id="ecommerce"></a>
|
|
164
|
+
## 电商模式
|
|
165
|
+
|
|
166
|
+
顶部导航切换到「电商模式」,把一张商品图扩展成一套可发布的商品视觉:配置区分为「主图参考图」(商品主体 / 包装 / 细节,最多 4 张)与「风格参考图」(可选 1 张)两组,填入商品名称与参数信息,勾选套图结构(主图、卖点图、场景图、细节图、规格图、使用图)与每种用途的数量即可提交。
|
|
167
|
+
|
|
168
|
+
<div align="center">
|
|
169
|
+
<img src="docs/images/ecommerce-mode.png" alt="电商模式:主图参考图与风格参考图分组配置,结果主图居左、其他用途居右" width="100%" />
|
|
170
|
+
<p><sub>左侧分组配置(主图参考图 / 风格参考图 / 参数信息),结果区主图居左、其他用途居右</sub></p>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
- **锚定生成**:确认后先生成主图,其余图片自动以主图为参考生成,并在提示词中附加商品一致性约束,保证整套是同一个商品。
|
|
174
|
+
- **AI 帮写**:「参数信息」卡片右上角点「AI 帮写」,按商品名称与类目自动整理生图用的参数描述(走提示词增强通道);原来的参考信息 / 必须保留的特征 / 风格补充已合并到这一个输入。
|
|
175
|
+
- **先预览后生成**:点击「生成套图预览」只输出计划(各用途与数量),确认后才批量提交,不浪费额度。
|
|
176
|
+
- **商品一致性**:主图之外的图片默认跟随主图锚定;可在「参考图设置」中为每种用途单独指定参考图。
|
|
177
|
+
- **文案语言**:内置中文、英语、日语、韩语等 9 种常用语言预设,也支持自定义任意语言与地区写法(生成前自动校验),随套图草稿一并保存。
|
|
178
|
+
- **结果管理**:结果区主图居左大图展示,其余用途居右纵排;支持单张重新生成、下载、加入画廊或对话;一键导出 JSON 清单,记录每张图的提示词与参数,方便复现。
|
|
179
|
+
- **历史与恢复**:套图在历史记录中按项目折叠,跨会话点击即可恢复整组结果继续编辑。
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary><b>电商模式说明</b></summary>
|
|
183
|
+
|
|
184
|
+
- 电商模式目前为预览功能,入口带有「预览」角标;生成仍走已配置的生图渠道与任务队列,额度消耗与普通生成一致。
|
|
185
|
+
- 套图数量与结构可自由组合,规格图、使用图等用途默认关闭,点击卡片即可启用。
|
|
186
|
+
- 未上传商品图时主图会按文字描述生成并作为锚定基准,建议先上传清晰的主图获得更高一致性。
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
|
|
190
|
+
<a id="txt2img"></a>
|
|
191
|
+
## 文生图 / 图生图
|
|
192
|
+
|
|
193
|
+
点击“新会话 / 生图”中的“生图”Tab,工作区按“历史记录 | 生图区 | AI 对话”三栏排列:文生图一句提示词起步,图生图上传参考图精准改图;顶部导航可在普通生图、画廊、无限画布与电商模式之间切换。右侧对话面板默认收起,点击头部的「对话」按钮随时展开;参数栏宽度可拖拽调整并自动记忆。
|
|
194
|
+
|
|
195
|
+
<div align="center">
|
|
196
|
+
<img src="docs/images/image-generation-studio-four.png" alt="VisioWork 三栏工作台与多图结果布局" width="100%" />
|
|
197
|
+
<p><sub>历史记录 | 生图区 | AI 对话 三栏同屏,一次可生成多张,支持全屏缩放与翻页</sub></p>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
**生成参数与效率**
|
|
201
|
+
|
|
202
|
+
- **生成参数**:9 档比例(1:1 至 21:9)、4 档清晰度(自动/1K/2K/4K)、一次 1–4 张、细节等级透传。
|
|
203
|
+
- **任务队列**:生成由宿主进程排队执行,画布上方的任务托盘可随时取消,失败后一键重试,长任务不会卡住面板。
|
|
204
|
+
- **全屏预览**:滚轮或快捷键缩放(0.5–3x)、←/→ 前后翻页、复制提示词、下载、加入对话或画廊、一键作为下一次图生图的参考。
|
|
205
|
+
- **历史记录**:保留提示词、模型与参数(最近 50 条),支持关键词、模型、比例筛选,点击即可恢复参数。
|
|
206
|
+
- **图生图参考图**:支持本地上传或拖拽(≤10MB),也可从结果卡、全屏预览、历史和画廊一键转为参考图。
|
|
207
|
+
- **灵感案例**:空画布自动刷出一批随机模板卡片,点击即把完整提示词填入左侧,不满意点「随机」换一批。
|
|
208
|
+
|
|
209
|
+
<a id="workflow"></a>
|
|
210
|
+
### 连续编辑:加入对话 → 继续编辑
|
|
211
|
+
|
|
212
|
+
开启“允许 Agent 调用生图”后,从生成到修改都在 DSH 内完成:
|
|
213
|
+
|
|
214
|
+
| 步骤 | 在哪操作 | 发生什么 |
|
|
215
|
+
| --- | --- | --- |
|
|
216
|
+
| **生成** | 在对话里直接说,或在生图区输入提示词 | Agent 调用 `generate_image`,或工作台提交任务,由宿主排队执行 |
|
|
217
|
+
| **查看** | 工具结果旁 / 工作台画布 / 全屏预览 | 图片内联显示在对应位置,支持缩放、翻页、复制提示词 |
|
|
218
|
+
| **加入对话** | 结果卡或画廊点“加入对话” | 图片进入当前会话,自动适配附件限制,无需手动上传 |
|
|
219
|
+
| **继续编辑** | 对 Agent 说,或输入 `/edit_image …` | 以上一张成图为参考提交图生图,只需描述要改的地方 |
|
|
220
|
+
|
|
221
|
+
两种继续编辑的方式:
|
|
222
|
+
|
|
223
|
+
| | 直接对 Agent 说 | `/edit_image` 斜杠命令 |
|
|
224
|
+
| --- | --- | --- |
|
|
225
|
+
| 怎么用 | 在对话里描述修改要求,如“把背景改成夜景” | 输入 `/edit_image 把背景改成夜景` |
|
|
226
|
+
| 背后发生什么 | Agent 携带该图片的引用调用 `edit_image` 工具提交图生图 | 命令直接调用插件配置的图片模型 |
|
|
227
|
+
| 是否经过对话模型 | 是,可结合上下文理解模糊意图 | 否,对话模型不支持图片输入时同样可用 |
|
|
228
|
+
| 适合 | 需求复杂、需要 Agent 记住整体目标 | 快速、明确的一次性修改 |
|
|
229
|
+
|
|
230
|
+
两种方式都不必重新上传图片,也不必重新描述全部需求——第二轮只需要说变化。
|
|
231
|
+
|
|
232
|
+
<details>
|
|
233
|
+
<summary><b>可直接使用的案例提示词</b></summary>
|
|
234
|
+
|
|
235
|
+
第一轮,让 Agent 生成一张项目海报:
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
帮我为 dsh-imagegen 设计一张 16:9 横版项目海报。深色未来感背景,青蓝和紫色霓虹光效;画面中心展示 AI 生图工作台,包含赛博城市、人物肖像、雪山和抽象流体四张示例图;下方展示 Agent 对话生图、多模型对比和画廊三个能力区。整体干净、专业、有产品发布感,不要杂乱的小字。
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
第二轮,基于刚才的成图继续修改:
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
保留当前海报的整体构图和深色科技风。把中心的赛博城市替换成更明亮的夜景,增强青蓝与紫色的边缘光;底部“Agent 对话生图”区域更突出,其他两项保持弱一级。不要重新生成一张完全不同的海报。
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Agent 会把上一轮图片作为参考图提交图生图任务,因此第二轮只需要描述变化。
|
|
248
|
+
|
|
249
|
+
</details>
|
|
250
|
+
|
|
251
|
+
<details>
|
|
252
|
+
<summary><b>Agent 生图工具参考</b></summary>
|
|
253
|
+
|
|
254
|
+
| 工具 | 用途 |
|
|
255
|
+
| --- | --- |
|
|
256
|
+
| `generate_image` | 提交文生图任务;完成后在工具结果旁显示图片,并返回可继续编辑的图片引用。传 `wait_for_completion: false` 可改为后台模式,稍后用 `get_image_generation_task` 查询。等待上限 300 秒,超时自动取消。 |
|
|
257
|
+
| `edit_image` | 以已有图片为参考提交图生图任务;引用需原样传入之前工具返回的图片对象。 |
|
|
258
|
+
| `get_image_generation_task` | 查询任务状态;完成时显示图片并返回下一步编辑所需的引用。 |
|
|
259
|
+
| `cancel_image_generation_task` | 取消排队中或正在执行的任务。 |
|
|
260
|
+
|
|
261
|
+
> 配置了多个生图模型时,Agent 会先询问你想用哪个,而不是擅自选择;未配置 API 地址、密钥或模型时,会明确引导到“设置 → 插件 → VisioWork”,不会静默失败。
|
|
262
|
+
|
|
263
|
+
</details>
|
|
264
|
+
|
|
265
|
+
<a id="compare"></a>
|
|
266
|
+
### 多模型并列对比
|
|
267
|
+
|
|
268
|
+
同一个提示词在不同模型上往往呈现完全不同的构图、质感与文字处理。打开“多模型对比”,勾选多个已配置模型,插件会以相同参数提交任务,并在画布和全屏预览中并列展示,方便挑出真正适合当前任务的模型。
|
|
269
|
+
|
|
270
|
+
<div align="center">
|
|
271
|
+
<img src="docs/images/multi-model-comparison.png" alt="gpt-image-2、grok-imagine-image 与 doubao-seedream 的三模型并列结果对比" width="100%" />
|
|
272
|
+
<p><sub>同一提示词在三个模型下的并列结果,画布与全屏预览均支持对比视图</sub></p>
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<details>
|
|
276
|
+
<summary><b>对比相关的细节</b></summary>
|
|
277
|
+
|
|
278
|
+
- 画布显示每个任务的进度与用时,可进入全屏并列对比。
|
|
279
|
+
- 对比生成的多条历史在历史记录中自动折叠为一组(显示模型列表与总图数),点“恢复”会连同对比模型选择一起回填,也可整组删除。
|
|
280
|
+
- 对比任务在宿主队列中并行执行,与普通任务共用同一条队列,取消、重试、历史语义一致。
|
|
281
|
+
|
|
282
|
+
</details>
|
|
283
|
+
|
|
284
|
+
<a id="enhance"></a>
|
|
285
|
+
### 提示词增强
|
|
286
|
+
|
|
287
|
+
只有一句“画只猫”也想出好图:点击增强按钮,插件会把简短想法发给一个对话模型扩写成结构完整的生图提示词,再提交生成;增强模型可复用生图 API 凭据。未配置增强模型时会弹窗引导,并自动打开设置页的对应卡片。
|
|
288
|
+
|
|
289
|
+
<a id="templates"></a>
|
|
290
|
+
### 模板库
|
|
291
|
+
|
|
292
|
+
随插件内置两个来源共 980 余条 `gpt-image-2` 提示词案例(含参考图),没有灵感时可以先看看别人怎么写。
|
|
293
|
+
|
|
294
|
+
<div align="center">
|
|
295
|
+
<img src="docs/images/prompt-template-library.png" alt="提示词模板库:多来源标签页、分类筛选与案例卡片" width="100%" />
|
|
296
|
+
<p><sub>多来源标签页独立切换,案例详情含参考图、作者署名与原链,可一键回填</sub></p>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
- 多来源标签页:「精选案例库」(vibeui.top 镜像)与「沧河案例库」(gpt-image2.canghe.ai)相互独立,后续会接入更多来源。
|
|
300
|
+
- 案例详情包含参考图、作者署名与原链,可复制或一键回填到生图输入框;收藏持久化在本机,「★ 收藏」筛选随时回看。
|
|
301
|
+
- 支持按来源“刷新本库”在线更新,宿主每 12 小时自动同步一次;“缓存全部图片”后离线也能浏览。
|
|
302
|
+
|
|
303
|
+
<a id="gallery"></a>
|
|
304
|
+
## 画廊
|
|
305
|
+
|
|
306
|
+
满意的图片可从结果卡、全屏预览或历史记录一键加入画廊;画廊中的图片也能直接加入当前对话,再用 `/edit_image` 修改。画廊为持续积累作品设计:左侧筛选,右侧瀑布流或整齐网格,点击任意图片即可打开大图预览。
|
|
307
|
+
|
|
308
|
+
<div align="center">
|
|
309
|
+
<img src="docs/images/gallery-workspace.png" alt="画廊工作区:分类筛选、瀑布流和大图预览" width="100%" />
|
|
310
|
+
<p><sub>左侧分类筛选带计数,右侧瀑布流 / 网格可切换</sub></p>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
- 关键词搜索;按生成模式、模型、比例和自建标签过滤,分类侧栏带数量统计。
|
|
314
|
+
- 瀑布流 / 整齐网格两种视图,支持最新、最早排序。
|
|
315
|
+
- 标签可新建、编辑、删除;多选图片后可批量打标签、批量下载,或导出 JSON 元数据作为备份。
|
|
316
|
+
- 收藏由 DSH 宿主持久化保存,跨同一宿主的浏览器/设备可见;同一图片内容按哈希去重,不会重复加入。
|
|
317
|
+
|
|
318
|
+
<a id="configuration"></a>
|
|
319
|
+
## 配置模型
|
|
320
|
+
|
|
321
|
+
打开 DSH 的“设置 → 插件”,展开 **VisioWork(dsh-imagegen)**。每个提供方都有独立的 API 地址、密钥和模型目录,可同时配置多个服务;预置了 OpenAI、智谱、xAI、字节火山方舟(Seedream)、阿里云百炼(Qwen-Image)、MiniMax(image-01)等常用渠道,也可添加任意自定义 OpenAI 兼容渠道。
|
|
322
|
+
|
|
323
|
+
<div align="center">
|
|
324
|
+
<img src="docs/images/plugin-settings.png" alt="DSH 设置页中的 VisioWork 插件配置" width="72%" />
|
|
325
|
+
<p><sub>设置 → 插件 → VisioWork(dsh-imagegen)</sub></p>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
| 配置项 | 说明 |
|
|
329
|
+
| --- | --- |
|
|
330
|
+
| 提供方 | 预置提供方可直接选择,也可添加自定义渠道。 |
|
|
331
|
+
| API 地址 | OpenAI 兼容接口根地址,例如 `https://api.openai.com/v1`,插件会自动追加图像接口路径。 |
|
|
332
|
+
| API 密钥 | 每个提供方单独配置;密钥仅保存在 DSH 宿主侧,浏览器与 Agent 都拿不到明文。 |
|
|
333
|
+
| 模型目录 | 保存地址和密钥后点击“检测可用模型”,插件会过滤聊天、Embedding 等非图片模型;没有 `/models` 的网关可手动添加并设置别名。 |
|
|
334
|
+
| 提示词增强模型 | 可选。选择一个支持 `/chat/completions` 的模型,通常可复用生图 API 凭据;电商模式的「AI 帮写」也使用它。 |
|
|
335
|
+
| 本地图片存储目录 | 可在设置中指定历史记录、素材库和无限画布图片的本地根目录;留空使用 `~/.dsh/dsh-imagegen`。修改后新图片写入新目录,已有数据不会被删除。 |
|
|
336
|
+
| 允许 Agent 调用生图 | 默认开启。关闭后 Agent 不能提交、查询和取消任务,侧边栏工作台不受影响。 |
|
|
337
|
+
|
|
338
|
+
**关于“检测可用模型”**
|
|
339
|
+
|
|
340
|
+
- 优先读取上游返回的能力字段,并结合命名启发式(image / flux / seedream / nanobanana / kolors…)过滤非图片模型,但仍建议只勾选你的上游实际支持生图的模型。
|
|
341
|
+
- 支持用尚未保存的地址和密钥先探测、确认可用后再保存。
|
|
342
|
+
- 未被识别的 OpenAI 兼容图片模型仍可手动加入清单,按通用协议尝试调用。
|
|
343
|
+
|
|
344
|
+
<details>
|
|
345
|
+
<summary><b>已适配的接口与模型家族</b></summary>
|
|
346
|
+
|
|
347
|
+
- **OpenAI 兼容接口**:支持 `/images/generations`、`/images/edits` 和 `{ data: [{ b64_json | url }] }` 格式响应。
|
|
348
|
+
- **异步两步式接口(apimart.ai / apib.ai 等)**:OpenAI 兼容渠道的 `/images/generations` 若返回 `{ data: [{ status, task_id }] }` 提交结果,插件会自动轮询 `GET /v1/tasks/{task_id}`(指数退避,最长 240 秒)直到完成,自动展开 `url` 数组并下载成图;兼容 submitted / pending / processing 与 completed / succeeded 等常见状态词,上游失败原因原样透传,取消任务会同步中断轮询。无需专用预设,任意 OpenAI 兼容渠道自动生效。
|
|
349
|
+
- **Grok Imagine**:原生支持 `grok-imagine-image` 与 `grok-imagine-image-2.0`(地址 `https://api.x.ai/v1`),图生图使用其 JSON `image_url` 协议,比例和清晰度映射为 `aspect_ratio` 与 `resolution`。
|
|
350
|
+
- **Nano Banana(谷歌 Gemini 图像系列)**:内置 `nanobanana2` / `nanobanana2-lite` / `nanobanana-pro`(也识别官方 `gemini-3.x-image*` ID),清晰度映射为 `image_size`(1K/2K/4K)。
|
|
351
|
+
- **Seedream(字节跳动生图系列)**:内置 `seedream-5.0-pro`(也识别 `seedream-4.x`、`doubao-seedream-…`),文生图与图生图统一走 `/images/generations`,参考图以 JSON `image` 数组发送。
|
|
352
|
+
- **Qwen-Image(通义千问)**:内置阿里云百炼渠道,使用 `https://dashscope.aliyuncs.com/api/v1` 的 DashScope 原生 `multimodal-generation` 接口(不是 OpenAI 兼容接口),支持 Qwen-Image 2.0 / 3.0 系列文生图与图像编辑,比例自动映射为 `宽*高` 尺寸。该渠道不能复用于提示词增强。
|
|
353
|
+
- **智谱 GLM-Image**:内置 `glm-image`,文生图质量参数映射为 `hd`;当前不支持图生图,选择编辑模型时会被自动排除。
|
|
354
|
+
- **MiniMax image-01**:内置 MiniMax 官方渠道,使用 `https://api.minimax.io/v1`(国内站 `https://api.minimaxi.com/v1`)的原生 `/image_generation` 接口(不是 OpenAI 兼容接口)。支持 `1:1 / 16:9 / 4:3 / 3:2 / 2:3 / 3:4 / 9:16 / 21:9` 宽高比,一次最多 9 张,图生图以单张参考图作为 `subject_reference`(人物/主体参考)发送——它是主体一致性参考而非像素级编辑,适合“同一人物换场景”,不适合局部修图。MiniMax 的 `/models` 只列出聊天模型,请直接使用预填的模型目录。
|
|
355
|
+
- **后续模型**:未被识别的 OpenAI 兼容图片模型可手动添加;厂商专属鉴权或请求协议需要单独适配。
|
|
356
|
+
|
|
357
|
+
</details>
|
|
358
|
+
|
|
359
|
+
<a id="security"></a>
|
|
360
|
+
## 数据与安全
|
|
361
|
+
|
|
362
|
+
- API 请求由 DSH 宿主进程代理,浏览器不直接连接上游:没有 CORS 问题,密钥不会出现在前端;宿主路由仅监听本机回环地址并校验同源请求。
|
|
363
|
+
- 密钥保存于本机 DSH 设置中,设置页面仅展示“已配置”状态。
|
|
364
|
+
- 历史、画廊和图片数据保存在宿主的 `~/.dsh/dsh-imagegen/`,由你控制;画廊图片按内容去重,模板展示图经宿主同源代理按需拉取与缓存,文件访问有严格白名单。
|
|
365
|
+
- 画布文件节点上传的文件(≤50MB)以内容寻址保存在同一数据目录,脚本与可执行扩展名被拒绝;预览只在宿主侧解码(文本 / 表格 / 文档正文 / 压缩包目录),只有图片、PDF、音频、视频会在显式 `inline` 请求下以内联响应返回,且响应带 `X-Content-Type-Options: nosniff`,其余资源一律以下载方式返回。
|
|
366
|
+
- 运行技能会把所选节点的内容(文本、图片或文件)发送到「提示词增强」所配置的聊天模型;重任务技能会启动一个拥有本机文件读写与命令执行能力的无头 Agent,并把你选择的技能正文注入它的上下文。请在运行前确认节点内容不敏感、且已了解该技能会做什么。
|
|
367
|
+
- `image-to-editable-ppt` 之类的第三方技能由其自身文档决定外部依赖(OCR Token、图片后端等),这些凭据由该技能管理,本插件不读取也不上传它们。
|
|
368
|
+
- 图生图会把参考图发送到当前渠道的上游 API,请确认渠道服务商的数据处理政策,不要上传敏感图片。
|
|
369
|
+
- 生图会消耗上游 API 额度。图片内容由上游模型生成,可能出现不准确、不适宜或不符合预期的结果,请在使用前人工检查。
|
|
370
|
+
- API 密钥属于敏感信息,请不要提交到 GitHub Issue、日志、截图或 README;发现密钥泄露时应立即在上游服务商处轮换。
|
|
371
|
+
|
|
372
|
+
<a id="community"></a>
|
|
373
|
+
## 社区与支持
|
|
374
|
+
|
|
375
|
+
欢迎加入 QQ 群,一起交流 DSH、AI 生图和插件使用体验,也欢迎分享提示词、工作流与改进建议。
|
|
376
|
+
|
|
377
|
+
<p align="center">
|
|
378
|
+
<img src="docs/images/community-qq.png" alt="扫码加入 dsh-imagegen QQ 交流群" width="360" />
|
|
379
|
+
</p>
|
|
380
|
+
|
|
381
|
+
- 发现问题请提交 [Bug 报告](https://github.com/dale0525/dsh-plugins/issues),附带插件版本、DSH 版本和复现步骤。请勿粘贴 API 密钥。
|
|
382
|
+
- 有改进想法请提交 [功能建议](https://github.com/dale0525/dsh-plugins/issues)。
|
|
383
|
+
- 查看全部 [Release](https://github.com/dale0525/dsh-plugins/releases) 和 [Issue](https://github.com/dale0525/dsh-plugins/issues)。
|
|
384
|
+
- 如果这个插件对你有帮助,欢迎 Star。
|
|
385
|
+
|
|
386
|
+
<details>
|
|
387
|
+
<summary><b>本地开发</b></summary>
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
pnpm run typecheck
|
|
391
|
+
pnpm run build
|
|
392
|
+
pnpm run watch
|
|
393
|
+
node scripts/smoke.mjs
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
改完源码后要装进本机 GUI 验收,打一个本地 tgz 再覆盖安装即可(面板不会热更新宿主半,装完重启 `dsh web`):
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
pnpm pack --pack-destination . # 生成 logictan-dsh-imagegen-<版本>.tgz
|
|
400
|
+
dsh plugin --profile web add ./logictan-dsh-imagegen-<版本>.tgz
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
</details>
|
|
404
|
+
|
|
405
|
+
## 许可证
|
|
406
|
+
|
|
407
|
+
[Apache-2.0](./LICENSE)
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dsh-imagegen bundle patch: inserts the plugin row into the web profile
|
|
2
|
+
# roster. The row is a bare plugin by package name: the node half (exports ".")
|
|
3
|
+
# runs in the host process (settings bridge + image-generation proxy routes),
|
|
4
|
+
# and the `dsh.client` declaration in package.json makes the browser half
|
|
5
|
+
# (exports "./client", served at /plugins/<id>/client.js) load in the web GUI.
|
|
6
|
+
#
|
|
7
|
+
# Row id stays `imagegen`: it equals the host half's `export const name` in
|
|
8
|
+
# src/index.ts, and the browser half keys its configuration entry on
|
|
9
|
+
# `<bundle package name>#imagegen` for this same id.
|
|
10
|
+
- insert:
|
|
11
|
+
- id: imagegen
|
|
12
|
+
name: '@logictan/dsh-imagegen'
|