Introduction

The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When developing agents on the desktop, image generation typically requires external panels or manual view switching. dsh-tool-imagegen aims to solve this problem: it allows the model to automatically invoke the generate_image tool during a conversation, and displays generated images directly inline in the chat box without extra operational steps.

Core Features

This plugin provides the following core capabilities:

  • Automatic tool invocation: When the model hears a generation request, it automatically calls generate_image, with parameters organized by the model.
  • Inline display in conversation: Generated images appear as cards in the conversation flow, supporting full-screen viewing, downloading, opening locally, and editing.
  • Pure text input support: Supports pure text input, including uploaded reference images and image-to-image generation. On the model side, images are displayed through custom generated-image / uploaded-image blocks, which are invisible to the model, ensuring safe use with pure text models.
  • Network resilience: Supports automatic network retries (exponential backoff, up to 3 times), but does not retry 4xx errors (such as model not found).
  • Dual model compatibility: Compatible with pure text models and image input models.
  • Settings and security: The settings page allows configuration of the endpoint URL, API key, model name, default size, and so on. The key is stored only in the local settings.yaml, is not echoed, and access is restricted using a loopback guardrail.

Installation and Enabling

After installing the plugin, you need to attach it to the desktop profile.

  1. Copy the plugin directory to the DSH plugins directory:
    cp -r dsh-tool-imagegen C:/Users/CJX/.dsh/plugins/
  1. Enter the desktop profile directory and install dependencies:
    cd C:/Users/CJX/.dsh/profiles/desktop
    pnpm install
  1. After completely exiting DSH, restart it.

Typical Usage

Users can trigger image generation with natural language:

  • “Generate an image of a cat”
  • “Change this image to…”
  • “Modify it based on this image…”

For pure text models, ensure that “Inform the model of capabilities” is enabled on the settings page. Generated images support clicking the “Edit” button to use them as reference images for continuous editing (image-to-image).

Notes

  • Image-to-image limitations: The image-to-image feature requires the upstream API to support the OpenAI-compatible /images/edits endpoint. If the upstream only implements /images/generations, image-to-image will fail.
  • Error handling: 4xx errors (such as model not found) do not trigger retries. 5xx errors or network instability are retried automatically.
  • Output format: The current output format and style may be incompatible with the gateway.
  • Storage cleanup: The “Image Generation Storage” card on the settings page can be configured to clean up orphaned files not referenced by any session.
  • Security and permissions: The plugin runs with the permissions of the current DSH process. Please check the source code and license before installing.