Bald0Wang/dsh-imggenerate

插件Plugin 原生Native ⭐ 4 工具Tools视觉Visual

DeepSeek Harness插件:image_generate工具,支持qwen-image-3.0(阿里云MaaS)和doubao-seedream(火山方舟)提供商

项目介绍Project Overview

dsh-image-gen 是 DeepSeek Harness 的图片生成插件,为 agent 注册 image_generate 工具,使其可在会话中直接生成图像。支持火山方舟(doubao-seedream,1K/2K/4K、文生图与图生图、水印控制)和阿里 MaaS(qwen-image,含 promptExtend 扩写)双通道。适用场景:让模型按提示词出图、做配图或参考图创作。纯 JavaScript,免构建。需自行配置 ARK_API_KEY 或 DASHSCOPE_API_KEY;返回的供应商 URL 一般 24 小时过期,应及时下载。

dsh-image-gen is a DeepSeek Harness plugin that registers an image_generate tool, letting agents produce images directly inside a session. It supports two providers: Volcano Ark (doubao-seedream, text-to-image and image-to-image with referenceImage, sizes 1K/2K/4K, watermark control) and Alibaba MaaS (qwen-image with promptExtend). Use it when the model needs to illustrate prompts, create visuals, or work from a reference photo. The plugin is pure JavaScript with no build step. You must supply ARK_API_KEY or DASHSCOPE_API_KEY yourself. Vendor image URLs typically expire within 24 hours, so download results promptly.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile demo add dsh-image-gen

Bald0Wang/dsh-imggenerate 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-image-gen

dsh-plugin

DeepSeek Harness 图片生成插件:给 agent 注册一个 image_generate 工具,让 dsh 里的大模型可以直接画图。

双通道支持:

Provider 模型 能力
volcano(火山方舟,默认) doubao-seedream-5-0-pro-260628 文生图、图生图(referenceImage)、size 1K/2K/4K 或 WxH、水印开关
qwen(阿里 MaaS) qwen-image-3.0-pro 文生图、promptExtend 提示词扩写

纯 JavaScript、零构建步骤,安装时无需 pnpm 构建授权。

安装

方式一:装进 profile(推荐)

dsh plugin --profile demo add github:Bald0Wang/dsh-imggenerate
dsh --profile demo

或从本地目录 / npm / tarball 安装:

dsh plugin --profile demo add ./dsh-image-gen        # 本地目录
dsh plugin --profile demo add dsh-image-gen          # npm(如已发布)
dsh plugin --profile demo add ./dsh-image-gen-0.1.0.tgz

方式二:不安装,直接 overlay

git clone https://github.com/Bald0Wang/dsh-imggenerate.git
cd dsh-imggenerate && npm install
cp quick.example.cordis.yml quick.cordis.yml   # 填入你的 key 与绝对路径
npx @deepseek-ai/dsh web --patch "$PWD/quick.cordis.yml"

配置 API Key(必做)

插件不携带任何密钥。二选一:

A. profile 用户层(推荐) — 编辑 $DSH_HOME/profiles/<name>/cordis.patch.ymldsh web 对应 web profile),覆盖 image-gen 行(用户层在包层之后生效,需重述整个 config):

- id: image-gen
  config:
    defaultProvider: volcano
    qwenApiKey: 'sk-ws-...'
    volcanoApiKey: 'your-ark-key'

B. 环境变量DASHSCOPE_API_KEY(qwen 通道)、ARK_API_KEY(volcano 通道)。显式 config 优先于环境变量。

配置项(cordis.yml 中 config 下覆盖)

默认值 说明
defaultProvider volcano 未指定 provider 参数时使用
timeoutMs 180000 单次请求超时
qwenEndpoint / qwenModel / qwenApiKey 见 index.js 阿里 MaaS 通道
volcanoEndpoint / volcanoModel / volcanoApiKey 见 index.js 火山方舟通道
volcanoSize / volcanoWatermark 2K / true 火山默认尺寸与水印

工具参数(模型侧)

prompt(必填)、provider(qwen/volcano)、sizereferenceImage(仅火山,图生图)、watermark(仅火山)、promptExtend(仅 qwen)、seed

返回规范输出 {provider, model, images:[{url}], size?, watermark?};工具结果以文本块携带 URL(供应商 URL 一般 24 小时过期,需及时下载)。

验证安装

启动日志应出现 [image-gen] registered image_generate tool;新开会话对模型说「用 image_generate 画一张……」。也可用 dsh --profile <name> --dump-config 查看是否包含 # == dsh-image-gen 层。

上一个 Prev dsh-doctor 下一个 Next dsh-companion