dsh-comfyui-studio: Using Local ComfyUI in DSH to Generate Images and Short Videos

Preface

When models in DSH need to generate images, the common practice is to call cloud APIs: there is quota consumption, content moderation, and assets do not leave the local machine. dsh-comfyui-studio takes a different path: the plugin calls your local or remote ComfyUI directly. Image generation and short video generation are processed by the local GPU. Parameters are modified in the control panel within the app, and after modification, they are written back to cordis.patch.yml. After restarting, the configuration persists.

It belongs to Lcxy0316, the repository is dsh-comfyui-studio, and the directory page categorizes it under “Model Inference”. The README is tagged with version 0.2.0 and the MIT license. Below is an introduction to how to install and use it.

I. What is it

One-sentence positioning: It installs a “ComfyUI Console” for DeepSeek Harness. Models (agents) generate images and short videos by calling local ComfyUI through three tools. The plugin does not preset any local paths; after installation, it is empty and needs to be filled manually.

It is worth noting that the plugin directory page you see is an independent site and has no official affiliation with DeepSeek / Huanfang; it is not an official app store.

II. The Three Provided Tools

After installation, models can directly call three types of interfaces.

comfyui_generate

Image generation interface. All parameters are optional; omitting them falls back to the defaults in settings. Therefore, a single call comfyui_generate({ prompt: "..." }) is a complete invocation.

Parameter Type Description
prompt string, required Positive prompt, English works best
negative string Negative prompt, defaults to settings if omitted
width / height integer Pixels, automatically rounded to multiples of 8
steps integer Sampling steps
cfg number CFG strength
sampler string e.g., dpmpp_2m
scheduler string e.g., karras
seed integer -1 or omitted = random every time
batch integer Number of images at once
checkpoint string Checkpoint file name
filenamePrefix string Disk file name prefix

comfyui_video

Video generation interface, uses Wan 2.1 text-to-video, returns two artifacts: an mp4 file and its first frame png. The reason is that the chat interface only renders images and does not play videos; the first frame is the one that can be seen directly.

Parameter Type Description
prompt string, required Positive prompt, clearly describe the subject, action, and camera movement
negative string Negative prompt, defaults to settings if omitted
width / height integer Pixels, automatically rounded to multiples of 16 (4G VRAM suggests 480×832)
frames integer Number of frames, 4n+1, e.g., 49
fps integer Frame rate, e.g., 16
steps integer Sampling steps, Wan official uses 20
cfg number CFG, Wan official uses 6.0
shift number ModelSamplingSD3 shift, Wan2.1 uses 8.0
seed integer -1 or omitted = random
filenamePrefix string Disk file name prefix

comfyui_studio

Debugging and control interface, distinguished by action:

action Function
status Check connectivity, ComfyUI version, GPU and VRAM, default model, output directory
models List all checkpoints, VAEs, UNETs, and text encoders on the server
launch Start local ComfyUI (using python and parameters from settings)
stop Stop the process started by this plugin
interrupt Interrupt the currently running task

III. Installation and Enabling

Installation follows the order: “Get directory -> Put in profile -> Register -> Restart”.

1. Get the directory

The README provides a direct download zip method; after unpacking, you get the dsh-comfyui-studio directory:

https://github.com/Lcxy0316/dsh-comfyui-studio/archive/refs/heads/main.zip

2. Put into profile

cp -r dsh-comfyui-studio "$HOME/.dsh/profiles/desktop/node_modules/"

3. Register in package.json

Make two modifications in the profile’s package.json:

"dependencies": {
  "dsh-comfyui-studio": "file:./node_modules/dsh-comfyui-studio"
}
"dsh": {
  "profile": {
    "bundles": [
      "dsh-comfyui-studio"
    ]
  }
}

4. Restart DSH

The plugin’s built-in cordis.patch.yml will automatically take effect as a bundle layer; no user-layer additions are needed. Only when you need to override defaults, append to the end of the profile’s cordis.patch.yml:

- id: comfyui-studio
  name: dsh-comfyui-studio
  config:
    serverUrl: http://127.0.0.1:8188
    outputDir: D:/images

5. Four items to fill on first startup

The plugin does not preset any local paths; after installation, it is empty:

Field What to fill Consequence of leaving empty
checkpoint Click “Read Models” to pull a list from the server and select one Image generation will error directly, prompting you to select one
outputDir An absolute path you have, e.g., D:/images No saving to disk, images only return as attachments in the chat
comfyuiDir ComfyUI installation directory (the layer with main.py) The “Start Service” button will be unavailable
pythonPath The python.exe that can run ComfyUI Same as above

You can generate images without filling the first two items (as long as ComfyUI is already running), and the last two only affect one-click startup. The remaining fields (size, steps, prompts, etc.) vary by person, but you can run without changing them.

