Skip to content

Add ComfyUI backend for Stable Diffusion image generation#6

Merged
cmsj merged 8 commits intomainfrom
copilot/add-comfyui-backend
Dec 13, 2025
Merged

Add ComfyUI backend for Stable Diffusion image generation#6
cmsj merged 8 commits intomainfrom
copilot/add-comfyui-backend

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 4, 2025

Adds ComfyUI as a modern alternative to the unmaintained A1111 backend for Stable Diffusion image generation.

Implementation

  • Backend (backend/comfyui.py): Workflow-based architecture using ComfyUI's native JSON format. Polls history API for completion, auto-injects prompts into CLIPTextEncode nodes. Supports txt2img and img2img via URL.

  • Entry point (dreambot_backend_comfyui.py): CLI launcher following existing backend patterns.

  • Configuration: Workflows exported from ComfyUI UI can be used directly. Multiple named workflows supported per instance.

Configuration Example

{
  "comfyui": {
    "host": "comfyui",
    "port": "8188",
    "default_workflow": "txt2img",
    "workflows": {
      "txt2img": {
        "workflow": {
          "6": {
            "class_type": "CLIPTextEncode",
            "inputs": {
              "text": "beautiful scenery",
              "clip": ["4", 1]
            }
          },
          ...
        }
      }
    }
  }
}

The backend automatically finds and updates the first CLIPTextEncode node with user prompts. Includes workflow validation and graceful error handling.

Testing

Added comprehensive test coverage for boot/shutdown, argument parsing, workflow listing, and validation.

Original prompt

In this repo you will find a chatbot that has various backend services it can talk to. One of these is A1111, an old web UI for Stable Diffusion image generation. Since A1111 is no longer maintained, I would like to replace this with ComfyUI. Please propose a Pull Request that adds a ComfyUI backend to dreambot.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 4, 2025 23:35
Co-authored-by: cmsj <353427+cmsj@users.noreply.github.com>
Co-authored-by: cmsj <353427+cmsj@users.noreply.github.com>
Co-authored-by: cmsj <353427+cmsj@users.noreply.github.com>
…, and remove unnecessary close() call

Co-authored-by: cmsj <353427+cmsj@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ComfyUI backend to dreambot Add ComfyUI backend for Stable Diffusion image generation Dec 4, 2025
Copilot AI requested a review from cmsj December 4, 2025 23:44
@cmsj cmsj marked this pull request as ready for review December 13, 2025 00:08
@cmsj cmsj merged commit df45188 into main Dec 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants