Preface¶
When building conversational agents in DeepSeek Harness (dsh), text models cannot generate images on their own. The common approach is to run separate scripts or call image generation APIs independently and then paste the image path back into the conversation. This fragmented workflow hinders subsequent image processing by multimodal models.
dsh-image-relay transforms “text-to-image” into an image_generate tool that the model can call directly. Requests are routed through your configured OpenAI-compatible relay service, and the generated results are retained as attachments within the DSH conversation. The following sections introduce what it is, how to install it, how to configure it, and important usage notes.
What is this?¶
Maintained by Bai-Ziyi. The plugin is categorized as a “Network Tool” in the SkillHub Directory. Source code and documentation are available at GitHub: Bai-Ziyi/dsh-image-relay (MIT License, current package version 0.2.0).
In short: It generates images based on text prompts via the /images/generations endpoint of any OpenAI-compatible relay service and attaches them to the current DeepSeek Harness conversation. The plugin does not hardcode relay addresses or models, nor does it transmit API keys to any destination other than your configured Base URL.
Core Features¶
Verified via the README, the plugin provides the following capabilities:
- Tool
image_generate: Invoked only when the model determines an image is required; it does not automatically generate images in batches. - Parameters:
promptis required;sizeandmodelare optional. If not provided, defaults from the plugin configuration are used. - Result Format: Supports relay responses containing
b64_jsonorurl. If a URL is returned, the plugin downloads the image. Images are persisted via the DSH attachment service, allowing them to be viewed within the session and processed by models that support image input. - Optional Local Copy: If a “Save Directory” is configured, the plugin writes a file (with extensions like
.pngor.jpg) to the specified directory in addition to the attachment library, and returns the absolute path in the tool result. - Outbound Network: Requests utilize the Host’s global
fetch, and any configured DSH outbound proxy will be applied.
Explicitly Not Supported: Image-to-image, image editing, n>1, quality, and other capabilities beyond the minimal set of the OpenAI-compatible /images/generations API.
Installation and Activation¶
Installation commands follow the repository README. Choose one based on your active profile.
# Web profile
dsh plugin --profile web add github:Bai-Ziyi/dsh-image-relay
# Profile for desktop use
dsh plugin --profile desktop add github:Bai-Ziyi/dsh-image-relay
After installation, restart DSH once, then open Plugins → Installed → Image Relay → Configure to fill in the relay service information.
Compatibility: The README specifies compatibility with DSH 0.2.x, tested on 0.2.1-rc.2. The client configuration page relies on the “Plugins” capability of the same DSH version (registered on the client side via plugins.row.config).
Configuration¶
Fill in the following fields on the configuration page (see the table below for meanings and default values).
| Field | Default | Description |
|---|---|---|
| Base URL | Empty | OpenAI-compatible address, e.g., https://your-relay.example/v1. |
| API Key | Empty | Key for the relay service. The UI allows switching between visible/hidden; hidden by default. |
| Model | Empty | The image model ID required by the relay service. |
| Default Size | 1024x1024 |
Used when size is not specified in the call. |
| Timeout | 180000 |
Maximum wait time in milliseconds for a single generation. |
| Save Directory | Empty | Optional. If left empty, only saved to the attachment library. Relative paths are based on the current workspace; absolute paths are also supported. |
Security and Permissions: The API Key is stored in plaintext within the profile’s cordis.patch.yml. Use a key that is only valid for the relay service and can be revoked at any time; do not use long-term master account keys. The key is only included in the Authorization header sent to your configured Base URL.
If a “Save Directory” is provided, the copy is written with Host privileges, so please only specify a trusted directory. If left empty, images are saved only to the DSH attachment library.
Typical Usage¶
Once configured, simply describe your request in natural language within the conversation, for example:
Draw a 1024x1024 orange cat avatar, flat illustration style, white background
The model will call image_generate to request the image from the relay service based on your description. The returned image will be displayed as an attachment in the conversation. If the relay service returns a URL directly, the result will also include that URL.
How it Works (Brief)¶
With the configuration above, a single generation request follows these general steps:
- Send a JSON payload to
POST {Base URL}/images/generations:{ model, prompt, size }. - Parse the
b64_jsonorurlresponse; download the image if a URL is provided. - Persist the image via the DSH attachment service for session history and future multimodal processing.
- If a save directory is configured, write a copy with an appropriate extension and return the absolute path.
Use Cases and Notes¶
Suitable for: Developers using DSH 0.2.x who have an OpenAI-compatible text-to-image relay service and want “speak-to-draw” functionality within their conversations, with images retained in the conversation attachment chain.
Notes:
- The plugin runs with the permissions of the current
dshprocess. Before installation, please review the source code and license to ensure it meets your security and compliance requirements. - SkillHub is a community directory and has no official affiliation with DeepSeek or High-Flyer. Stars and versions are subject to the repository fetched at installation time (the directory currently shows 0 stars; package version
0.2.0). - Relay quota is only consumed when the model actively calls the tool. If Base URL, Model, or Key are not configured, the plugin logic should reject invalid requests (dev-side mock fetch covers these paths; see
npm testin the repository).
Conclusion¶
dsh-image-relay integrates OpenAI-compatible relay services into the DSH tool layer, allowing text-to-image generation, conversation, attachments, and optional workspace persistence to occur within a single workflow, without binding to specific vendors or relay addresses.
- Directory Page: https://www.skillhub.cn/plugins/Bai-Ziyi/dsh-image-relay
- GitHub: https://github.com/Bai-Ziyi/dsh-image-relay