In the DeepSeek Harness (DSH) ecosystem, adding multimodal capabilities to agents often requires manual handling of external services or complex integrations. The dsh-imagegen plugin integrates image generation directly into the conversation flow by registering the generate_image tool, allowing agents to request and display images during conversations.
Plugin Introduction¶
This is an image generation plugin for DeepSeek Harness 0.2.x, maintained by user little-traincar. It addresses the need for agents to call image generation APIs and display the results in the chat interface.
Core Capabilities¶
- Inline rendering: Generated images are attached to the conversation and rendered directly in the chat window, while same-origin
/imagegen/<file>links are also provided as an alternative. - Flexible configuration: Supports configuring model IDs per provider, aliases, and overrides at invocation time.
- Open provider table: Built-in Doubao Seedream and Alibaba Cloud Qwen; compatible with any OpenAI-compatible
/images/generationsendpoint (including gateways, relays, or local deployments). - No watermark: Sends
watermark: falseby default, with a toggle available for models that reject this field. - Text embedding: Text in prompts is embedded verbatim into the image without being rewritten.
- Image-to-image: Supports reference images via URL, local absolute path, or Data URI.
- Save to disk: All images are saved to
outDirby default. - Multiple candidates and fault tolerance: Providers supporting
supportsNcan generate multiple images in a single request; if some requests fail, successfully generated images are retained.
Installation and Activation¶
In Desktop mode, you must fully quit the application first before running the installation command:
dsh plugin --profile desktop add @little-traincar/dsh-imagegen
Restart the application to load the plugin.
Configuration¶
After installation, go to Settings → imagegen. You need to configure the API Key for the provider you are using.
- Built-in providers: The plugin includes configurations for Doubao and Alibaba Cloud Qwen; you only need to fill in the corresponding API Key.
- Custom providers: Supports any OpenAI-style
POST <baseUrl>/images/generationsinterface. Fill in the configuration in the Custom providers field, for example local Ollama:
{
"local": {
"baseUrl": "http://127.0.0.1:11434/v1",
"model": "x/flux2-klein",
"apiKeyOptional": true,
"sendWatermark": false,
"size": "1024x1024"
}
}
- Model ID: Model IDs can be modified individually in Settings → imagegen → Models, or configured centrally in
cordis.patch.yml. Aliases are supported, and you can specifyproviderandmodelat invocation time.
Usage Examples¶
Enter image generation requests directly in the conversation. The agent will call the generate_image tool, and the image will be rendered directly in the chat window.
For example:
“Draw a summer coffee-shop poster: retro magazine collage, cream yellow and coffee brown, portrait; headline ‘Summer Ice Cafe Festival’, subtitle ‘Half price for the second cup.’”
Notes and Uninstallation¶
This plugin requires DeepSeek Harness version 0.2.x (compatible with 0.2.0-rc.2 and 0.2.1-alpha.1).
To uninstall, you must fully quit the application first, then run:
dsh plugin --profile desktop remove @little-traincar/dsh-imagegen
Note: The uninstall command does not delete generated images (located in outDir) or the imagegen section in configuration files. Clean up manually if needed.
dsh-imagegen provides a flexible, watermark-free, and highly compatible image generation solution, suitable for scenarios where images need to be output directly within the conversation flow. For more details, see the GitHub repository.