deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
ankye/dsh-image-generation
Give your DeepSeek Harness agent a paintbrush. dsh-image-generation is an image-generation plugin for DeepSeek Harness: the agent describes an image in text, a settings-selected generation channel produces it through a pluggable backend, and the file paths are written to disk — all outside the model, so no image-capable model is required.
PROJECT TOPICS
PROJECT README
English | 中文
Give your DeepSeek Harness agent a paintbrush. dsh-image-generation is an image-generation plugin for DeepSeek Harness: the agent describes an image in text, a settings-selected generation channel produces it through a pluggable backend, and the file paths are written to disk — all outside the model, so no image-capable model is required.
This revision requires DeepSeek Harness core 0.1.2-alpha.5 or later within the 0.1.x line. It uses the Settings service API introduced in that core release.
generate_image tool is decoupled from generation backends. The gpt-image-2 channel ships ready to use; adding Gemini, FLUX, or a local model is one generate() implementation + one registry line — the tool schema never changes.count, aspect_ratio, and quality are standardized across every channel; channel-specific knobs stay in the per-channel defaults of the settings section.generated/ and returned as paths; pair with analyze_image (the dsh-client-vision plugin) for generate-then-inspect workflows.credentials store (GENERATION_OPENAI_API_KEY) — never in settings files, logs, or the conversation transcript.code, standard, cordis, minimal — every agent can generate.pnpm publish / tarball).| Tool | What it does |
|---|---|
generate_image |
Generate 1–10 images from a text prompt through the configured channel. Parameters: prompt (required), count, aspect_ratio (1:1…2:3), quality (low/medium/high/auto), output_dir. Returns the written file paths + MIME types. |
generation namespace)Configured in Settings → Plugins → Plugin configuration → Image Generation:
| Field | Meaning |
|---|---|
Endpoint (baseUrl) |
Domain + optional path prefix; /images/generations is appended. e.g. https://api.example.com/v1 |
| Channel | The active generation backend (currently gpt-image-2). |
| Model | gpt-image-2 |
| Output directory | Where images are written; empty uses <cwd>/generated. |
| Default aspect ratio / quality / count | Used when the tool passes no per-call value. |
| API key | Stored through the harness credentials service as GENERATION_OPENAI_API_KEY; the literal never leaves your machine. |
model → generate_image(prompt, count?, aspect_ratio?, quality?)
│ reads generation.channel
▼
channels/<id>/generate() ← one implementation per backend
│
gpt-image-2: POST {baseUrl}/images/generations (b64_json / url)
gemini / flux / local: … ← add yours here
│
▼
output.ts → decode + write to disk → {path, mime}[]
Adding a channel is deliberately small:
// src/channels/<id>/index.ts
export async function myGenerate(ctx, call): Promise<GeneratedImage[]> {
// call.prompt, call.count, call.aspectRatio, call.quality, call.config, call.signal
return await fetchYourGenerationApi(...)
}
// src/channels/index.ts — one registry line
export const channels = {
'gpt-image-2': { label: 'GPT Image', generate: gptImageGenerate, maxCount: 10, ... },
myChannel: { label: 'My Channel', generate: myGenerate },
}
The generate_image tool and its schema never change.
dsh plugin add installs the packages into your profile; each package declares dsh.bundle, so the rows mount automatically — no patch rows, no repo edits.
0.1.2-alpha.5 or later within the 0.1.x line, plus dsh and pnpm on PATH.a. From this repository (recommended until published to npm):
dsh plugin --profile web add \
file:/path/to/dsh-image-generation/packages/tool-image-generation \
file:/path/to/dsh-image-generation/packages/ui-image-generation
b. Tarball:
cd packages/tool-image-generation && npm pack
cd packages/ui-image-generation && npm pack
dsh plugin --profile web add file:/path/to/deepseek-ai-dsh-tool-image-generation-0.1.0-rc.7.tgz \
file:/path/to/deepseek-ai-dsh-client-ui-image-generation-0.1.0-rc.7.tgz
c. npm registry (after publishing):
dsh plugin --profile web add @deepseek-ai/dsh-tool-image-generation @deepseek-ai/dsh-client-ui-image-generation
A
[WARN] Issues with peer dependenciesmessage is expected and safe to ignore — the peers come from your deployment's own bundles at runtime.
node -e "console.log(JSON.stringify(require(process.env.HOME + '/.dsh/profiles/web/package.json').dsh.profile.bundles))"
# should list dsh-tool-image-generation and dsh-client-ui-image-generation
Restart the harness, then Settings → Plugins → Plugin configuration → Image Generation: set the endpoint, model, defaults, output directory, and your own API key (GENERATION_OPENAI_API_KEY), save.
Ask the agent to "generate an image of a …" — it should call generate_image and return written file paths under generated/.
dsh plugin --profile web remove @deepseek-ai/dsh-tool-image-generation @deepseek-ai/dsh-client-ui-image-generation
If you run a fork of deepseek-harness (not the official deployment), you can drop the packages into the monorepo instead:
cp -R packages/tool-image-generation <harness>/packages/vision/tool-image-generation
cp -R packages/ui-image-generation <harness>/packages/client/ui-image-generation
Then add both to apps/cli/package.json (workspace:^), add ./packages/vision/tool-image-generation to tsconfig.host.json and ./packages/client/ui-image-generation to tsconfig.client.json, pnpm install, build (tsdown host + client passes), and restart.
| Parameter | Meaning | Default |
|---|---|---|
prompt |
Text describing the image to generate (required). | — |
count |
How many images to generate (1–10). | 1 |
aspect_ratio |
1:1 / 4:3 / 3:4 / 16:9 / 9:16 / 3:2 / 2:3 — mapped to OpenAI pixel sizes. |
1:1 |
quality |
low / medium / high / auto. |
auto |
output_dir |
Directory for the written files; relative paths resolve against the session workspace. | generated/ |
Unsupported aspect ratios, qualities, or out-of-range counts fail loudly with a message naming the supported values — the tool never silently substitutes.
generate_image.@deepseek-ai/dsh-tools, …) resolve from your deployment. lib/ ships prebuilt, so npm pack works immediately.tsconfig.json files are standalone; the harness monorepo's build pipeline (including the client-bundle tsdown.config.ts) applies in Option A..credentials.yaml.MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。