dsh-tool-comfyui: Generate images via local and LAN ComfyUI directly in DSH conversations

Preface

When building agents in DeepSeek Harness (DSH), if text-to-image generation is required, the common practice is to switch to the ComfyUI interface and click manually, or assemble ComfyUI’s HTTP API calls yourself. ComfyUI image generation is a two-stage protocol: first, POST /prompt to obtain a prompt_id, then poll /history/<id> until completion. If the conversation only has a generic web_fetch, it is difficult to close the loop on the “wait for the GPU to finish after submission” step. dsh-tool-comfyui is a community-maintained network tool plugin that registers three things—fleet detection, template-based image generation, and queue inspection—as tools callable by the Agent. Once installed, you can drive the ComfyUI fleet on your local machine or LAN using natural language in the chat.

What is this

  • Plugin Name: dsh-tool-comfyui (GitHub: yuehancn/dsh-tool-comfyui)
  • Maintainer: yuehancn
  • Category: Network Tool (SkillHub Directory: https://www.skillhub.cn/plugins/yuehancn/dsh-tool-comfyui)
  • Positioning: A self-built tool plugin for DSH; call the local/LAN ComfyUI fleet to generate images with a single sentence in dsh.
  • Compatibility: The README states it is built and tested on dsh 0.2.0-rc.2 (preview); the apply(ctx) plugin specification is stable, but if you are using a newer version of dsh, you should verify compatibility yourself.
  • License: MIT

The plugin runs with the permissions of the current dsh process and only accesses the workers[].url you configured. It is recommended to read the repository source code and license before installing or using it, and to confirm that the way ComfyUI is exposed meets your security expectations (ComfyUI has no authentication by default).

Core Functions

Once installed and enabled in the profile, it registers three model-callable tools:

Tool Function
comfyui_status Probe the entire fleet: who is online, ComfyUI version, GPU model/VRAM, queue depth; also lists available workflow templates.
comfyui_generate Generate images based on named workflow templates: submit prompt → wait for GPU to finish → download the resulting image locally and return the file path.
comfyui_queue Check the running/queue status of a specific machine, or interrupt and clear the queue with one click.

Polling is the reason for the plugin’s existence: bare web_fetch cannot achieve “waiting after submission,” so it must be written as cooperative logic within the plugin.

Key points regarding permissions and privacy from the README: The network only connects to the configured worker addresses (defaults are usually 127.0.0.1:8188 and LAN machines) and does not access third-party services; no API key is required; prompts are sent to your ComfyUI, and resulting images are written to outputDir; the plugin does not start processes (the start-comfyui-worker.bat in the repository is for manual double-clicking on素材机). The cancelAll of comfyui_queue will interrupt and clear the target machine’s queue, which is a destructive operation and should only be used when explicitly needed.

Installation and Activation

Supported profiles include desktop and web; you need to restart the corresponding profile after installation for the three tools to appear.

One-line installation (command from the source material):

dsh plugin --profile desktop add github:yuehancn/dsh-tool-comfyui

Replace desktop with your own profile name. The README also notes: If already published to npm, you can also use dsh plugin --profile desktop add dsh-tool-comfyui (provided as a comment).

When enabling the bundle, note: bundles must list the package name dsh-tool-comfyui for dsh to read its dsh.bundle.patch; declaring it only in dependencies without putting it in bundles does not count as enabled. For manual development installation paths and cordis.patch.yml examples, see the GitHub README; this article does not expand on the git clone process.

Configuring the Fleet

Override the plugin line in the profile’s cordis.patch.yml. The example structure is as follows (paths and IPs need to be modified according to your environment):

- id: tool-comfyui
  config:
    workers:
      - id: local5090
        url: http://127.0.0.1:8188
        label: RTX 5090D Main Machine
      - id: spark5060
        url: http://192.168.11.109:8188
        label: 5060 Ti Asset Machine A
    workflowsDir: <plugin directory>/workflows
    outputDir: C:/Users/<you>/Pictures/comfyui
    defaultWorkflow: txt2img
    maxBatchSize: 8
    timeoutMs: 900000

To add a machine, simply append an item to workers. Common configuration keys include: workers[] (required), workflowsDir (default workflows), defaultWorkflow (default txt2img), timeoutMs (default 600000), pollIntervalMs (default 2000), outputDir (default comfyui-output), maxBatchSize (default 8), as well as generate / status / queue to toggle the three tools respectively (all default to true).

If an asset machine needs to be called by dsh within the LAN, you can copy the start-comfyui-worker.bat from the repository to the asset machine and run it. For example, listening only to the local machine or listening on 0.0.0.0 (the README provides the 8188 lan usage); the script will first try to terminate pminer.exe to prevent the GPU from being fully occupied, which causes extremely slow image generation.

Workflow Templates

Templates are ComfyUI API format JSON, placed under workflows/. The filename is the template name (the repository comes with txt2img.json, etc.). The plugin injects parameters based on the node _meta.title. For example, when the title is prompt / positive / 提示词, it writes to args.prompt; negative / 负面 writes to args.negativePrompt; seed etc. writes to args.seed; nodes with batch_size can accept args.batchSize. It only overrides literal inputs and does not modify linked inputs. New template workflow: Export API format in ComfyUI → Change the title of nodes like CLIPTextEncode → Save as workflows/<name>.json → Specify workflow="<name>" when calling.

Typical Usage

Just state your intention directly in the conversation. README examples:

Help me generate an e-commerce image of a coffee cup on a white background
→ Calls comfyui_generate(prompt="a white ceramic mug on pure white background, e-commerce catalog photo")

First check if the asset machine is alive
→ Calls comfyui_status

Clear the queued tasks on 109
→ Calls comfyui_queue(worker="spark5060", cancelAll=true)

Generated images default to landing in a timestamped subdirectory under outputDir; the README example path looks like comfyui-output/2026-10-01T23-30-12-local5090/dsh_comfyui_00001_.png.

Applicable Scenarios and Notes

Suitable for: Developers or small teams who have already deployed ComfyUI locally or on a LAN and want to complete the closed loop of “check fleet status → select worker → generate image by template → get local path” within DSH Agent conversations.

Notes:

  1. The plugin does not replace ComfyUI’s own installation and model resource management; the worker must be started and the URL reachable (for LAN scenarios, the README suggests testing the TCP port first, don’t rely solely on ping).
  2. If comfyui_status shows all offline, the common reason is that ComfyUI is not started or the asset machine is not listening with lan.
  3. The README provides measured times on an RTX 5090D with SDXL 1024×1024 at 30 steps: approximately 15.1 seconds for a single image, 16.7 seconds for a batch of 2; two outputs with the same seed are byte-identical. This data comes from the maintainer’s environment; your hardware and workflow will differ.
  4. The community plugin directory (such as SkillHub) has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem philosophy is “everything is a plugin.” Base your selection on the repository README and source code.

Conclusion

dsh-tool-comfyui encapsulates ComfyUI’s submission and polling into three tools, allowing DSH to complete fleet detection, template image generation, and queue management within the chat, with network and file write boundaries clearly defined in the README. To install or check configuration details, you can view the directory page and GitHub repository:

  • Directory Page: https://www.skillhub.cn/plugins/yuehancn/dsh-tool-comfyui
  • GitHub: https://github.com/yuehancn/dsh-tool-comfyui
羽毛球分组比赛记分
小程序二维码

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

Xiaoye