Introduction

When integrating a local AI backend into DeepSeek Harness (DSH) for game art development, you often need to handle asset persistence paths, format conversion, and workflow-to-canvas interaction. The godot-imagegen plugin is designed to connect a locally installed SD WebUI or ComfyUI backend to DSH. Through ten image_* tools, it lets you generate, edit, upscale, or perform cutout directly in the conversation. It also provides an “Art Workshop” panel in the sidebar, automatically writes output into the Godot project directory, and provides res:// paths for quick registration.

Core Capabilities

The plugin provides a complete set of workflow tools and panel features:

  • Model tools (10): Includes status query (image_backend_status), generation (image_generate), editing (image_edit), variants (image_variants), upscaling (image_upscale), cutout (image_cutout), interrogate (image_interrogate), gallery (image_gallery), workflow (image_workflow), and workshop (image_workshop).
  • REST API (/gig/*): Provides a same-origin channel between the panel and the host. Supports backend status, gallery, generation/editing/upscaling/cutout/interrogate tasks, task polling and cancellation, backend start/stop, settings and presets, and workflow library read/write operations.
  • Workflow library: Stored locally at $DSH_HOME/godot-imagegen/workflows/, contains six game art templates, and supports creating or modifying workflows.
  • Better-Sidebar tab “Art Workshop”: Lays out according to available width (three columns at width ≥ 700px: Gallery/Canvas/Parameters; stacked vertically when narrow). Provides prompt presets, task progress, gallery lightbox (upscale/cutout/interrogate/send to chat/register asset/delete), and other features.
  • Standalone KV unit: godot_imagegen, used to persist gallery records, user presets, and settings.

Canvas Bridging Mechanism

Due to browser security restrictions, the panel cannot directly manipulate ComfyUI nodes embedded in an iframe. The plugin uses a ComfyUI web extension distributed with the plugin to communicate between the conversation and the canvas via the postMessage mechanism.

  • Panel relay: The panel acts as a relay, passing commands to the canvas through postMessage and returning canvas status to the host. The panel must remain open to drive the canvas.
  • Queue retention: While the panel is closed, canvas commands remain in the queue for 10 minutes and are automatically delivered the next time the panel is opened.
  • Canvas collapse: The canvas section is collapsed by default. If loading fails, it automatically expands and marks the error.
  • Channel responsibilities:
    • The form manages SD WebUI only, while all ComfyUI parameters and operations are delegated to the canvas.
    • The ComfyUI channel in this plugin currently supports text-to-image and image-to-image only. For ControlNet, upscaling, and interrogate features, use the SD WebUI channel.
    • A ComfyUI instance opened externally in the system browser is not included in this channel.

Usage Examples

Invoke the above features through conversation or panel commands:

  1. Check canvas connection status:
    image_workshop action="bridge-status"
  1. Install canvas bridge:
    image_workshop action="install-bridge"
*Note: You must back up before installation and restart ComfyUI after installation.*
  1. Operate workflow:
    # 打开面板并推送到画布
    image_workflow action="open" id="item-icon"
    # 仅在面板打开,不动画布
    image_workflow action="open" id="item-icon" to_canvas=false
    # 改写工作流并推送到画布
    image_workflow action="patch" id="item-icon" edits=[...] to_canvas=true
  1. Read canvas content:
    image_workshop action="read-canvas"

Deployment and Notes

  • Token and backup: When installing the canvas bridge, the token is baked into the copy of the ComfyUI extension. Back up before installation; restart ComfyUI after installation.
  • Uninstall cleanup: When uninstalling the extension, only files and directories created during installation are removed; no other content is touched.
  • Status detection: The panel online detection interval is 15 seconds, and the canvas heartbeat interval is 60 seconds.

References

  • GitHub repository: https://github.com/LINinLIN-0079/godot-imagegen
  • Plugin directory: https://www.skillhub.cn/plugins/LINinLIN-0079/godot-imagegen