Preface¶
The core design philosophy of DeepSeek Harness (DSH) is “Everything is a plugin.” For developers, a common requirement is enabling Agents to directly invoke locally running graphical tools (such as ComfyUI). Traditional methods require writing extensive API adaptation code or using script intermediaries. DSH’s Agent plugin mechanism provides a solution: by integrating dsh-comfyui-agent, the Agent can directly read your locally saved ComfyUI canvas workflows, modify parameters, execute image generation, and display the results directly within the conversation.
Plugin Introduction¶
dsh-comfyui-agent is a tool plugin designed for DeepSeek Harness 0.2.0-rc.2, maintained by developer Nana7mi0721. It resolves the pain points of communication between the Agent and local ComfyUI, allowing the Agent to control ComfyUI just like operating a local program.
- Core Value: Directly drives local ComfyUI to run saved workflows, with generated images displayed directly in the conversation.
- Compatibility: Compatible with DSH 0.2.0-rc.2 (
@deepseek-ai/dsh-tools0.2.0-rc.2 / cordis 4.x). This plugin does not depend ondsh-settings, so it can be installed and used directly. - License: MIT.
Core Functions¶
This plugin registers five tools, covering the complete workflow from status detection to result display:
-
comfyui_status
- Function: Health check. Used to confirm ComfyUI version, queue length, paths, and the list of available models.
- When to use: Run this first before the initial use to ensure the connection is normal.
-
comfyui_nodes
- Function: Search for node classes or check the input definitions of a specific class.
- When to use: Use when unsure about the specific parameters required by a node.
-
comfyui_workflows
- Function: Manage locally saved canvas workflows.
- Usage:
action:"list": Lists workflow names, node counts, and output nodes.action:"params": Lists adjustable parameters (grouped by node, with value ranges).action:"get": Prints the complete API workflow (for diagnostics, consumes tokens).
-
comfyui_run
- Function: Actually runs the image generation.
- Usage: Executes via
file(canvas workflow name),template(built-in template), orworkflow(custom API workflow object).
-
comfyui_show
- Function: View or upload images.
- Usage:
action:"latest": View recent outputs (default 6 images).action:"view": Retrieve image by filename.action:"upload": Transfer local images to ComfyUI’sinput/directory (required for img2img).
Installation and Configuration¶
After the plugin is installed, configuration items are written to ~/.dsh/profiles/desktop/cordis.patch.yml.
Installation Steps:
- Ensure your DSH version is 0.2.0-rc.2.
- Execute the following command to install the plugin to the desktop profile:
dsh plugin --profile desktop add \
https://github.com/Nana7mi0721/dsh-comfyui-agent/releases/download/v0.1.3/dsh-comfyui-agent-0.1.3.tgz
Configuration Description:
During installation (or via subsequent modification), you need to configure the ComfyUI connection information. The configuration items are as follows:
| Field | Default Value | Description |
|---|---|---|
baseUrl |
http://127.0.0.1:8188 |
The HTTP service address of ComfyUI. The core defaults to listening only on 127.0.0.1; --listen must be added for cross-machine access. |
comfyuiDir |
E:\ComfyUI\ComfyUI |
The ComfyUI main directory (reads output/, input/, user/default/workflows/) |
workflowsDir |
Empty | If empty, automatically uses <comfyuiDir>/user/default/workflows |
timeoutMs |
120000 | Timeout for a single HTTP request |
pollIntervalMs |
1200 | Polling interval when waiting for execution results |
runTimeoutMs |
1800000 | Upper limit for a single run to complete (30 minutes) |
toolTimeoutMs |
2400000 | Upper limit for a single tool call (40 minutes) |
Typical Usage¶
Below is a typical conversation flow where an Agent modifies canvas parameters and regenerates an image:
-
List Parameters: First, check what adjustable parameters exist in the canvas.
> Agent:comfyui_workflows {action:"params", name:"anima v2"}
> Output: Sees that node 765:709 is steps. -
First Image Generation: Generate an image using default steps (e.g., 12).
> Agent:comfyui_run {file:"anima v2", inputs:{"765:709":{"value":12}}, savePrefix:"silver"} -
Modify Parameters and Regenerate: Change the steps to 20.
> Agent:comfyui_run {file:"anima v2", inputs:{"765:709":{"value":20}}, savePrefix:"silver20"}
Notes and Limitations¶
When using this plugin, please note the following facts:
- Pure Frontend Nodes Will Be Skipped: If the workflow contains pure frontend nodes (such as Note, Fast Muter, or rgthree switches without server-side implementations), these nodes will be skipped. If downstream connections are broken due to skipped nodes, this will be explained in the
warningsof the tool reply. - VRAM Limitations: With 8GB of VRAM, it is recommended not to concurrently submit multiple large workflows to avoid OOM (Out of Memory).
- Version Dependency: DSH 0.2.0-rc.2 or higher must be installed.
- Image Display: By default, up to 4 images are displayed (upper limit 12). Explicitly setting
0will return only the paths without displaying images.
Summary¶
dsh-comfyui-agent achieves automation of local drawing tasks by transforming ComfyUI’s graphical workflows into instructions executable by the Agent. It does not rely on additional configuration management libraries; instead, it mounts tools directly via cordis. With simple configuration, it empowers the Agent with the ability to operate local drawing software.
- GitHub Repository: https://github.com/Nana7mi0721/dsh-comfyui-agent
- Community Directory: https://www.skillhub.cn/plugins/Nana7mi0721/dsh-comfyui-agent