Introduction

The control scope of DSH Agent is currently mainly local scripts or general network services. For Stable Diffusion workflows (such as ComfyUI), manual operations are cumbersome and difficult to automate. dsh-comfyui-commander addresses this issue. Through DSH’s Subprocess capability, it allows the Agent to directly take over ComfyUI generation tasks, progress monitoring, and model management.

What is it

This is a plugin maintained by suika009. It communicates with the ComfyUI API through a Node.js helper process to enable natural-language control. It does not depend on an external runtime and only requires local Node >= 22.

Core Features

The plugin provides the following toolset:

  • Workflow Control: List workflows (comfy_list_workflows), load a workflow and convert it into API format (comfy_load_workflow), and modify arbitrary node parameters through overrides.
  • Task Execution: Submit generation tasks (comfy_submit), monitor progress in real time (comfy_get_progress, including queue position, current node, and sampling percentage), fetch results (comfy_fetch_results), and download them locally.
  • Batch Orchestration: Implement blocking waits through comfy_wait_task to chain multi-stage tasks (for example, generate storyboard frames first and then compose a video).
  • Model Management: Upload models (comfy_upload_model), move models (comfy_move_model), export archives (comfy_export_model), and audit disk usage (comfy_model_disk_usage).

Installation and Enablement

  1. Enter the DSH Profile directory:
    cd $DSH_HOME/profiles/<name>
  1. Install the dependency:
    pnpm add dsh-comfyui-commander
  1. Add the plugin line in cordis.patch.yml:
    - insert:
        - id: comfyui-commander
          name: 'dsh-comfyui-commander'
  1. Restart DSH.

Typical Usage

The Agent can orchestrate a series of operations through natural language, for example:

  1. Single Generation:
    “List workflows → load SDXL.json → change the prompt to ‘a cat, masterpiece’ → generate → download locally”
    Tool chain: comfy_list_workflows → comfy_load_workflow → comfy_submit(overrides) → comfy_get_progress → comfy_fetch_results(download).

  2. Batch Generation:
    “Generate 5 storyboard frames first; after all are complete, use a merge workflow to compose a video.”
    Tool chain: serial execution using comfy_wait_task.

Security and Limitations

  • Do not save, only submit: Any modification to an existing workflow applies only to the current submission and never changes saved workflow files.
  • Safety settings: Model file operations follow a default-safe principle, with dangerous operations requiring manual enablement. Deletion, overwriting, and modification are disabled by default. To use comfy_delete_model, set allowDelete to true in the configuration file and restart.
  • Known boundaries: Open workflow tabs are browser localStorage state and cannot be enumerated on the server side; dynamic Cordis plugins may be invisible in some deployments.

Summary

This plugin provides DSH Agent with a complete ComfyUI control plane, suitable for scenarios requiring automated generation, batch processing, and model management. For more details, refer to the plugin catalog or the GitHub repository.