hoyyang/dsh-image-gen ↗★ 0

@dsh-external/dsh-image-gen

通用图像生成插件,接入任意 OpenAI 兼容生图网关。 需要自定义生图网关与模型的用户适用,支持命令、对话与工具三种触发方式。

包名
@dsh-external/dsh-image-gen
兼容性
待验证
Harness 依赖范围
>=0.0.1-rc <2
Cordis 依赖范围
>=4.0.0-rc <5
版本
0.2.2
许可证
MIT
最近更新
2026年8月20日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hoyyang/dsh-image-gen

使用方式

方式示例适用场景
命令/dsh-image-gen [--size=1024x1536] [--quality=high]确定性触发,不经模型回合
对话「生成一张赛博朋克城市海报」让模型自己决定何时出图
工具dsh_image_gen脚本化 / 手动调用
配置检查dsh_image_gen_config免费:只查配置,不产生账单

参数:--size=1024x1024|1024x1536|1536x1024|auto,--quality=low|medium|high(--low/--medium/--high 可简写)。

配置

四种方式任选其一,优先级从高到低:环境变量 > 设置页 > profile 配置 > 本地文件。

方式一:设置页(推荐) —— 见「快速开始 ②」,可视化、即时生效。

方式二:环境变量

export DSH_IMAGE_BASE_URL="https://你的网关.example.com/v1"
export DSH_IMAGE_MODEL="gpt-image-2"
export DSH_IMAGE_API_KEY="sk-xxx"

方式三:profile 配置 —— 在 profile 的 cordis.patch.yml 中给插件行加 config: 块(见仓库内 cordis.patch.yml 的注释示例)。

方式四:本地文件 —— 适合无 UI 的 profile(文件权限须 0600):

cat > ~/.dsh/dsh-image-gen.json <<'EOF'
{
  "baseUrl": "https://你的网关.example.com/v1",
  "model": "gpt-image-2",
  "apiKey": "sk-xxx"
}
EOF
chmod 600 ~/.dsh/dsh-image-gen.json

其余可选项:

项默认值说明
imagesPath/images/generations生图接口路径(个别网关路径不同时改它)
outputDirectory~/.dsh/generated_images/dsh-image-gen/出图目录(0700)
timeoutMs300000上游超时(毫秒)