Introduction¶
DeepSeek Harness (DSH) adopts a plugin-based architecture, and its core runtime is primarily adapted for text streaming responses. Directly integrating image generation APIs—such as Stable Diffusion or DALL-E—usually requires writing a custom adapter that converts API responses into DSH-native image blocks and persists them to session attachments. The dsh-plugin-use-images plugin solves this integration challenge through a custom adaptation layer.
What is this¶
This is a plugin that adapts image generation HTTP APIs to DSH selectable models. It is maintained by user chuling-lingling. It allows users to call external image generation endpoints directly within the DSH chat interface and handles the returned images as session attachments.
Core Features¶
- API Adaptation: Adapts image-generating HTTP APIs to DSH selectable models.
- Response Format Support: Supports JSON URL, JSON base64, JSON data URL, text/plain URL/data URL, and direct HTTP responses with image/png/jpeg/webp/gif.
- Template Variables: Supports the
{{prompt}},{{model}},{{n}}, and{{apiKey}}variables in request JSON templates. - Configuration Methods: Supports configuring the Base URL, API Key, and model ID in the settings page, as well as advanced JSON templates, Headers, and response extraction paths for custom APIs. It also supports YAML fallback configuration and hot reload.
Installation and Enablement¶
Add the plugin using the official installation command:
dsh plugin --profile web add github:chuling-lingling/dsh-plugin-use-images
After installation, restart dsh web to apply the changes.
Typical Usage¶
- Select an image model in the model selector in the chat box.
- Add an endpoint in the “Image / Video API” section of the settings page, then fill in the Base URL, API Key, and model ID.
- Send text in the chat interface. The text is sent as a prompt to the image API, and the response is converted into DSH-native image blocks and saved to session attachments.
Applicable Scenarios and Notes¶
- Node Version Requirement: The runtime environment must have Node.js >= 20 installed.
- Model ID Rules: DSH model IDs support only lowercase letters, digits, and
-. - Performance Limits: The default maximum download size per image is 20 MiB, and the default total timeout for generation and download is 120 seconds.
Closing¶
By uniformly adapting HTTP image APIs to DSH models, this plugin simplifies the process of using external image generation services in DSH. Full configuration examples and source code are available on GitHub.