Introduction¶
When developing agents in DeepSeek Harness (DSH), you frequently need to invoke image generation capabilities. Common approaches include launching ComfyUI locally and submitting tasks one by one via command line or browser, or using an existing DSH plugin for remote calls. These solutions either require an additional frontend interface or lack real-time monitoring and interaction with a local ComfyUI instance.
dsh-comfyui-desk embeds ComfyUI operations directly into the “ComfyUI Workbench” panel in the DSH right sidebar, allowing DSH agents to manage the local ComfyUI’s system status, generation queue, workflows, and canvas, and to display generated images directly in conversations. It is a lean implementation with zero third-party dependencies.
What It Is¶
dsh-comfyui-desk is a DSH plugin maintained by han0han0le0ni, categorized as “Client.” It provides a “ComfyUI Workbench” panel in the DSH right sidebar, communicates with the DSH Host via HTTP routes, and registers a sidebar tab on the client. The plugin has no npm third-party package dependencies — the Host uses only Node.js built-in modules, and the Client uses only React.
The plugin implements a zero-dependency architecture: the Host registers HTTP routes, the Client registers a sidebar tab and Agent tools. It draws structural inspiration from the mature dsh-comfyui-studio, dsh-comfy, and dsh-comfyui-link plugins on GitHub, but has been streamlined.
Core Features¶
Sidebar “ComfyUI Workbench”¶
- System Status: GPU and CPU usage displayed as horizontal progress bars. GPU prioritizes utilization (via nvidia-smi); falls back to VRAM usage when no NVIDIA GPU is detected or utilization is unavailable. CPU prioritizes usage percentage; falls back to memory usage before the first sampling. Below each bar, the GPU model, VRAM/memory capacity are shown. Further down is the ComfyUI online status and queue (auto-refreshes every 4 seconds).
- Generation: First select a workflow (auto-lists all locally saved workflows; selecting one loads its model, size, and other parameters; if none is selected, a built-in text-to-image template is used). Then adjust positive/negative prompts, size, steps, CFG, seed, and batch size. Supports submit, interrupt, and clear queue. Switching workflows does not overwrite existing prompts. Seed defaults to
-1(random per generation); click “Random” to reset at any time; only manually entering a non-negative number fixes the seed. - Real-time Progress: Horizontal progress bar shows percentage, current node, and sampling steps. Turns green on completion, red on failure. Uses HTTP polling rather than WebSocket.
- Images: Thumbnails of the current generation / recent generations, fullscreen preview, previous/next navigation, download, and one-click save to the local image library.
- Input Images: Upload to ComfyUI’s
inputdirectory, auto-filled into the workflow’sLoadImagenode. - Local Image Library: In the “Image Library” tab, enter a folder path (or click “Browse…” to select a directory), then click “Apply Directory” to display images in that folder. Supports zoom preview, download, single or multi-select batch delete, and one-click “Open Folder” to organize in the system file explorer. The path is remembered; reopening the panel auto-restores it. Leave empty to use the default directory
~/Pictures/DSH-ComfyUI. On the generation page, clicking “Save” in the top-right corner of an image copies the ComfyUI output to the current library directory. - AI Prompt Writing: Model defaults to selection from the DSH model library dropdown (grouped by provider), defaulting to the current DSH session model. Feed it a Chinese idea and it generates an English prompt and fills it back in.
- Workflow Auto-detection: Automatically scans the local ComfyUI’s
user/default/workflowsdirectory, lists all saved workflows. Selecting one loads its parameters (prompt fields are only filled back if empty; existing content is preserved; seed is always treated as random). The last selection is remembered; reopening the panel auto-restores it. Manual loading of other JSON files is also supported. - Workflow Canvas: The workflow page renders the ComfyUI native node graph — node cards color-coded by category, connected with Bézier curves. Supports mouse-centered scroll zoom, right-click/middle-click/Shift+drag pan, dragging node title bars to reposition, box-select then Delete to remove, and editing control values in node input fields with Enter to commit. Clicking a node locates it in the mapping below.
- Bidirectional Canvas Sync: Changing node positions/control values/deleting nodes in the DSH canvas writes back to the disk workflow file and syncs to the ComfyUI canvas in real time. After clicking “Save Workflow” in ComfyUI, the DSH canvas auto-refreshes (see details below).
- Workflow Node Mapping: View nodes/connections/inputs, and directly edit
nodeID.inputNamebefore generating. - Settings: ComfyUI URL, AI model (DSH model library dropdown, with a “Follow Current Session” option), canvas sync toggle and bridge detection. Can click “Refresh Model Library” to re-fetch. Settings are stored in browser local storage.
DSH Agent Tools¶
The plugin provides 10 Agent tools: comfy_desk_status, comfy_desk_generate, comfy_desk_draw, comfy_desk_progress, comfy_desk_history, comfy_desk_images, comfy_desk_show, comfy_desk_prompt, comfy_desk_workflows, comfy_desk_workflow_map.
comfy_desk_show: Can display images from the local image library directly in the conversation. Works even when ComfyUI is offline; the/viewproxy falls back to a same-named file in the local image library when ComfyUI is unreachable.comfy_desk_generate: Submits a task only, returns prompt_id.comfy_desk_draw: Generates images directly in the DSH conversation — waits for generation to complete, registers the output image as a conversation attachment (so the model can also see the image), and outputs a[comfy: …]marker; the plugin frontend decorator replaces it with a same-origin image, displaying a large image inline in the conversation with click-to-fullscreen. Supports generating multiple images at once. Examples: “Draw a cat,” “Draw me a cyberpunk city,” “Draw two cats, one at 512×512.”
AI Auto-Workflow Selection¶
No need to mention tool names or workflow names: simply express “I want to see an image” in the conversation, and the AI will automatically invoke comfy_desk_draw and pick the most suitable one from locally saved workflows.
- Identifies purpose based on visual description: general image → text-to-image; mentions of video/upscaling/inpainting/image-to-image/motion → corresponding workflow.
- Chinese descriptions prefer workflows with “中文” (Chinese) in the name (e.g.,
SDXL_Illustrious_中文文生图); English descriptions select the corresponding non-Chinese version. - Sorted by model quality (SDXL > Chroma > Qwen > SD15); the result includes “AI selected workflow: xxx.”
- Workflow names support fuzzy matching: even “SD15文生图” or “sd15 文生图” will match
SD15_文生图.
You only need to specify workflowName when explicitly naming a workflow (e.g., “Use SD15_文生图 to draw a cat”). When the intent involves upscaling/inpainting/video that requires a source image, the AI won’t force generation but will prompt you to load the workflow in the sidebar panel and specify the image.
comfy_desk_generate only submits a task and doesn’t return images, suitable for “queue it up, check later” scenarios. It also auto-selects a workflow.
You can also ask the AI to check GPU status, list workflows (each annotated with purpose/model), write prompts, or analyze a workflow.
Installation & Activation¶
Environment requirements:
- DSH >= 0.2.2-rc.1 (verified on 0.2.2-rc.5)
- Node.js >= 20 (verified on 22.22.2)
- ComfyUI listening on 127.0.0.1:8188 (verified on 0.46.0)
- No npm third-party packages; Host uses only Node built-in modules, Client uses only react
After installation, completely quit DSH (right-click the tray icon to exit) and reopen it, otherwise the client entry won’t be registered. After reopening, find “ComfyUI Workbench” in the right sidebar’s panel tabs.
Method A: Install from npm (Recommended)¶
dsh plugin --profile web add dsh-comfyui-desk
--profile should be the profile name you’re currently using. DSH Desktop commonly uses web (as on this machine); some installations use desktop. You can run dsh plugin list first or check the harness/profiles/ directory to confirm. Omitting --profile uses the CLI default profile, which may not be the one you’re viewing in the UI.
Method B: Install from Local Directory (Development/Debugging)¶
In DSH, go to “Plugins” → Install from local directory, and select this repository’s directory. Equivalent command-line syntax (replace dsh with your DSH CLI path, profile name as above):
dsh plugin --profile web add "link:<absolute path to this repo>"
Method C: Manually Attach to an Existing Profile¶
- Link/copy this directory to the profile’s
node_modules/dsh-comfyui-desk - Append the following to the end of that profile’s
cordis.patch.yml:
- insert:
- id: dsh-comfyui-desk
name: dsh-comfyui-desk
config:
baseUrl: http://127.0.0.1:8188
requestTimeoutMs: 10000
libraryDir: ''
llmProvider: ''
llmModel: ''
- Completely quit and reopen DSH (right-click the tray icon to exit; just refreshing the page is not enough), then find “ComfyUI Workbench” in the right sidebar’s panel tabs.
The
libraryDirin the config is the default library directory (leave empty to use~/Pictures/DSH-ComfyUI). In practice, it’s more recommended to specify it in the panel’s “Image Library” tab — the path is saved in browser local storage and takes effect immediately for the current panel.
The AI model prioritizes the selection from the panel’s “Settings” DSH model library; if left empty, it automatically follows the DSH current session model (agentDefaultModel). ThellmProvider/llmModelin the config serve only as fallbacks and generally don’t need to be filled in. The model library is read via the Host route/llm-modelscallingllm.listProviders()+llm.listModels().
Typical Usage¶
Generate images directly in the DSH conversation:
- “Draw a cat”
- “Draw me a cyberpunk city”
- “Draw two cats, one at 512×512”
The AI will automatically invoke comfy_desk_draw and select the most suitable text-to-image workflow from locally saved workflows to execute.
If you only want to submit a task without immediately viewing the result, you can express an intent like “Generate a cyberpunk city image, queue it up first” in the conversation, and the AI will call comfy_desk_generate and return the prompt_id.
In the DSH sidebar “ComfyUI Workbench” panel:
- Select a workflow
- Fill in prompt, size, steps, CFG, seed, batch size
- Click submit or interrupt
- View real-time progress and generation results
Use Cases & Notes¶
Suitable for DSH agent developers who frequently need to invoke local ComfyUI. The plugin runs with the current DSH process permissions; it’s recommended to review the source code and license (MIT) before installation.
Known limitations:
- Local ComfyUI 0.46’s /userdata/workflows returns 403; the plugin instead directly scans the disk directory (by default deriving user/default/workflows from ComfyUI’s --output-directory). If ComfyUI is installed in a non-standard location, add workflowDirs: ['D:/path/to/workflows'] in the dsh-comfyui-desk config in cordis.patch.yml.
- Canvas-format workflow conversion supports connections, muted nodes, and control values; bypassed nodes are not auto-reconnected and are skipped with a warning.
- Note / Reroute / PrimitiveNode in the canvas are pure UI nodes and are automatically stripped on submission (Reroute is pass-through reconnected to downstream), with a warning issued. Similarly, custom nodes not installed locally are also skipped to avoid ComfyUI returning 400 missing_node_type.
- The widgets_values order in canvas exports may differ from the backend schema (e.g., KSampler has an extra control_after_generate after seed); conversion realigns based on non-link inputs to ensure steps / cfg / sampler parameters don’t get misaligned.
- Progress uses HTTP polling rather than WebSocket; sufficient for displaying node progress but not frame-by-frame preview like the native interface.
- Bidirectional sync requires restarting ComfyUI to load the bridge extension; and the ComfyUI → DSH direction depends on workflow save-to-disk, so unsaved canvas changes won’t be detected by DSH.
- Canvas does not currently support reconnection or creating new nodes; for such modifications, use the ComfyUI native canvas and save — DSH will auto-refresh.
- Workflow field semantic recognition (positive/negative/sampler/latent) is based on common node types; a very small number of custom architectures may not be recognized, in which case you can directly edit nodeID.inputName in the node mapping.
- AI prompt writing requires the DSH session to provide an available llm service; the model is selected from the DSH model library, defaulting to the current session model. If the model library is empty, configure a provider in DSH settings first.
- DSH is in developer preview; after upgrading DSH, it’s recommended to re-run a self-check.
In Summary¶
dsh-comfyui-desk integrates local ComfyUI system monitoring, queue management, workflow editing, and bidirectional canvas sync into the DSH sidebar, and generates images directly in conversations. Through Agent tools, it enables agents to automatically select suitable workflows, making it ideal for DSH agent developers who frequently need image generation.
- Directory page: https://www.skillhub.cn/plugins/han0han0le0ni/dsh-comfyui-desk
- GitHub: https://github.com/han0han0le0ni/dsh-comfyui-desk