dsh-image-gen
已验证@bytehivex/dsh-image-gen · v1.0.0 · Web 界面
OpenAI-compatible image generation plugin for DeepSeek Harness.
安装
dsh plugin add @bytehivex/dsh-image-gen 用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。
源码
发布到 npm 但没有公开仓库。安装前请检查包内容。
标签
作者
说明文档
@bytehivex/dsh-image-gen 1.0.0
为 DeepSeek Harness Web profile 提供 OpenAI 兼容生图工具 generate_image 和“设置 → 插件 → 图像生成”配置卡。
功能
- 调用 OpenAI 兼容的
POST /images/generations接口。 - 在设置界面配置 API Key、接口地址、默认模型、默认尺寸和图片保存位置。
- 展开设置卡时自动读取接口模型列表。
- API Key 通过 DSH credentials 保存,不写入
settings.yaml或本安装包。 - 图片同时保存为 DSH durable attachment 和本地 PNG 文件。
- 默认本地目录为当前会话项目根目录下的
generated_images。 - 支持相对目录和绝对目录;相对目录按每个 DSH 会话的项目根目录解析。
安装包内容
dsh-image-gen/
├── lib/
│ ├── index.js # Host 插件、配置 API、generate_image 工具和文件保存逻辑
│ └── client.js # Web 设置卡
├── cordis.patch.yml # 安装后自动激活 genimg 条目
├── package.json # DSH bundle 与 client manifest
└── README.md
本包不包含 API Key、接口地址、模型选择、历史图片、settings.yaml 或 .credentials.yaml。
环境要求
- Node.js
^22.19.0或>=24.0.0。 - 可运行的
@deepseek-ai/dsh。 pnpm已加入 PATH;dsh plugin会将参数转交给 pnpm。- 安装目标为带 Web 设置界面的
webprofile。
从 npm 安装(发布后推荐)
插件发布到 npm 后,在 PowerShell 中执行:
npx @deepseek-ai/dsh plugin --profile web add "@bytehivex/dsh-image-gen"
npx @deepseek-ai/dsh web
从 TGZ 安装
先停止正在运行的 DSH Web,把 TGZ 下载到任意目录,然后在该目录打开 PowerShell 并执行:
npx @deepseek-ai/dsh plugin --profile web add ".\bytehivex-dsh-image-gen-1.0.0.tgz"
npx @deepseek-ai/dsh web
这里使用相对于当前 PowerShell 目录的路径,因此不依赖打包者或接收者的用户名、盘符和文件夹结构。如果 TGZ 不在当前目录,请换成接收者机器上的实际路径。
安装命令会完成以下工作:
- 将
@bytehivex/dsh-image-gen加入webprofile 的依赖。 - 识别 package manifest 中的
dsh.bundle.patch。 - 自动把
cordis.patch.yml作为 profile 组合层启用。 - 让 Host 插件和 Web client bundle 一起加载。
不要手工覆盖现有 profile 的 cordis.patch.yml,其中可能还有其他用户配置。
已有手工安装版本时
如果目标机器已经存在以下任一内容,不要直接叠加安装 TGZ:
$DSH_HOME/profiles/web/plugins/dsh-image-gen手工插件目录;$DSH_HOME/profiles/node_modules/@bytehivex/dsh-image-gen手工 junction;- profile
cordis.patch.yml中手工插入的id: genimg条目。
这些内容与 TGZ 自带的 bundle patch 同时存在时,可能产生重复 genimg 条目。应先停止 DSH Web,备份现有插件和 profile patch,移除手工装配,再执行 TGZ 安装。不要直接覆盖整个 cordis.patch.yml。若文件中还有其他插件或用户 patch,只移除属于 genimg 的那一项。
安装后配置
- 打开 DSH Web。
- 进入“设置 → 插件 → 图像生成”。
- 填写 API Key。留空保存不会清除现有密钥。
- 填写 OpenAI 兼容接口地址。
- 刷新并选择默认模型。
- 选择默认尺寸。
- 保持
generated_images,或填写其他相对/绝对保存目录。 - 点击“保存”。
API Key 请在目标机器本地填写,不要写入安装命令、聊天记录或安装包。
验证
启动成功时终端会显示:
dsh web: http://127.0.0.1:3080
可进一步检查安装依赖:
npx @deepseek-ai/dsh plugin --profile web why "@bytehivex/dsh-image-gen"
再打开设置页确认“图像生成”卡片存在。首次真实生图会产生外部 API 请求和相应费用;验证前请确认接口与计费策略。
更新
先停止 DSH Web,然后移除旧包并安装新的 TGZ:
npx @deepseek-ai/dsh plugin --profile web remove "@bytehivex/dsh-image-gen"
npx @deepseek-ai/dsh plugin --profile web add ".\<新版本TGZ文件名>"
npx @deepseek-ai/dsh web
插件配置和 API Key 位于 DSH settings/credentials 中,不在 npm 包目录内;移除插件包通常不会主动删除它们。更新后仍应在设置页复核。
卸载
npx @deepseek-ai/dsh plugin --profile web remove "@bytehivex/dsh-image-gen"
卸载后重启 DSH Web。若不再使用对应 API Key,请在目标机器的 DSH credentials 管理界面或文件中单独停用;不要仅依赖卸载插件清理凭据。
ZIP 的用途
ZIP 用于审阅源码、解压留档或从目录安装。在解压后的插件根目录打开 PowerShell,可以执行:
npx @deepseek-ai/dsh plugin --profile web add "."
npx @deepseek-ai/dsh web
分发给普通用户时仍优先使用 npm 包名或 .tgz,因为安装来源和版本更明确,dsh plugin add 也能自动维护 profile 依赖和 bundle 层。