DeepSeek Harness 插件

whiteS18/dsh-image-generation

Star 数 ★ 0 下载量(近 30 天) 156 分类 视觉与多模态 收录于 2026-09-11 npm dsh-image-generation

在设置中配置多个生图供应商,对话通过 image_generate 调用当前选中的模型;图片保存到工作区 generate/image,并在对话中内联显示。

安装

# npm 包(预构建)

dsh plugin --profile web add dsh-image-generation

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:whiteS18/dsh-image-generation

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWEDERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yamlallowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

DeepSeek Harness 生图插件:在设置里配置多个生图供应商 / 模型,对话里通过 image_generate 调用当前选中的那一个模型。

结合了官方 @deepseek-ai/dsh-tool-image-generation(对话生图工具)和 dsh-plugin-subscriptions(设置页可配置)的思路,面向 API Key + Base URL 的网关,而不是订阅登录。

功能

  • 设置 → 生图配置(左侧导航):添加多个供应商。每个供应商有名称、Base URL、API 格式、API Key,以及一组生图模型。保存后写入 settings.yamlimage-gen 段,密钥走凭据服务,不进设置文件。
  • 设置 → 插件 → 插件配置 → 图形生成:从上面配置过的模型里只选一个作为对话生图模型,可开关工具、设置默认尺寸 / 质量。
  • 对话工具 image_generate:Agent 需要出图时调用当前选中的模型;图片写到工作区 generate/image/,并在对话里内联显示,点击可放大。

API 格式

按模型 / 网关选择,不要用聊天用的 Anthropic Messages:

格式 适用 请求
OpenAI Images (/v1/images/generations) gpt-image-2gpt-image-1、DALL·E,以及兼容 OpenAI Images 的网关 POST {base}/images/generationsresponse_format: b64_json
xAI Images (/v1/images/generations) grok-imagine-image-2.0 同上路径,但用 aspect_ratio
Gemini / Imagen gemini-*-imageimagen-* {base}/models/{id}:generateContent:predict
OpenAI Chat Completions 在 chat 响应里返回图片的聚合网关 POST {base}/chat/completions

Base URL 填到 /v1(或 Gemini 的 /v1beta)这一层,插件会补上后面的路径。例如:

  • OpenAI:https://api.openai.com/v1
  • xAI:https://api.x.ai/v1
  • Gemini 官方:https://generativelanguage.googleapis.com/v1beta
  • 本地网关:http://127.0.0.1:8317/v1

安装

npm:

dsh plugin --profile <name> add dsh-image-generation

GitHub:

dsh plugin --profile <name> add github:whiteS18/dsh-image-generation

本地检出:

dsh plugin --profile <name> add /绝对路径/dsh-image-gen

[!IMPORTANT] DSH 在进程启动时组合插件。先启动再安装时,必须完全退出并重新打开 DSH(不是刷新页面)。

装完后可用:

dsh --profile <name> --dump-config | grep image-gen

使用

  1. 打开 设置 → 生图配置,添加供应商和模型,填 Base URL / API 格式 / API Key,点保存。
  2. 打开 设置 → 插件 → 插件配置,展开 图形生成,选择刚才配置的某一个模型并保存。
  3. 在对话里让 Agent 生图,它会调用 image_generate

可选参数:prompt(必填)、size1024x1024 / 1024x1536 / 1536x1024 / auto)、qualitylow / medium / high / auto)、referenceImages(1–5 张已有图片引用,用于编辑;本地文件先 read_image)。

与现有插件的关系

  • 官方 @deepseek-ai/dsh-tool-image-generation 只有工具、没有设置页;本插件自带设置页,一般不必再装官方包。
  • npm 上另有同名风格的 dsh-image-gen(其他作者)。本包发布名为 dsh-image-generation,避免抢名。
  • dsh-plugin-subscriptions 走的是 ChatGPT / Grok 订阅登录,也会注册名为 image_generate 的工具。两边同时安装可能抢同一个工具名。需要 API 网关生图时用本插件;需要订阅生图时用 subscriptions。

卸载

dsh plugin --profile <name> remove dsh-image-generation

English

Image-generation plugin for DeepSeek Harness. Configure providers and models under Settings → Image generation, pick exactly one model under Settings → Plugins → Plugin configuration → Image generation, then conversations call image_generate with that model.

Install:

dsh plugin --profile <name> add dsh-image-generation

API keys are stored through the credentials service. Generated files land in generate/image/ of the session workspace and are shown inline in the conversation.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。