mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[PR #18322] [CLOSED] Feat/perry comfyui exploration #24752
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18322
Author: @PerryPAN219
Created: 10/14/2025
Status: ❌ Closed
Base:
main← Head:feat/perry-comfyui-exploration📝 Commits (2)
3e95e7cScaffold Setup, setup guide and updated docker-compose configuration:529ac9afeat: Add ComfyUI integration with automatic workflow selection📊 Changes
12 files changed (+1221 additions, -168 deletions)
View changed files
📝
backend/open_webui/config.py(+13 -0)📝
backend/open_webui/env.py(+1 -0)📝
backend/open_webui/routers/images.py(+48 -34)📝
backend/open_webui/utils/images/comfyui.py(+230 -121)➕
backend/open_webui/utils/images/comfyui_uploader.py(+171 -0)➕
backend/open_webui/utils/images/templates/__init__.py(+50 -0)➕
backend/open_webui/utils/images/templates/fusion2imgs.py(+139 -0)➕
backend/open_webui/utils/images/templates/img2img.py(+93 -0)➕
backend/open_webui/utils/images/templates/text2img.py(+58 -0)➕
backend/open_webui/utils/images/workflow_selector.py(+139 -0)📝
docker-compose.yaml(+24 -13)➕
setupguide.md(+255 -0)📄 Description
🎨 ComfyUI Integration
Overview
Adds ComfyUI support to Open-WebUI with intelligent workflow selection based on the number of input images.
Features
✅ Text-to-image: Generate images from text prompts only
✅ Image-to-image: Transform a single input image based on prompts
✅ Image fusion: Blend two images together with prompt guidance
✅ Automatic workflow selection: System automatically picks the right workflow
✅ WebSocket communication: Real-time generation status
✅ Image upload: Seamlessly upload images to ComfyUI server
Architecture
New Modules
backend/open_webui/utils/images/
backend/open_webui/
├── routers/
│ └── images.py
└── utils/images/
├── comfyui.py
├── comfyui_uploader.py
├── workflow_selector.py
└── templates/
├── init.py
├── text2img.py
├── img2img.py
└── fusion2imgs.py
Workflow Selection Logic
text2imgworkflowimg2imgworkflowfusion2imgsworkflow (uses first 2)Configuration
Requires ComfyUI running with:
ws://127.0.0.1:8188)API Changes
No breaking changes. Extends existing
/api/v1/images/generationsendpoint with:input_images: Optional list of file IDs for img2img/fusionTesting
Example Usage
Text-to-image: