dsh-image-gen
其他 活跃维护

dsh-image-gen

Anyway-one/dsh-image-gen

该插件依托OpenAI Images兼容接口调用gpt-image-2实现AI生图,用户仅需配置API Key与baseURL即可快速启用,无需复杂部署操作,开箱即用。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
693 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Anyway-one/dsh-image-gen
git clone https://github.com/Anyway-one/dsh-image-gen.git
git clone git@github.com:Anyway-one/dsh-image-gen.git
README.md main

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 baseURL and API Key are required; the default model is gpt-image-2.
  • baseURL accepts shorthands like https://example.com/v1; the plugin appends
    /images/generations automatically.
  • The edit endpoint defaults to /images/edits derived from baseURL, or can be
    set explicitly via editURL.
  • 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

  1. Open Settings → Plugins → Plugin settings and expand the Image Gen card.
  2. Fill in Endpoint (baseURL), e.g. https://example.com/v1.
  3. Fill in API Key (stored in credentials, default ref IMAGE_GEN_API_KEY).
  4. Optionally adjust Model (default gpt-image-2), Edit endpoint, or Timeout.
  5. Save, then use image-generate / image-edit in conversation.

settings.png

Use Case

use-case.png

Development

pnpm test   # pure-function unit tests (no DSH boot required)

Layout:

  • lib/index.js — Host half: image-gen settings namespace, image-generate /
    image-edit tools, /image-gen/* HTTP routes.
  • lib/client.js — Browser half: settings.plugin.item config card (keyed), and
    tool.call.toolview result cards.
  • cordis.patch.yml — mounts both halves (entry id image-gen).

License

MIT