dsh-comfyui-image: Run ComfyUI Locally to Generate Multimodal Assets

Introduction

DeepSeek Harness (DSH) extends its functionality through a plugin mechanism. Locally deployed model inference tools are a common requirement in agent development. If you want to use local GPU resources to generate images, videos, audio, and 3D assets without calling cloud APIs or incurring per-usage billing costs, the dsh-comfyui-image plugin provides a direct integration solution. It allows Harness to directly control a locally installed ComfyUI instance.

Plugin Overview

dsh-comfyui-image is a DeepSeek Harness plugin maintained by user QXingYShu. Its core value is: generating images, videos, audio, and 3D assets through a local ComfyUI instance, without API keys, without cloud service dependencies, and without per-generation billing costs. The plugin is licensed under MIT.

Core Features

The plugin registers the following tools and capabilities:

  • comfyui_generate: For text-to-image generation; it accepts a prompt and outputs parameters.
  • comfyui_templates: Browse the local template directory, inspect template inputs, or ask for model recommendations.
  • comfyui_run_template: Run a specific template and save the output.
  • comfyui_status: Report installed components and running status to troubleshoot generation failures.
  • comfyui-image skill: Provides model selection, prompt construction, sampler tuning, and negative prompt support, enabling agents to make proactive decisions.

In terms of the ecosystem, the plugin supports 116+ workflow templates across 67 open-source model families, covering image editing, video generation, ControlNet, depth estimation, background removal, upscaling, 3D, music, and audio processing.

Installation and Enabling

Installing this plugin requires DeepSeek Harness 0.2.0-rc.2 or a newer version.

dsh plugin --profile desktop add https://github.com/<you>/dsh-comfyui-image.git

After installation, Harness must be restarted. The plugin is loaded when the configured profile starts, so modifications to the lib/ directory or updates to the plugin code do not take effect at runtime. Only client-side plugins for the Web GUI support hot reloading; the tools and skills of this plugin all run server-side.

Configuration and Discovery

The plugin automatically detects the running status of ComfyUI. It checks the configured port and the ports 8188–8192 in turn to confirm whether the /system_stats endpoint responds. If no server is running, it automatically starts ComfyUI in headless mode.

If you need to specify the path manually, set the environment variable DSH_COMFYUI_PATH to point to the local ComfyUI checkout directory.

The main environment variable configuration items are as follows:

  • Port control:
    • DSH_COMFY_PORT: Force all workflows to use the same port (default is to probe 8188–8192).
    • DSH_COMFY_PORT_Z_IMAGE_TURBO / DSH_COMFY_PORT_QWEN_IMAGE_2_1: Force the port used by a specific template (Z-Image-Turbo or Qwen-Image-2.1).
  • Model paths:
    • DSH_ZIMAGE_MODELS / DSH_QWEN_IMAGE_MODELS: Override the default model file names; format is JSON.

For example, if you have a locally quantized Qwen-Image-2.1 model, you can configure it as follows:

export DSH_QWEN_IMAGE_MODELS='{"unet_name":"qwen_image_2.1_fp8.safetensors","clip_name":"qwen3vl_8b_fp8.safetensors","vae_name":"qwen_image_2.1_vae_bf16.safetensors"}'

Models and Download

The plugin downloads model weights by default through hf-mirror.com. This is done by setting the HF_ENDPOINT environment variable when the ComfyUI process starts, ensuring the huggingface_hub library rewrites all URLs on import.

Note: The plugin intentionally disables HF_HUB_ENABLE_HF_TRANSFER (enabled by default), because this Rust downloader does not support mirror sites, and enabling it will cause download failures.

The plugin itself does not proactively download models; instead, it reports the file list, sizes, licenses, and remaining space. A download is triggered only after user confirmation via download=true.

Typical Usage

In a DSH session, you can invoke tools directly using natural language. For example:

draw a small green plant in a terracotta

The plugin selects an appropriate template, model, and sampling parameters, and executes generation on the local GPU.

When configuring model names, you can override the defaults using an environment variable:

export DSH_QWEN_IMAGE_MODELS='...'

Notes

  1. Restart requirement: After installing or updating the plugin, Harness must be restarted for changes to take effect.
  2. Server-side execution: The plugin’s core tools (comfyui_generate, etc.) are server-side logic and must be restarted after code changes.
  3. Headless mode: ComfyUI does not need to be running beforehand; the plugin starts a headless process on first use and reuses that process subsequently.
  4. Template limitations: Not all templates can be run. The plugin checks whether model weights exist, rather than only checking template names.

Plugin catalog page | GitHub repository

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

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

Xiaoye