Add ComfyUI backend for Stable Diffusion image generation#6
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.