READMESource: main@ffa13b52
DSH Image Gen
Adds gpt-image-2 generation to DeepSeek Harness by calling any third-party
OpenAI Images compatible endpoint. Fill in baseURL and API Key and use
text-to-image and image-to-image tools directly in conversation.
This plugin is a rewritten, fixed fork of dsh-image2-draw. It fixes a load-time bug that broke the original (see "Bug fix" below).
Features
- A dedicated Image Gen card under Settings → Plugins → Plugin settings.
- Only
baseURLandAPI Keyare required; the default model isgpt-image-2. baseURLaccepts shorthands likehttps://example.com/v1; the plugin appends/images/generationsautomatically.- The edit endpoint defaults to
/images/editsderived frombaseURL, or can be set explicitly viaeditURL. image-generate(text-to-image) tool, generating 1–8 images sequentially.image-edit(image-to-image) tool with 1–8 PNG / JPEG / WebP reference images.- Adaptive portrait / landscape / square sizes, plus validated custom sizes.
- Results render inline in conversation with thumbnails, lightbox zoom, and save-as.
- Images are also written to
outputs/image-gen/in the session working directory (auto-numbered, never overwriting existing files). - API Key is written only to DSH credentials (default ref
IMAGE_GEN_API_KEY); it is never echoed or stored in the settings document. - Validates config writes, response sizes, timeouts, and reference files; 524/timeout is not auto-retried to avoid duplicate billing.
Install
Prerequisites
Via npx
npx --yes -p @deepseek-ai/dsh dsh plugin --profile web add github:Anyway-one/dsh-image-gen
npx --yes -p @deepseek-ai/dsh dsh web
Pin a release with github:Anyway-one/dsh-image-gen#v0.1.0.
Via pnpm + Harness source
cd <deepseek-harness>
pnpm dsh plugin --profile web add github:Anyway-one/dsh-image-gen
pnpm dsh web
Configuration
- Open Settings → Plugins → Plugin settings and expand the Image Gen card.
- Fill in Endpoint (baseURL), e.g.
https://example.com/v1. - Fill in API Key (stored in credentials, default ref
IMAGE_GEN_API_KEY). - Optionally adjust Model (default
gpt-image-2), Edit endpoint, or Timeout. - Save, then use
image-generate/image-editin conversation.

Use Case

Development
pnpm test # pure-function unit tests (no DSH boot required)
Layout:
lib/index.js— Host half:image-gensettings namespace,image-generate/image-edittools,/image-gen/*HTTP routes.lib/client.js— Browser half:settings.plugin.itemconfig card (keyed), andtool.call.toolviewresult cards.cordis.patch.yml— mounts both halves (entry idimage-gen).
No comments yet. Be the first to write one.