IV. Typical Usage: From Probe to Image Generation

First do a probe, then select the model, and finally generate images.

  1. Open the settings page and first check the Connection group. serverUrl defaults to http://127.0.0.1:8188, requestTimeoutMs defaults to 600000 (10 minutes). Running 832×1216 / 28 steps on 4G VRAM takes about 90–120 seconds, so the default timeout is generous.
  2. Click “Read Models” to pull a list from the server and select a checkpoint.
  3. Fill in outputDir, which is an absolute path you have, for example D:/images.
  4. Call comfyui_generate({ prompt: "..." }) to generate an image.

Common generation parameters: width, height, steps, cfg, sampler, scheduler, batchSize, seed. A common combo for SDXL Realism models is dpmpp_2m + karras + CFG 5–6 + 28 steps.

There are three layers of sources for prompts, with priority being “Tool call explicit > Prompt file > Settings default value”. The fields are positivePrompt, negativePrompt, positivePromptFile, negativePromptFile. The benefit of using prompt files is that changing words only requires editing the txt file, without touching the plugin or restarting.

In the Output group, outputDir empty means no saving to disk; saveToOutputDir defaults to true; filenamePrefix defaults to dsh; attachToConversation defaults to true, determining whether to embed the image back into the chat.

V. Hardware Presets

The settings page is arranged in 8 groups (Connection, Model, Generation Params, Prompt, Output, Video, Launcher, Advanced), plus four hardware presets:

Preset Size Steps CFG Batch Launch Args
Low VRAM 4G 832×1216 28 5.5 1 --lowvram --reserve-vram 0.4
Mid-range 8G 896×1216 30 6 1 --normalvram
High-end 16G 1024×1408 32 6 2 --highvram
Remote Server 1024×1408 30 6 2 (empty)

One point to keep clear: applying a preset only changes the staged values on the page; clicking “Save Settings” writes them back.

Experience with 4G VRAM: Keep batch at 1, do not exceed resolution 1024×1408; if you need larger, generate first and then upscale (Hires fix uses 4x-UltraSharp, denoise around 0.35).

VI. Need an extra step for video

Wan 2.1 text-to-video is not a “single checkpoint”; it is split into three files, all of which need to be put into the ComfyUI model directory:

File Put into Source
wan2.1_t2v_1.3B_fp16.safetensors models/diffusion_models/ Comfy-Org/Wan_2.1_ComfyUI_repackaged → split_files/diffusion_models/
umt5_xxl_fp8_e4m3fn_scaled.safetensors models/text_encoders/ Same repository → split_files/text_encoders/
wan_2.1_vae.safetensors models/vae/ Same repository → split_files/vae/

Direct connection to HuggingFace in China is generally not available; just change the domain to hf-mirror.com. The three files together are about 9.8 GB.

After placing them, click “Read Models” once, and then in the settings page “Video (Wan 2.1)” group, select the three items videoUnet, videoClip, and videoVae. Default values for the video group: videoWidth / videoHeight 480 / 832, videoFrames 49, videoFps 16, videoSteps / videoCfg 20 / 6.0, videoSampler / videoScheduler uni_pc / simple, videoShift 8.0.

VRAM reality: Wan2.1 1.3B can run on 4G, but it is slow; 480×832 / 49 frames / 20 steps takes minutes. First use frames=9, steps=4 to verify the pipeline, then increase from there. 1.3B is the only realistic choice for 4G VRAM.

VII. Troubleshooting

Phenomenon Cause Solution
Status badge is red, probe reports ECONNREFUSED ComfyUI is not running Click “Start Service”, or start it manually
“Start Service” button is grey comfyuiDir / pythonPath is incorrect Check if main.py is in the directory, if python can run
Image generation reports EXECUTION_ERROR Incorrect model name / VRAM overflow Click “Read Models” to verify the name; lower resolution or add --lowvram
Stuck in “Generating” for a long time First model load takes 30–60 seconds Wait; maxPollSeconds defaults to 900
Images do not display outputDir is not within the allowed scope Preview only allows reading files in outputDir and workspaceFolder
Settings changed but revert after restart Changed staged values without saving Click “Save Settings”

VIII. Who it’s for, what to note

Suitable for developers who already have local or remote ComfyUI and want models to generate images and videos locally without leaving the local machine, and are willing to fill in paths themselves in the settings page. People who don’t want to touch the local environment and just want to use ready-made cloud interfaces should not choose this plugin.

Two reminders. First, the plugin itself runs with the permissions of the current dsh process; you should check its source code and license before installing. Second, it does not pass through any cloud interfaces, so there is no quota consumption, no content moderation, and images and videos do not leave the local machine—this means the security boundary is entirely determined by your own ComfyUI environment.

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

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

Xiaoye