dsh-agnes-image: Using Agnes AI for Text-to-Image and Image-to-Image in DeepSeek Harness

Introduction

DeepSeek Harness (DSH) comes out-of-the-box with the ability to read and write files and execute commands, but it lacks native image generation capabilities. To “generate an image with a single sentence” in a conversation, you must either integrate a third-party image API and write a tool wrapper yourself, or install a community plugin. Below is an introduction to dsh-agnes-image, published by maintainer Naskete. It utilizes Agnes AI (default model agnes-image-2.5-flash) to perform text-to-image, image-to-image, and multi-image composition tasks. It has zero dependencies, is pure JavaScript, and requires no build step. The plugin is categorized under “Model Inference” on SkillHub. It is an unofficial community plugin released under the MIT license and is not affiliated with DeepSeek or Agnes AI.

What is this

dsh-agnes-image adds the tool agnes_generate_image to DSH. After the model understands your natural language, it calls this tool. The plugin sends the description (and optional reference images) to Agnes, receives the image, saves it to the current working directory, and displays it in the conversation.

Typical flow:

You speak → DSH Model → Calls agnes_generate_image → Agnes Cloud Generation → Local Save + Display in Conversation

Supported: Text-to-image, Image-to-image (style changes, background swaps, etc.), Multi-image composition.
Not Supported: Video, library management, batch queues, online editors.

Generated files default to generated-images/<date>/ under the working directory, organized into dated folders with timestamped filenames. Consecutive generations will not overwrite each other.

Core Features

Three Usage Modes

Mode You Provide Plugin Behavior
Text-to-Image Text description Primarily passes prompt along with size, ratio, etc.
Image-to-Image Description + One reference image (local path, public URL, or data:image/...) Reference image placed in image
Multi-Image Composition Description + Multiple reference images Multiple images placed in image in order

Local reference images are read and converted to base64 before requesting the API. PNG / JPEG / WebP / GIF are supported, with a maximum size of 12 MB per image.

Configurable Parameters (Can be specified verbally to the model)

Parameter Description Default
prompt Image description (Required) —
size 1K / 2K / 3K / 4K, or e.g., 1024x768 1K
ratio 1:1, 3:4, 4:3, 16:9, 9:16, 2:3, 3:2, 21:9 1:1
model agnes-image-2.5-flash / 2.1-flash / 2.0-flash 2.5
image Reference image None
outputName Output filename (without extension) Auto-generated from prompt

The configuration item outputDir can be used to change the output directory (defaulting to the aforementioned generated-images structure).

Implementation Characteristics

  • Pure JavaScript, no additional npm dependencies, no build step.
  • package.json requires Node >=22.19.0 (Command-line Harness requires this environment).
  • API keys are sent via HTTP header Authorization: Bearer ... to the configured baseUrl (defaults to the official Agnes address); the plugin declares it will not write keys to logs or echo them in conversations.

Installation and Setup

Prerequisites

  1. A working DSH (Desktop or Command-line version; plugins must be installed separately for each version).
  2. An Agnes AI account: Register at agnes-ai.com, create and copy the Key value starting with sk- (not the Key name) in the Developer Console API Key Management.

Install Plugin

--profile corresponds to the Harness version: usually desktop for the desktop version, and web for the command-line version. If unsure, run dsh plugin --profile web list to check.

Install from GitHub (Recommended in README):

dsh plugin --profile web add github:Naskete/dsh-agnes-image

Can also install from a local directory or a Release .tgz:

dsh plugin --profile web add D:\path\to\dsh-agnes-image
dsh plugin --profile web add D:\path\to\dsh-agnes-image-0.1.0.tgz

GUI Method: In Harness, go to Plugins on the left → + Add Plugin. You can enter the npm package name dsh-agnes-image or a local absolute path. The github:... format may not pass pre-checks in the interface, so use the command line instead.

Uninstall:

dsh plugin --profile web remove dsh-agnes-image

Configure API Key (One of three methods)

Method ① Key File (Recommended, changing key requires no Harness restart)

Windows: C:\Users\<username>\.dsh\agnes-image.config.json
macOS / Linux: ~/.dsh/agnes-image.config.json

{ "apiKey": "sk-your-key" }

Method ② Environment Variable (Requires Harness restart to take effect)

setx AGNES_API_KEY "sk-your-key"
export AGNES_API_KEY="sk-your-key"

Method ③ Profile Config (Edit ~/.dsh/profiles/<profile>/cordis.patch.yml)

- id: agnes-image
  name: dsh-agnes-image
  config:
    apiKey: sk-your-key

Except for Method ①, it is recommended to completely exit Harness and reopen it after modifying the config (For the desktop version, quit from the system tray, not just by closing the window).

Verification

Say something to Harness like:

Draw a picture of: a red panda wearing headphones painting, flat illustration style

On success, it should call agnes_generate_image, display the image in the conversation, and create generated-images/<current date>/xxx.png in the working directory. If it reports Agnes API key is missing, check the key file; 401/403 usually means the key is wrong; if the tool is missing, confirm installation and fully restart.

Typical Usage

No need to memorize commands; natural language works, for example:

  • “Draw a wallpaper of a sunset by the sea, 16:9”
  • “Create a header image for the README, flat style”
  • “Change D:\shots\room.png to a rainy cyberpunk night, keep the composition”
  • “Composite these two images into a poster, the first is the protagonist, the second is the product”

For precise control, specify the ratio and clarity directly, e.g., “Vertical 9:16, 2K” corresponds to ratio and size.

For image-to-image prompts, refer to the README structure: Change Requests + New Style/Scene + Elements to Add/Remove + Elements to Preserve.

One tool call returns one image; for multiple images, specify multiple times or let the model call repeatedly.

Use Cases and Notes

Suitable for: Quickly generating illustrations, changing styles, and compositing multiple assets within the DSH workflow. Relies on the Agnes image model (README states it is currently free, but subject to official Agnes pricing).

Permissions and Security: The plugin runs with the current DSH process privileges, making HTTP requests and writing images to the workspace only. It reads local files only when you (or the model) explicitly provide a path in image, and rejects non-image paths, oversized files, and non-image data: types. Prompts and reference images are processed by Agnes servers. It is recommended to review the GitHub Repository source code and MIT license before installing. Do not commit conversation directories containing keys to git.

Internet connection is required; video and batch queue management are not supported.

Conclusion

dsh-agnes-image connects Agnes AI’s image generation capabilities to the DSH toolchain, enabling text-to-image, image-to-image, and multi-image composition with a single sentence. Results are automatically saved and displayed in the conversation. Community Directory: SkillHub - Naskete/dsh-agnes-image; Source Code and Full Installation Instructions: github.com/Naskete/dsh-agnes-image.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye