Introduction

The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When building agents, session content is usually limited to text. When an agent needs to generate images or videos directly, developers often have to integrate image/video APIs separately in code. This increases development complexity and breaks DSH’s unified plugin architecture.

The dsh-media-gen plugin solves this problem. It integrates OpenAI-compatible image and video generation capabilities directly into DSH sessions, allowing agents to generate media content in the same way they call other tools.

Plugin Overview

dsh-media-gen is a DSH plugin used to generate images and videos in DSH sessions.

It reuses DSH’s already configured model settings (Provider / Model / API Key) and does not depend on browser-side Keys, ensuring security. The plugin provides a separate “Media Generation” menu in the settings page and maintains a persistent index, so media links from past sessions remain available after restart.

Core Features

This plugin provides the following core capabilities:

  1. Generate images and videos: Supports text-to-image, image-to-image (image editing), and video generation.
  2. OpenAI-compatible interfaces: Calls the standard /images/generations, /images/edits, and /videos interfaces.
  3. Reuses DSH configuration: Strictly uses the Provider and Model configured under Settings → Media Generation. It does not support switching models temporarily during tool calls.
  4. Independent settings menu: Provides a separate area in the DSH settings page to configure the models for the three modes: text-to-image, image-to-image, and video generation.
  5. Toolset: Provides tools such as media_list_providers (list available Providers), media_gen_image (text-to-image), media_edit_image (image-to-image/editing), and media_gen_video (video generation).
  6. File persistence: Generated files are saved to the <current workspace>/media_gen directory, and preview links are returned in the session.
  7. Persistent index: The plugin maintains ~/.dsh/storages/dsh-media-gen-index.json, so image/video links from past sessions remain accessible after restart.

Installation and Configuration

To install the plugin, use DSH’s plugin management command.

dsh plugin --profile web add github:ant404/dsh-media-gen

After installation is complete, restart or refresh DSH. Go to the Settings → Media Generation menu and configure the Provider (read from DSH’s settings.yaml → llm-pi-ai.providers) and Model for each of the following three modes:

  • Text-to-image model
  • Image-to-image model
  • Video generation model

After saving the configuration, it can be used in sessions.

Usage

Basic Commands

The plugin provides the following tools, which can be called directly in a session:

  • media_list_providers: Lists the currently available OpenAI-compatible providers and their models in DSH.
  • media_gen_image: Performs text-to-image generation (requests /images/generations).
  • media_edit_image: Performs image-to-image generation or image editing (requests /images/edits). Supports local file paths or http(s) URLs.
  • media_gen_video: Performs video generation (requests /videos or /videos/generations) and automatically handles asynchronous task polling.

Typical Examples

Enter prompts directly in the session:

  1. Text-to-image:
    Generate a 16:9 image of a snowy mountain at sunrise.
  2. Image-to-image:
    Turn this image into a watercolor style: C:\path\to\input.png
  3. Video generation:
    Generate a 5-second video of a cyberpunk city at night.

Interactive Operations

  • Image preview: Generated images are displayed as thumbnails in the session (maximum around 280px). Left-click an image to enlarge it. Click the background or press Esc to close.
  • Reference path: Right-click an image, select “Reference” in the popup menu. This inserts the image’s local file path into the conversation input box, making it easier to perform image-to-image or image-to-video operations later.
  • Video playback: Generated video results are displayed in the chat using an embedded <video> tag and include a download link.

Security and Notes

  • Security isolation: Provider configuration is read directly from DSH’s settings.yaml, and API Keys are not exposed to the browser. All configuration interfaces and raw file access (/media-gen/raw/*) are restricted to Loopback (127.0.0.1/localhost).
  • Fixed models: All media generation tools must use the models configured on the settings page. They do not support temporarily changing Provider or Model in tool parameters.
  • Video compatibility: The plugin handles video interface compatibility. It requests /videos by default. If a 404/405 is returned, it automatically retries /videos/generations. For asynchronous tasks (such as Agnes style), the plugin automatically polls until completion.
  • Development review: The plugin is open source under the MIT License. Please review the source code before installation to ensure it meets your environment requirements.

Conclusion

dsh-media-gen seamlessly integrates previously standalone media generation capabilities into the DSH ecosystem, providing agent developers with a standardized tool interface. By reusing a unified configuration system and persistent storage, it lowers the barrier to building multimodal applications.