A modern web interface for managing and executing ComfyUI workflows. This project provides a user-friendly way to upload, manage, and execute ComfyUI workflows through a clean web interface or API.
-
📁 Workflow Management
- Upload and store ComfyUI workflow JSON files
- Name and describe your workflows
- Browse and manage saved workflows
- Delete unused workflows
-
🎮 Workflow Execution
- Execute workflows with custom inputs
- Real-time progress tracking
- Support for text prompts, seed values, and numeric inputs
- Optional image inputs
- Download generated results
-
🔌 API Integration
- RESTful API for workflow management
- WebSocket support for real-time updates
- Comprehensive API documentation
- Session-based execution tracking
-
💅 Modern UI
- Clean, responsive design
- Mobile-friendly interface
- Real-time progress updates
- Intuitive workflow management
- Node.js (v14 or higher)
- Running ComfyUI instance
- npm or yarn
-
Clone the repository:
git clone https://github.com/ennisma/comfyui-workflow-hub.git cd comfyui-workflow-hub -
Install dependencies:
npm install
Note: If you're getting "npm not recognized" errors, you need to install Node.js first. See the detailed installation guide for step-by-step instructions.
-
Create a
.envfile in the root directory by copying the example:cp .env.example .env
Then edit the
.envfile with your configuration. -
Start the server:
npm start
-
Open your browser and navigate to
http://localhost:3000
If you prefer using Docker:
# Build the Docker image
docker build -t comfyui-workflow-hub .
# Run the container
docker run -p 3000:3000 -e COMFYUI_URL=http://host.docker.internal:8188 comfyui-workflow-hubSee the detailed installation guide for more options and troubleshooting.
GET /api/workflowsReturns a list of all saved workflows.
Response
{
"workflows": [
{
"id": "workflow-123",
"name": "My Workflow",
"description": "A sample workflow",
"created_at": "2024-03-20T12:00:00Z"
}
]
}GET /api/workflows/:idReturns details of a specific workflow.
Response
{
"id": "workflow-123",
"name": "My Workflow",
"description": "A sample workflow",
"created_at": "2024-03-20T12:00:00Z",
"workflow_json": { ... }
}POST /api/upload-workflow
Content-Type: multipart/form-dataUpload a new workflow JSON file.
Parameters
workflow(file, required) - The workflow JSON filename(string, required) - Workflow namedescription(string, optional) - Workflow description
Response
{
"id": "workflow-123",
"name": "My Workflow",
"message": "Workflow uploaded successfully"
}DELETE /api/workflows/:idDelete a specific workflow.
Response
{
"message": "Workflow deleted successfully"
}POST /api/upload-image
Content-Type: multipart/form-dataUpload an input image for workflow execution.
Parameters
image(file, required) - The input image filesessionId(string, required) - Current session ID
Response
{
"filename": "input-123.png",
"message": "Image uploaded successfully"
}POST /api/execute
Content-Type: application/jsonExecute a workflow with specified inputs.
Request Body
{
"workflowId": "workflow-123",
"inputs": {
"text_input": "sample prompt",
"seed": 42,
"image": "input-123.png"
}
}Response
{
"sessionId": "session-123",
"message": "Workflow execution started"
}GET /api/status/:sessionIdCheck the status of a workflow execution.
Response
{
"status": "running",
"progress": 75,
"message": "Generating image..."
}GET /api/images/:filenameRetrieve a generated image file.
Connect to the WebSocket endpoint for real-time updates:
const ws = new WebSocket('ws://localhost:3000/ws?clientId=YOUR_CLIENT_ID');
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Received:', data);
// Handle different message types:
// - progress: Execution progress updates
// - status: Status changes
// - result: Final results
// - error: Error messages
};Message Types
- Progress Update
{
"type": "progress",
"data": {
"progress": 75,
"message": "Generating image..."
}
}- Status Change
{
"type": "status",
"data": {
"status": "completed",
"message": "Execution completed"
}
}- Result
{
"type": "result",
"data": {
"images": ["output-123.png"],
"message": "Generation successful"
}
}- Error
{
"type": "error",
"data": {
"message": "Error executing workflow",
"error": "Invalid input parameters"
}
}The project structure is organized as follows:
comfyui-workflow-hub/
├── public/
│ ├── index.html # Main HTML file
│ ├── script.js # Frontend JavaScript
│ └── styles.css # Custom styles
├── api.js # Backend API implementation
├── package.json # Project dependencies
├── .env.example # Example environment variables
└── README.md # This file
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- ComfyUI - The awesome stable diffusion GUI
- Tailwind CSS - For the modern UI components
If you encounter any problems or have suggestions, please open an issue.
