dsh-openrouter-imagen-v2: An Image Generation Plugin Based on OpenRouter

Introduction

DeepSeek Harness (DSH) supports functionality extension through plugins. dsh-openrouter-imagen-v2 is a plugin that leverages OpenRouter’s image API to provide a standalone workbench and a tool for Agent invocation within DSH. It addresses the need for integrating image generation capabilities into agent workflows.

Core Features

The plugin provides the following capabilities:

  • Standalone Workbench: Dual-column layout with the image area and history on the left and the conversation area on the right; the divider is draggable.
  • Two Image Generation Modes: Images can be generated manually in the workbench or via Agent tool invocation.
  • Prompt Handling: Supports “direct generation” (input is the prompt) or “let AI write the prompt” (defaults to google/gemini-2.5-flash model).
  • Reference Image Support: Supports up to 4 reference images via file selection, pasting, or drag-and-drop.
  • Model Management: Supports configuring a model list (up to 16 models) and specifying a default model.
  • Seed Backfill: The actual seed used is automatically written back after generation for reproducibility.
  • Generation Records: Keeps the last 60 records and supports regeneration with the same parameters.
  • Bundled Skill: Includes a skill for guiding models in deriving art styles and prompts.

Installation and Activation

Before installation, ensure DeepSeek Harness version is 0.2.x and Node.js version is ^22.19.0 or >=24.0.0.

Install via Git:

dsh plugin --profile desktop add git+https://github.com/fancyui/dsh-openrouter-imagen-v2.git

After installation, restart DSH. You can find the “Image Generation” entry under the “Plugins” group in the sidebar.

Usage

Workbench Operations

After entering the “Image Generation” workbench, the default parameters are: count 1, quality medium, background auto, aspect ratio 16:9, resolution 1K.

  • Prompt Mode: Enter a description in the right column and select “Direct Generation” or “Let AI Write Prompt”.
  • Reference Images: Supports drag-and-drop or paste. Images are only sent with the current request and are not written to history.
  • Seed: After generation, the seed is automatically backfilled into the input box. Click “Random” to clear it.

Configuration Settings

Click the settings icon in the top right corner to configure the following:

  • Key: Configure the OpenRouter API Key for request authentication and quota querying.
  • Models: Manage the model list and default model.
  • Advanced: Set the prompt model, save directory (default: generated-images), provider ordering, and additional request body JSON.

Agent Invocation

Agents can call the openrouter_generate_imagen_v2 tool to generate a single PNG image.

Parameter Description:
* prompt: Required, description of the image.
* save_dir: Optional, save directory (relative to the session working directory).
* file_name: Optional, file name stem (extension is fixed as .png).
* aspect_ratio, resolution, quality, background, model, seed: Optional, defaults to workbench settings when unspecified.

Fixed Behavior:
Only one image is generated per invocation.

Important Notes

  • A valid OpenRouter API Key is required.
  • DeepSeek Harness version requirement is 0.2.x.
  • The save directory is restricted to the session working directory; out-of-bounds paths will cause an error.
  • The key will not be returned in plaintext through any interface.
  • Resolution tiers 512, 1K, 2K, and 4K are names and do not correspond to fixed pixel values.
  • Agent invocation generates only one PNG image per call.

Conclusion

This plugin complements DSH’s capabilities in model inference, making image generation part of the DSH ecosystem. For more details and source code, please refer to the links below.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye