dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness Image2 生图插件(gpt-image-2,OpenAI Images 兼容中转)· 社区维护分支,含网关兼容性修复。Image2 generation plugin for DeepSeek Harness — community fork with fixes.
Adds Image2 (gpt-image-2) generation to DeepSeek Harness:
text-to-image and image-to-image through any OpenAI Images-compatible relay API.
Configure only a baseURL and an API Key, and generated images appear directly in
the conversation (thumbnails, zoom, Save As) while also landing in outputs/image2/.
Community fork — this repository is a maintained fork of the MIT-licensed JuneLearn/dsh-image2-draw with gateway-compatibility fixes (see Fork changes). Upstream copyright and license are preserved in LICENSE.
Quick install — pick one line and run it in your terminal:
# Already running DSH (web profile):
dsh plugin --profile web add github:oebeliever/dsh-image2-draw
# Brand-new machine, one click (auto-installs Node/pnpm/DSH):
# Windows PowerShell:
irm https://raw.githubusercontent.com/oebeliever/dsh-image2-draw/main/install.ps1 | iex
# macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/oebeliever/dsh-image2-draw/main/install.sh | bash
Then restart DSH (dsh web), open Settings → Plugins → Plugin config → Image2 生图,
enter the API Key and baseURL of any OpenAI-Images-compatible relay (e.g.
https://example.com/v1, /images/generations is appended automatically), and ask the
AI to call image2-generate. 中文说明
baseURL and an API Key; default model is gpt-image-2.skills/image2-draw provides the skill, sharing
one core implementation with the DSH plugin.https://example.com/v1 and appends
/images/generations automatically./images/edits (optional explicit editURL).image2-generate — text-to-image, 1–8 images, sequential requests (no concurrency).image2-edit — image-to-image with 1–8 PNG / JPEG / WebP reference images.low / medium / high / auto (depends on relay support).outputs/image2/image2-<timestamp>[-N].<ext>, auto-numbered on name collision.edits semantics).auto passthrough, gateway-friendly presets
(1024x1024 / 1536x1024 / 1024x1536 / 3840x2160 …) and validated custom
WIDTHxHEIGHT (16px multiples, ≤ 3840 edge, 655,360–8,294,400 px², ratio ≤ 3:1).IMAGE2_API_KEY env var.)v0.2.1 (preset library)
{outfit} variable; the multi-view → per-outfit sheets (confirm each) flow; the
six-outfit list (zh/en) derived from the reference photos.~/.dsh/storages/image2-draw/presets.json; the 🎨 studio gains
a 📚 template bar: load presets with variable filling, save the current prompt as
a template, preview/copy flow & list bodies, delete user presets.image2-preset (list / get / save) so the agent can reuse
templates — e.g. run the character-design flow one sheet at a time, waiting for user
confirmation between sheets.v0.2.0
auto is passed through as-is; portrait/landscape
presets moved from 768x1024/1024x768 to gateway-safe 1024x1536/1536x1024;
documented presets 1024x1024 / 1536x1024 / 1024x1536 / 3840x2160 short-circuit
validation and go straight to the API./images/edits now always sends repeated standard image fields for multiple
source images (previously a non-standard image[] field for >1 image). This matches
the OpenAI multi-source-image semantics and unblocks multi-view character
consistency (several photos of the same person → one new image of that person).
refs also accepts conversation attachment ids (sha256:…) directly — the
plugin reads them from the attachment store, no local paths or vision tool needed.conversation.input.dock): text-to-image /
image-to-image / multi-view character tabs, click & drag-drop upload with previews,
an "assemble consistency prompt" helper, background task + polling, and result
gallery with Save As. Studio results live in ~/.dsh/storages/image2-draw/library/
(survives restarts), independent from conversation-tool outputs.v0.1.1 (vs upstream v0.1.0)
output_format field from the generations payload — some
OpenAI-compatible gateways reject it (standard params only: model/prompt/size/quality/n).redirect: 'manual' with clear diagnostics for 3xx responses, including a dedicated
message for upstream region-unavailable (e.g. mainland-China IP blocked — switch to an
overseas proxy node or another relay).key: 'image2-draw') so the card loads
reliably on current Harness client versions.dsh plugin runs pnpm in the profile directory (corepack enable is enough).registry.npmjs.org and github.com. From restricted networks,
set HTTP_PROXY / HTTPS_PROXY (and npm_config_proxy) in the current shell.Windows PowerShell:
irm https://raw.githubusercontent.com/oebeliever/dsh-image2-draw/main/install.ps1 | iex
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/oebeliever/dsh-image2-draw/main/install.sh | bash
The script checks Node.js (installs the LTS via winget on Windows if missing), enables
pnpm, globally installs @deepseek-ai/dsh when absent, adds this plugin to the web
profile, then prints the startup guide.
dsh plugin --profile web add github:oebeliever/dsh-image2-draw
Restart DSH afterwards (dsh web); the plugin auto-joins the profile bundle layer via
its dsh.bundle declaration — no manual patch editing.
npx --yes -p @deepseek-ai/dsh dsh plugin --profile web add github:oebeliever/dsh-image2-draw
Launch the same way afterwards: npx --yes -p @deepseek-ai/dsh dsh web.
Upgrade = re-run the same install command (fetches the latest commit), then restart dsh.
Uninstall:
dsh plugin --profile web remove dsh-image2-draw
Restart dsh web; the card and tools disappear (images already saved to
outputs/image2/ are kept).
This repo doubles as a Claude Code plugin (sharing lib/core.js with the DSH plugin).
Option 1 — plugin marketplace (recommended)
/plugin marketplace add oebeliever/dsh-image2-draw
/plugin install image2-draw@dsh-image2-draw
Option 2 — copy the skill only: put skills/image2-draw/ into ~/.claude/skills/ (all projects)
or <project>/.claude/skills/ (one project).
Option 3 — DSH already configured: nothing to do; the skill falls back to DSH's baseURL and credentials.
Multi-endpoint config lives in ~/.claude/image2-draw.json:
{ "timeoutSeconds": 900,
"endpoints": [
{ "name": "primary", "baseURL": "https://api.example.com/v1", "apiKey": "sk-…", "model": "gpt-image-2" },
{ "name": "backup", "baseURL": "https://backup.example.com/v1", "apiKeyEnv": "IMAGE2_API_KEY_B" }
] }
The endpoint shape and failover rules match the DSH side. Note
apiKeyEnvmeans different things on each side: here it is an environment-variable name (so keys can stay out of the file); on the DSH side it is a credential-store reference. When falling back to DSH settings only the flat single-endpoint fields are read — use the JSON file or env vars for multiple endpoints.
Usage (just talk to Claude Code):
Use image2-draw to turn this photo into a cartoon figurine: C:\path\to\photo.jpg
Generate a chibi shiba-inu figurine image, square, high quality
API Key and baseURL (e.g. https://example.com/v1) from your relay.image2-generate, or pass
reference-image paths to image2-edit.Example prompts:
Call image2-generate to create a portrait cinematic poster of a future city at high quality.
Call image2-edit with D:\images\room.png and restyle the room with light Japanese wood while preserving the layout.
Whether the relay actually supports gpt-image-2, editing, custom sizes and quality
levels is up to the provider. HTTP 400 / 404 → check the provider's model name and
Images endpoint format. Size errors → most gateways accept only auto / 1024x1024 /
1536x1024 / 1024x1536 / 3840x2160; pick a preset instead of a custom WIDTHxHEIGHT.
region-unavailable → the relay blocks your exit IP region;
switch to an overseas proxy or another provider.
Configure up to 8 endpoints in Settings → Plugins → Plugin config. They are tried in order; when one fails with network error / timeout / 401 / 402 / 403 / 404 / 429 / 5xx (including 524), the next one is used automatically. Parameter errors such as HTTP 400 never trigger a switch (401/402/403/404/429 still do) — another endpoint would fail identically.
IMAGE2_API_KEY, IMAGE2_API_KEY_2, …) and optional model.IMAGE2_NO_ROTATE=1 to disable this memory and always start from the first endpoint.⚠️ A 524/timeout means the upstream may still have generated an image, so failing over can double-bill. When every endpoint fails, the error message says so explicitly; a failover that ends in success carries no extra warning — decide accordingly before regenerating.
⚠️ Always reference keys through credentials (
apiKeyEnv) — never use theapiKeyfield. A literalapiKeylives server-side only: the settings panel can neither see nor edit it, and editing the endpoint list in the panel replaces the whole array, silently dropping any hand-written literal (generation then fails with "no key configured"). Need several keys? Create several credential refs:IMAGE2_API_KEY,IMAGE2_API_KEY_2, …
node --check lib/index.js
node --check lib/client.js
Unit tests (node tests/plugin.test.mjs) import the @deepseek-ai/* runtime peer
packages, so run them inside an environment where those are installed — a DSH profile's
node_modules or a Harness source workspace — rather than in a bare checkout.
Original plugin by JuneLearn (MIT). Parts of the in-conversation attachment and tool-card implementation were adapted from the MIT-licensed dsh-multimodal — see THIRD_PARTY_NOTICES.md.
MIT — upstream © 2026 JuneLearn; fork © 2026 oebeliever.