工具与能力
#dsh-plugin
dsh-image-generation (tool-image-generation)
面向模型的图像生成工具,提供可配置通道和标准化图像参数。
ankye
@ankye
⬇ 2
★ 0
main
安装
dsh plugin --profile web add github:ankye/dsh-image-generation
需要可复现安装时,可在仓库后追加 #commit 固定提交。
面向模型的图像生成工具,提供可配置通道和标准化图像参数。
该插件未提供要点说明,请参考仓库 README。
dsh-plugin
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/ankye/dsh-image-generation/tree/main/packages/tool-image-generation |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 2 |
| GitHub 星标 | 0 |
| 最近推送 | 2026-09-03 |
| 收录日期 | 2026-09-19 |
| 分类 | 工具与能力 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# dsh-image-generation
English | [中文](README.zh.md)
Give your DeepSeek Harness agent a **paintbrush**. `dsh-image-generation` is an image-generation plugin for [DeepSeek Harness](https://github.com/deepseek-ai/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**.
## Compatibility
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.
## Why you want it
- **DeepSeek can't draw — now it can.** The harness model has no image output. This plugin runs the whole "create" outside the model and returns real file paths the agent can hand over (or verify).
- **Multi-channel by design.** The `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.
- **Normalized parameters.** `count`, `aspect_ratio`, and `quality` are standardized across every channel; channel-specific knobs stay in the per-channel defaults of the settings section.
- **Generated, then verified.** Images are decoded to disk under `generated/` and returned as paths; pair with `analyze_image` (the [dsh-client-vision](https://github.com/ankye/dsh-client-vision) plugin) for generate-then-inspect workflows.
- **Secret-safe.** The API key lives in the harness `credentials` store (`GENERATION_OPENAI_API_KEY`) — never in settings files, logs, or the conversation transcript.
- **Every preset, out of the box.** Mounted on the host plane, so `code`, `standard`, `cordis`, `minimal` — every agent can generate.
- **Sensible defaults.** Default aspect ratio, quality, count, and output directory are configurable; the tool respects per-call overrides.
- **Ready to ship.** Prebuilt bundles included; three install paths (drop into the monorepo / `pnpm publish` / tarball).
## Capabilities
### Tool
| 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. |
### Settings (`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 `/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. |
### Multi-channel architecture
```
model → generate_image(prompt, count?, aspect_ratio?, quality?)
│ reads generation.channel
▼
channels//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:
```ts
// src/channels//index.ts
export async function myGenerate(ctx, call): Promise {
// call.prompt, call.count, call.aspectRatio, call.quality, call.config, call.signal
return await fetchYourGenerationApi(...)
}
```
```ts
// 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.
## Installation (official — no repo modification)
`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.
### Prerequisites
- DeepSeek Harness core `0.1.2-alpha.5` or later within the `0.1.x` line, plus `dsh` and `pnpm` on PATH.
### 1. Get the packages (pick one)
**a. From this repository (recommended until published to npm):**
```sh
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:**
```sh
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):**
```sh
dsh plugin --profile web add @deepseek-ai/dsh-tool-image-generation @deepseek-ai/dsh-client-ui-image-generation
```
> A `[WARN] Issues with peer dependencies` message is expected and safe to ignore — the peers come from your deployment's own bundles at runtime.
### 2. Verify
```sh
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
```
### 3. Restart + configure
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.
### 4. Verify
Ask the agent to "generate an image of a …" — it should call `generate_image` and return written file paths under `generated/`.
### Uninstall
```sh
dsh plugin --profile web remove @deepseek-ai/dsh-tool-image-generation @deepseek-ai/dsh-client-ui-image-generation
```
## Alternative: build inside a harness fork
If you run a **fork** of deepseek-harness (not the official deployment), you can drop the packages into the monorepo instead:
```sh
cp -R packages/tool-image-generation /packages/vision/tool-image-generation
cp -R packages/ui-image-generation /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.
## Parameters
| 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.
## Quick start
1. Restart the harness.
2. The tool catalog now includes `generate_image`.
3. Open **Settings → Plugins → Plugin configuration → Image Generation**, set the endpoint, model, and your own API key, and save.
4. Ask the agent to "generate an image of a …" — it returns the written file paths.
## Development
- This repository is a **source distribution**: the peer packages (`@deepseek-ai/dsh-tools`, …) resolve from your deployment. `lib/` ships prebuilt, so `npm pack` works immediately.
- The `tsconfig.json` files are standalone; the harness monorepo's build pipeline (including the client-bundle `tsdown.config.ts`) applies in Option A.
- **Never commit secrets.** The API key stays in each machine's `.credentials.yaml`.
## License
MIT
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。