dsh-tool-imagegen
通过 OpenRouter 统一图像 API 为 DeepSeek Harness 提供的文本生成图像工具,支持参数限制和工作区文件输出。
AI 分析
核心用途是为 DSH 赋予文生图能力。适合需要在会话中生成图片并保存到工作区的任务。必要条件是需要配置 OpenRouter API Key(如 OPENROUTER_API_KEY)。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Pappet/dsh-tool-imagegen说明文档
阅读完整 README ↗Configuration
- insert:
- id: imagegen
name: 'dsh-tool-imagegen'
config:
apiKeyEnv: OPENROUTER_API_KEY # credential ref / env var NAME (the secret itself is never config)
baseURL: https://openrouter.ai/api/v1
outputDir: .dsh/images # workspace-relative
defaultModel: seedream
capabilityTtlMs: 86400000
maxImagesPerCall: 4 # guard against hallucinated n
maxReferenceBytes: 8388608 # per reference image (8 MiB on disk)
maxReferenceTotalBytes: 33554432 # all references of one call (32 MiB)
models:
seedream:
id: bytedance-seed/seedream-4.5
defaults: { resolution: "2K", aspect_ratio: "16:9" }
seedream-pro:
id: bytedance-seed/seedream-5-0-pro
seedream-lite:
id: bytedance-seed/seedream-5-0-lite
Slugs verified against
GET /api/v1/images/models: the Seedream 5.0 models areseedream-5-0-pro/seedream-5-0-lite(dashes, not dots), and e.g. 5.0-pro only acceptsn ≤ 1and resolutions1K|2K. The gate catches such mismatches — an alias whose slug is wrong surfaces as an HTTP error carrying the API's body text.
API key:
apiKeyEnvnames a dsh credential reference, resolved through the credentials seam first ($DSH_HOME/.credentials.yamlunderrefs., plus the provider's env layers), then from the same-named process environment variable — the same convention asllm-pi-aianddsh-github. The value never reaches config, logs, or model-visible text.