https://github.com/ShunL12324/comfy-portal-endpoint
https://github.com/ShunL12324/comfy-portal-endpoint
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ShunL12324/comfy-portal-endpoint
- Owner: ShunL12324
- Created: 2025-02-10T15:18:59.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-02-10T21:24:32.000Z (2 months ago)
- Last Synced: 2025-02-10T21:31:17.804Z (2 months ago)
- Language: Python
- Size: 107 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-comfyui - **comfy-portal-endpoint** - a modern iOS client application for ComfyUI. (All Workflows Sorted by GitHub Stars)
README
# ComfyUI Portal Endpoint Extension
This is a ComfyUI extension that provides additional API endpoints functionality, primarily designed to support [Comfy Portal](https://github.com/ShunL12324/comfy-portal) - a modern iOS client application for ComfyUI. These endpoints enable seamless integration between the mobile app and ComfyUI server, providing features like workflow conversion, listing, and saving capabilities.
## Installation
1. Navigate to ComfyUI's custom_nodes directory:
```bash
cd custom_nodes
```2. Clone this repository:
```bash
git clone https://github.com/ShunL12324/comfy-portal-endpoint
```3. Restart the ComfyUI server
## API Endpoints
### Workflow Conversion
- Endpoint: `/api/cpe/workflow/convert`
- Method: POST
- Description: Converts a ComfyUI workflow JSON format to API-compatible JSON format for programmatic API calls
- Request Body: ComfyUI workflow JSON data (the format you get when you save a workflow in the UI)#### Example Call
```bash
curl -X POST "http://localhost:8188/api/cpe/workflow/convert" \
-H "Content-Type: application/json" \
-d '{
"workflow": ""
}'
```### List Workflows
- Endpoint: `/api/cpe/workflow/list`
- Method: GET
- Description: Lists all available workflows in the user's workflows directory
- Response: List of workflow files with their metadata (filename, size, modified time)#### Example Call
```bash
curl "http://localhost:8188/api/cpe/workflow/list"
```### Save Workflow
- Endpoint: `/api/cpe/workflow/save`
- Method: POST
- Description: Saves a workflow JSON to the workflows directory
- Request Body:
- `workflow`: Workflow JSON string (required)
- `name`: Filename to save as (optional, will generate timestamp-based name if not provided)
- Note: `.json` extension will be automatically added if not present in the name#### Example Call
```bash
curl -X POST "http://localhost:8188/api/cpe/workflow/save" \
-H "Content-Type: application/json" \
-d '{
"workflow": "",
"name": "my_workflow"
}'
```## Development Notes
- This extension focuses on providing API endpoints, no custom nodes included
- All API endpoints are prefixed with `/api/cpe/`
- Uses aiohttp framework for handling API requests
- Implements a task queue system for workflow processing
- Includes error handling and timeout mechanisms## License
MIT