Preface

In DeepSeek Harness (DSH) for image generation, besides calling the model, you need to handle the status during generation, cancellation, result retention, and client preview. Codex’s built-in image_gen already supports Codex subscription requests, but its public backend currently requests non-streaming JSON responses, and the UI doesn’t have a particularly obvious expression of the generation process.

dsh-image-gen preserves the compatible image_gen tool name and provides GPT Image 2 generation capabilities in DSH: it defaults to using dsh-codex-connect’s ChatGPT OAuth, or can explicitly use an API key, and saves the final image as a DSH attachment for replay, lightbox preview, and download.

What is this

dsh-image-gen is a Web profile plugin for DeepSeek Harness, maintained by LeemanCheung, and is under the MIT license.

It registers the Codex-compatible model tool name image_gen for gpt-image-2. The plugin supports two types of authentication paths:

  • Default Codex subscription path: Reuses the refreshable ChatGPT OAuth credential from dsh-codex-connect.
  • Explicit API-key path: Uses the Images API account configured in DSH.

Completed images are stored in DSH’s immutable attachment store, supporting replay, lightbox preview, and download.

Core Capabilities

Tools and Invocation

  • Registers the Codex-compatible model tool name image_gen.
  • Tool output to the model remains text-only; image references are retained in UI metadata.
  • Suitable for nested Code Mode calls.
  • Can cancel requests using DSH’s existing interrupt control during generation.

Generation Process

  • Codex subscription requests display a developing animation before receiving the non-streaming result.
  • API-key requests display up to 3 provider-sent partial images.
  • Partial frames cross-fade on an animated developing plate, eventually becoming clear as the final image.

Result Retention

  • Only saves the final image upon completion.
  • Images enter DSH’s immutable attachment store.
  • Completion cards support replay, lightbox preview, and download.
  • Can still replay from the same card after session reload.

Installation and Enablement

First, check the third-party source code and MIT license. The plugin runs with the permissions of the current dsh process, so it is recommended to pin the release tag or commit before installation.

The default keyless subscription path requires installing dsh-codex-connect and logging in once:

dsh plugin --profile web add dsh-codex-connect
dsh openai-codex login

Then install this plugin:

dsh plugin --profile web add github:LeemanCheung/dsh-image-gen#v0.3.0

After installation, restart the DSH Host and refresh the Web page.

Local development can use:

git clone https://github.com/LeemanCheung/dsh-image-gen.git
cd dsh-image-gen
npm install
npm run check
dsh plugin --profile web add .

The repository commits lib/index.js and lib/client.js, so installing from Git with a fixed tag doesn’t require additional build dependencies.

Typical Usage

Simply describe naturally in a DSH conversation, for example:

Generate a cinematic 16:9 product photograph of a translucent mechanical keyboard on a dark glass desk, violet rim light, no text.

The model will call image_gen. During execution, the card displays a developing animation; DSH’s interrupt control can cancel the request; the completed card supports preview and download.

Tool Options

  • prompt: Generation instruction, length 1 to 32,000 characters, and up to 64,000 UTF-8 bytes.
  • reference_image_path: Optional path for PNG, JPEG, or WebP. DSH requests one-time approval before reading, and marks the file and upload source; bytes are validated but not stored immediately; they are only sent to the API-key /images/edits endpoint; only after the Provider succeeds are they submitted as durable audit attachments.

The reference_image_path edit mode requires authMode: api-key, or authMode: auto with an API-key fallback. The private Codex subscription endpoint is not considered an edit API.

Authentication

authMode: auto is the default behavior. It first asks the installed dsh-codex-connect package to obtain DSH-owned, refreshable ChatGPT OAuth credentials, and only sends to the fixed endpoint:

https://chatgpt.com/backend-api/codex/images/generations

If Codex credential parsing, compatibility check, or refresh fails for non-cancellation reasons, it tries the DSH credential reference specified by apiKeyEnv, defaulting to OPENAI_API_KEY. Returns a combined failure if both fail.

Optional configurations:

  • authMode: codex-subscription: Disables API-key fallback.
  • authMode: api-key: Uses only the configured Images API account.

Do not write OAuth tokens or API keys into cordis.patch.yml, chat messages, Git, or screenshots. The plugin parses authentication on every generation and does not retain it after the request ends.

Compatibility and Verification

Verified environments:

  • DeepSeek Harness 0.1.0-rc.6
  • dsh-codex-connect 0.1.0-alpha.4.4
  • Node.js 24.15.0
  • DSH Web profile on Windows 11
  • Real Codex subscription generation, durable replay, Blob preview, and download controls

Node.js support: ^22.19.0 or >=24.0.0.

Verification date: 2026-08-15.

Suitable Scenarios and Notes

Suitable for scenarios that need to integrate GPT Image 2 into the DSH conversation flow and wish to retain the final image as a DSH attachment.

Notes when using:

  • The default subscription path depends on a one-time login to dsh-codex-connect.
  • The API-key path requires an available Images API account.
  • The reference_image_path edit mode cannot rely on the private Codex subscription endpoint.
  • The plugin rejects redirects, limits response size, validates image bytes through DSH, and only retries transient failures.
  • Includes Chinese and English UI copy and supports prefers-reduced-motion.

Links

GitHub:

https://github.com/LeemanCheung/dsh-image-gen

Community directory link:

https://www.skillhub.cn/plugins/LeemanCheung/dsh-image-gen

This directory link comes from plugin hints and has not been individually verified in the material collected for this session. The community directory is an independent site and is not equivalent to the DeepSeek or High-Fin official app stores.