Skip to content

Commit f16c1b3

Browse files
1.8.2 - Resiliency Improvements (#23)
* prove it works with multiple output nodes * prove it works for parallel workflows * test cases for parallel workflows * update contributions guide * architecture diagram * more resilient output checking * comments * log fixes * link to comfy * retry webhooks when they fail * finish comment
1 parent ff2702f commit f16c1b3

15 files changed

+1562
-173
lines changed

ComfyUI API Diagram.png

360 KB
Loading

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ComfyUI API - A Stateless and Extendable API for ComfyUI
22

3-
A simple wrapper that facilitates using ComfyUI as a stateless API, either by receiving images in the response, or by sending completed images to a webhook
3+
A simple wrapper that facilitates using [ComfyUI](https://github.com/comfyanonymous/ComfyUI/) as a stateless API, either by receiving images in the response, or by sending completed images to a webhook
44

55
- [ComfyUI API - A Stateless and Extendable API for ComfyUI](#comfyui-api---a-stateless-and-extendable-api-for-comfyui)
66
- [Download and Usage](#download-and-usage)
@@ -31,6 +31,7 @@ A simple wrapper that facilitates using ComfyUI as a stateless API, either by re
3131
- [Testing](#testing)
3232
- [Required Models](#required-models)
3333
- [Running Tests](#running-tests)
34+
- [Architecture](#architecture)
3435

3536
## Download and Usage
3637

@@ -44,7 +45,7 @@ If you have your own ComfyUI dockerfile, you can add the comfyui-api server to i
4445

4546
```dockerfile
4647
# Change this to the version you want to use
47-
ARG api_version=1.8.0
48+
ARG api_version=1.8.2
4849

4950

5051
# Download the comfyui-api binary, and make it executable
@@ -94,7 +95,7 @@ This guide provides an overview of how to configure the application using enviro
9495
### Environment Variables
9596

9697
The following table lists the available environment variables and their default values.
97-
The default values mostly assume this will run on top of an [ai-dock](https://github.com/ai-dock/comfyui) image, but can be customized as needed.
98+
For historical reasons, the default values mostly assume this will run on top of an [ai-dock](https://github.com/ai-dock/comfyui) image, but we currently provide [our own more minimal image](#prebuilt-docker-images) here in this repo.
9899

99100
| Variable | Default Value | Description |
100101
| ---------------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -114,6 +115,7 @@ The default values mostly assume this will run on top of an [ai-dock](https://gi
114115
| MODEL_DIR | "/opt/ComfyUI/models" | Directory for model files |
115116
| OUTPUT_DIR | "/opt/ComfyUI/output" | Directory for output files |
116117
| PORT | "3000" | Wrapper port number |
118+
| PROMPT_WEBHOOK_RETRIES | "3" | Number of times to retry sending a webhook for a prompt |
117119
| STARTUP_CHECK_INTERVAL_S | "1" | Interval in seconds between startup checks |
118120
| STARTUP_CHECK_MAX_TRIES | "10" | Maximum number of startup check attempts |
119121
| SYSTEM_META_* | (not set) | Any environment variable starting with SYSTEM_META_ will be sent to the system webhook as metadata. i.e. `SYSTEM_META_batch=abc` will add `{"batch": "abc"}` to the `.metadata` field on system webhooks. |
@@ -656,8 +658,12 @@ All of SaladCloud's image and video generation [recipes](https://docs.salad.com/
656658

657659
## Contributing
658660

659-
Contributions are welcome! Please open an issue or a pull request if you have any suggestions or improvements.
660-
ComfyUI is a powerful tool with MANY options, and it's likely that not all of them are currently supported by the comfyui-api server. If you find a feature that is missing, please open an issue or a pull request to add it. Let's make productionizing ComfyUI as easy as possible!
661+
Contributions are welcome!
662+
ComfyUI is a powerful tool with MANY options, and it's likely that not all of them are currently supported by the `comfyui-api` server.
663+
Please open an issue with as much information as possible about the problem you're facing or the feature you need.
664+
If you have encountered a bug, please include the steps to reproduce it, and any relevant logs or error messages.
665+
If you are able, adding a failing test is the best way to ensure your issue is resolved quickly.
666+
Let's make productionizing ComfyUI as easy as possible!
661667

662668
## Testing
663669

@@ -746,3 +752,10 @@ npm test
746752
This will take quite a long time, and requires a minimum of 24gb of RAM.
747753
I did these tests on my RTX 3080ti Laptop Edition w/ 16gb VRAM, and 24gb WSL RAM.
748754
It takes about 30 minutes to run all the tests.
755+
756+
## Architecture
757+
758+
The server is built with [Fastify](https://www.fastify.io/), a fast and low overhead web framework for Node.js.
759+
It sits in front of ComfyUI, and provides a RESTful API for interacting with ComfyUI.
760+
761+
![Architecture Diagram](./ComfyUI%20API%20Diagram.png)

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ services:
1717
ports:
1818
- "3000:3000"
1919
- "8188:8188"
20-
# environment:
20+
environment:
21+
LOG_LEVEL: "debug"
2122
# ALWAYS_RESTART_COMFYUI: "true"
2223
# SYSTEM_WEBHOOK_URL: "http://host.docker.internal:1234/system"
2324
# SYSTEM_WEBHOOK_EVENTS: all

docker/api.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FROM ghcr.io/saladtechnologies/comfyui-api:comfy${comfy_version}-torch${pytorch_
77
ENV WORKFLOW_DIR=/workflows
88
ENV STARTUP_CHECK_MAX_TRIES=30
99

10-
ARG api_version=1.8.0
10+
ARG api_version=1.8.2
1111
ADD https://github.com/SaladTechnologies/comfyui-api/releases/download/${api_version}/comfyui-api .
1212
RUN chmod +x comfyui-api
1313

0 commit comments

Comments
 (0)