The DSH ecosystem emphasizes “everything is a plugin.” When an agent needs to handle visual content, traditional approaches either rely on expensive cloud APIs or require complex local deployment. The dsh-generate-image plugin addresses the specific pain point of “letting the model draw images.” It reuses your locally logged-in Codex environment and exposes image generation capabilities directly to DeepSeek models.
What Is It¶
- Positioning: A DeepSeek Harness plugin.
- Maintainer: zemul.
- Core Value: Text-to-image and image-to-image generation via the local OpenAI Codex CLI, with no additional API key or build steps required.
Core Features¶
- Text-to-image and image-to-image: Exposes the
generate_imagetool to the Harness model. Supportsgenerate_image(prompt)to generate a new image, andgenerate_image(prompt, inputImage)to edit an existing image by passing its path. - Zero dependencies and zero build: Implemented in pure JS, with no npm package dependencies. It runs directly after installation without a build step.
- Result detection: Identifies newly generated images through a directory snapshot diff, without relying on parsing the model’s output text.
- Security and authentication: Supports timeout and signal protection, reuses Codex login (OAuth), and does not require an API key.
Installation and Enablement¶
Install it using the npx command (you do not need to install the dsh CLI locally; npx will automatically fetch the official dsh):
npx -y @deepseek-ai/dsh plugin --profile web add github:zemul/dsh-generate-image
This package has no lifecycle scripts, so pnpm will not request build authorization. If you are still prompted for build authorization, add the following to the pnpm-workspace.yaml in your profile:
allowBuilds:
dsh-generate-image: true
The changes take effect after restarting the GUI.
Typical Usage¶
The model can call it directly during the conversation:
- Text-to-image:
generate_image("生成一张赛博朋克风格的城市夜景图,霓虹灯紫蓝配色")
- Image-to-image:
generate_image("把 ./assets/hero.png 的背景换成渐变星空,保留前景主体", "./assets/hero.png")
The tool returns the absolute path of the generated image, so both the model and the user can reference it directly.
Use Cases and Cautions¶
- Prerequisites:
- Requires a local Codex CLI login (OAuth), and uses Codex’s built-in
image_gentool. - Consumes Codex/ChatGPT account quota (image generation is more expensive than text).
- Requires Node.js >= 18.
- Requires a local Codex CLI login (OAuth), and uses Codex’s built-in
- File storage:
- Images are stored by default in
$CODEX_HOME/generated_images/(default is~/.codex). - The plugin copies one to the output directory (the default working directory).
- Images are stored by default in
- Runtime permissions: The plugin runs with the permissions of the current dsh process. Before installing, please review the source code and license (MIT).
In Short¶
This plugin introduces local visual capabilities to the DSH plugin ecosystem. It bridges the model’s image-generation needs through the Codex CLI. For more details, refer to the GitHub repository or the DSH directory page.