Configure multiple image providers in Settings and call image_generate with the one selected model; images save under generate/image and show inline in the conversation.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-image-generation
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:whiteS18/dsh-image-generation
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DeepSeek Harness 生图插件:在设置里配置多个生图供应商 / 模型,对话里通过 image_generate 调用当前选中的那一个模型。
结合了官方 @deepseek-ai/dsh-tool-image-generation(对话生图工具)和 dsh-plugin-subscriptions(设置页可配置)的思路,面向 API Key + Base URL 的网关,而不是订阅登录。
功能
- 设置 → 生图配置(左侧导航):添加多个供应商。每个供应商有名称、Base URL、API 格式、API Key,以及一组生图模型。配置存在 profile 的
image-gen插件条目里(DSH ≥ 0.1.6 为 volatile 字段、保存即热生效;≤ 0.1.5 写入settings.yaml的image-gen段),密钥走凭据服务,不进设置文件。 - 设置 → 插件 → 本插件详情 → 图形生成(≤ 0.1.5 为 设置 → 插件 → 插件配置):从上面配置过的模型里只选一个作为对话生图模型,可开关工具、设置默认尺寸 / 质量。
- 对话工具
image_generate:Agent 需要出图时调用当前选中的模型;图片写到工作区generate/image/,并在对话里内联显示(240px 缩略图 + Lightbox 全屏预览)。 - 图像编辑:4 种 API 格式全部支持
referenceImages(1–5 张参考图)。OpenAI / xAI 格式自动切换到/images/edits端点;Gemini / chat 格式把参考图一并放进请求。 - 中英双语界面,无构建步骤,要求 Node >= 22.19。
API 格式
按模型 / 网关选择,不要用聊天用的 Anthropic Messages:
| 格式 | 适用 | 请求 |
|---|---|---|
OpenAI Images (/v1/images/generations) |
gpt-image-2、gpt-image-1、DALL·E,以及兼容 OpenAI Images 的网关 |
POST {base}/images/generations(编辑走 /images/edits),response_format: b64_json;网关拒绝该参数时自动去掉重试一次 |
xAI Images (/v1/images/generations) |
grok-imagine-image-2.0 |
同上路径,但用 aspect_ratio;quality 按 xAI 能力映射(high→medium,auto 不下发) |
| Gemini / Imagen | gemini-*-image、imagen-* |
按模型名自动分流:imagen-* 走 :predict,其余走 :generateContent;官方 host 自动换 x-goog-api-key 头 |
| 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
API Key 通过凭据服务存储,环境变量名按 IMAGE_GEN_<供应商ID大写>_API_KEY 规则引用,不会写进设置文件。
安装
npm:
dsh plugin --profile <name> add dsh-image-generation
[!WARNING]
0.1.0的__ModuleLoader__id 仍是dsh-image-gen,DSH 会按包名dsh-image-generation校验并拒绝启动。请安装0.1.1或更新版本(当前0.1.2)。已装0.1.0的 profile:dsh plugin --profile <name> add dsh-image-generation@0.1.1然后完全退出并重新打开 DSH。
GitHub:
dsh plugin --profile <name> add github:whiteS18/dsh-image-generation
本地检出:
dsh plugin --profile <name> add /绝对路径/dsh-image-generation
[!IMPORTANT] DSH 在进程启动时组合插件。先启动再安装时,必须完全退出并重新打开 DSH(不是刷新页面)。
装完后可用:
dsh --profile <name> --dump-config | grep image-gen
使用
- 打开 设置 → 生图配置,添加供应商和模型,填 Base URL / API 格式 / API Key,点保存。
- 打开 设置 → 插件 → 插件配置,展开 图形生成,选择刚才配置的某一个模型并保存。
- 在对话里让 Agent 生图,它会调用
image_generate。
可选参数:prompt(必填)、size(1024x1024 / 1024x1536 / 1536x1024 / auto)、quality(low / medium / high / auto)、referenceImages(1–5 张已有图片引用,用于编辑;本地文件先 read_image)。
配置项默认值
| 配置项 | 默认值 | 说明 |
|---|---|---|
enabled |
true |
是否启用 image_generate 工具(关闭时工具仍注册,调用会被拒绝) |
providerId / modelId |
空 | 当前选中的生图供应商与模型 |
defaultSize |
1024x1024 |
工具未显式传 size 时的默认尺寸 |
defaultQuality |
auto |
工具未显式传 quality 时的默认质量 |
apiFormat(供应商级) |
openai-images |
新建供应商时的默认 API 格式 |
与现有插件的关系
- 官方
@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 on the plugin detail page (Settings → Plugins → this plugin → Image generation; on DSH ≤ 0.1.5: Settings → Plugins → Plugin configuration), then conversations call image_generate with that model.
All four API formats (OpenAI Images, xAI Images, Gemini/Imagen, OpenAI chat-completions gateways) support image editing via referenceImages (1–5 images). 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. Chinese and English UI. Requires Node >= 22.19.
Install:
dsh plugin --profile <name> add dsh-image-generation
0.1.0 registered the client as dsh-image-gen and DSH refused to boot. Use 0.1.1 or later (dsh plugin --profile <name> add dsh-image-generation@0.1.1), then fully quit and reopen DSH.
Links
More in this category
liustack/modlens★ 4543
Vision bridge for text-only models: paste an image, get structured JSON evidence (OCR, layout, semantics).
ysr666/dsh-vision-router★ 1187
Free vision for text-only agents: built-in keyless vision chain plus pixel tools (Q&A, grounding, crop, pixel diff, colors, OCR, SVG trace, cutout, screenshots); paste an image to use it.
Anionex/dsh-vision-toolkit★ 908
Vision for text-only models: paste an image and the model switches to a Vision Toolkit variant for image Q&A, multi-image comparison, long-screenshot OCR, screenshot-to-UI reproduction, element grounding, and pixel diff. No API key by default — images are processed by the author-hosted free service, 100 per machine per day; configurable to your own provider.
dickpy/dsh-imagegen★ 147
AI image generation for the DSH Web GUI: text-to-image and image-to-image through a configurable OpenAI-compatible endpoint (gpt-image-2 / gpt-image-1 / dall-e-3), with an api_url/api_key settings card and a sidebar split-pane generation studio.
fandc520/dsh-comfyui★ 144
Drive a local or remote ComfyUI server from DeepSeek Harness: comfyui_run / comfyui_object_info / comfyui_workflow tools generate and edit images and videos, with a workflow library (graph extraction: per component / main flow / all), a load area with resolution auto-match, a live queue, SDXL and Wan 2.1 templates, a companion skill, and a same-origin media proxy.
q253595422/dsh-imagegen-video★ 63
AI image and video generation for the DSH Web GUI: text-to-image and image-to-image over per-channel model catalogs with per-family request shaping (gpt-image, Grok Imagine, Nano Banana, Seedream, GLM-Image, Qwen-Image, MiniMax image-01, DALL-E 3), a sidebar generation studio, an infinite canvas with node workflows, files preview and canvas skills, and a prompt template library; the video side adds text-to-video, image-to-video, first/last-keyframe and multi-reference modes on an async submit/poll/download pipeline, host-side video tools, video nodes on the canvas, and clip stitching of two or more video nodes into one MP4 with the local ffmpeg.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.