dsh-qwen-paint: Invoking Local ComfyUI in DeepSeek Harness to Generate Qwen Images

Preface

DeepSeek Harness (DSH) is a local agent development environment. Generating images directly in a conversation usually requires calling a cloud API. The dsh-qwen-paint plugin solves this problem by allowing DSH to directly call locally running ComfyUI during a conversation and use the Qwen-Image 2.1 model for image generation. The entire process runs on 127.0.0.1, requires no API key, and requires no network connection.

Plugin Overview

This is a DSH plugin consisting of two parts: Host and Client. It registers a tool named draw_image.
* Host side: responsible for tool registration, automatically shutting down ComfyUI after 5 minutes of idle time, and mounting a read-only status endpoint.
* Client side: responsible for displaying the ComfyUI online status below the Composer, as well as displaying generated images inline.

Dependencies and Installation

Dependency Environment

The following conditions must be met before installation:
* ComfyUI: It must be running on 127.0.0.1:8188.
* Model files: Three Qwen model files are required (approximately 13.3 GB); see the instructions below for exact filenames and paths.
* GPU: NVIDIA GPUs work out of the box; AMD Radeon users are recommended to use the ROCm route (note: AMD cards may encounter silent failures).

Installation Steps

  1. Install via Plugin Manager
    After fully exiting DSH, use the following command to install the plugin:
    dsh plugin --profile desktop add link:<本目录>
After installation, you **must fully exit DSH and reopen it**, because the host-side tool manifest is assembled only once at startup.
  1. One-click deployment (recommended)
    The plugin provides an installation script that can automatically detect the environment and download model files.
    node scripts/setup.mjs
The script automatically locates ComfyUI, downloads the required three model files to the correct directories, and performs SHA256 verification. If the network disconnects midway, simply rerun it to resume from the interruption.
  1. Install the plugin bundle only
    If ComfyUI and the model files are already ready, you only need to mount the plugin:
    node scripts/install.mjs

Usage

After installation and restarting DSH, enter a description directly in the chat box. The assistant will call the draw_image tool.

Example:

画一只在雪地里的柴犬,逆光,胶片颗粒,电影感
给我画一张 16:9 的赛博朋克雨夜街景,霓虹反射在积水上
用同样的种子再画一遍刚才那张

Parameters:
* prompt: Required. Image description.
* size: Aspect ratio. Default is 1:1; supports 3:4, 16:9, and other ratios.
* megapixels: Total pixels. Default is 1.0.
* seed: Random seed. If left empty, each generation uses a different value.
* negative: Negative prompt. Note that negative prompts generally have little effect with the Qwen model.

Features

  • Purely local execution: No outbound network traffic; no API key required.
  • Automatic idle shutdown: If no action occurs for 5 minutes after generating an image, ComfyUI automatically shuts down to free VRAM.
  • Status visualization: Displays the ComfyUI online status below the Composer (green: online, yellow: busy, gray: offline).
  • Inline display: Generated images are displayed directly in the chat box rather than only as attachments.

Notes

  • Model restrictions: The model files are prohibited from commercial use.
  • VRAM usage: The three models together require approximately 14 GB of VRAM.
  • First load: The first image generation may be slow because the models need to load; please be patient.
  • AMD users: You may encounter silent failures; always visually inspect the image after generation.
  • Configuration file: To modify settings, edit cordis.patch.yml. This configuration is not overwritten when upgrading the plugin.
羽毛球分组比赛记分
小程序二维码

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

Xiaoye