Skip to content

Commit 65ab27b

Browse files
1.17.0 download improvements (#130)
* bump to comfy 0.8.2 * version bump to 1.17.0 * enhance downloading capabilities
1 parent 910c426 commit 65ab27b

16 files changed

Lines changed: 417 additions & 28 deletions

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ If you have your own ComfyUI dockerfile, you can add the comfyui-api server to i
7878

7979
```dockerfile
8080
# Change this to the version you want to use
81-
ARG api_version=1.16.1
81+
ARG api_version=1.17.0
8282

8383
# Download the comfyui-api binary, and make it executable
8484
ADD https://github.com/SaladTechnologies/comfyui-api/releases/download/${api_version}/comfyui-api .
@@ -597,6 +597,8 @@ pip:
597597
custom_nodes:
598598
- node-name-from-comfy-registry
599599
- https://github.com/username/repo
600+
- https://github.com/username/repo/tree/commit-hash-or-branch
601+
- https://github.com/username/repo@v1.0.0
600602
models:
601603
before_start:
602604
- url: https://example.com/model.ckpt
@@ -612,7 +614,13 @@ If a manifest is provided, the server will perform the following in order:
612614
613615
1. Install any apt packages listed in the `apt` field.
614616
2. Install any pip packages listed in the `pip` field. Uses `uv`, otherwise falls back to `pip`.
615-
3. Install any custom nodes listed in the `custom_nodes` field, using the `comfy` cli tool if available and a plain string is provided, or by cloning the provided git repository if a URL is provided. If cloned, `requirements.txt` will be installed if it exists, using `uv` if available, otherwise falling back to `pip`.
617+
3. Install any custom nodes listed in the `custom_nodes` field, using the `comfy` cli tool if available and a plain string is provided, or by cloning the provided git repository if a URL is provided. You can pin a specific commit, branch, or tag using various URL formats:
618+
- **GitHub**: `/tree/{ref}`, `/commit/{sha}`, `/releases/tag/{tag}`
619+
- **GitLab**: `/-/tree/{ref}`, `/-/commit/{sha}`
620+
- **Bitbucket**: `/src/{ref}`, `/commits/{sha}`
621+
- **Generic**: `repo@{ref}` (npm/pip style, e.g., `https://github.com/user/repo@v1.0.0`)
622+
623+
Example: `https://github.com/kijai/ComfyUI-KJNodes/tree/204f6d5aae73b10c0fe2fb26e61405fd6337bb77`. If cloned, `requirements.txt` will be installed if it exists, using `uv` if available, otherwise falling back to `pip`.
616624
4. Download any models listed in the `models.before_start` field, and save them to the specified `local_path`.
617625
5. Start background downloading any models listed in the `models.after_start` field, and save them to the specified `local_path`. These downloads will be started in the background and will not block the server from accepting requests. This is useful for preloading less frequently used models.
618626

@@ -1007,7 +1015,8 @@ If you are using the azure blob storage functionality, make sure to set all of t
10071015
| 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. |
10081016
| SYSTEM_WEBHOOK_EVENTS | (not set) | Comma separated list of events to send to the webhook. Only selected events will be sent. If not set, no events will be sent. See [System Events](#system-events). You may also use the special value `all` to subscribe to all event types. |
10091017
| SYSTEM_WEBHOOK_URL | (not set) | Optionally receive via webhook the events that ComfyUI emits on websocket. This includes progress events. |
1010-
| WARMUP_PROMPT_FILE | (not set) | Path to warmup prompt file (optional) |
1018+
| WARMUP_PROMPT_FILE | (not set) | Path to warmup prompt file (optional). If both `WARMUP_PROMPT_FILE` and `WARMUP_PROMPT_URL` are set, `WARMUP_PROMPT_FILE` takes precedence. |
1019+
| WARMUP_PROMPT_URL | (not set) | URL to download warmup prompt from (optional). Allows using a remote warmup workflow without building a custom Docker image. Downloaded and parsed at startup before ComfyUI launches. |
10111020
| WEBHOOK_SECRET | (empty string) | If set, the server will sign webhook_v2 requests with this secret. |
10121021
| WORKFLOW_DIR | "/workflows" | Directory for workflow files |
10131022

@@ -1089,6 +1098,8 @@ Notes:
10891098
5. **Warmup Prompt**:
10901099

10911100
- If `WARMUP_PROMPT_FILE` is set, the application will load and parse a warmup prompt from this file.
1101+
- Alternatively, set `WARMUP_PROMPT_URL` to download the warmup prompt from a remote URL at startup. This allows using a custom warmup workflow without building a custom Docker image.
1102+
- If both are set, `WARMUP_PROMPT_FILE` takes precedence.
10921103
- The checkpoint used in this prompt can be used as the default for workflow models.
10931104

10941105
6. **Models**:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
comfyui:
3-
image: ghcr.io/saladtechnologies/comfyui-api:comfy0.7.0-torch2.8.0-cuda12.8-runtime
3+
image: ghcr.io/saladtechnologies/comfyui-api:comfy0.8.2-torch2.8.0-cuda12.8-runtime
44
volumes:
55
- type: bind
66
source: ./bin

docker/api.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG base=runtime
2-
ARG comfy_version=0.7.0
2+
ARG comfy_version=0.8.2
33
ARG pytorch_version=2.8.0
44
ARG cuda_version=12.6
55

@@ -8,7 +8,7 @@ FROM ghcr.io/saladtechnologies/comfyui-api:comfy${comfy_version}-torch${pytorch_
88
ENV WORKFLOW_DIR=/workflows
99
ENV STARTUP_CHECK_MAX_TRIES=30
1010

11-
ARG api_version=1.16.1
11+
ARG api_version=1.17.0
1212

1313
ADD https://github.com/SaladTechnologies/comfyui-api/releases/download/${api_version}/comfyui-api .
1414

docker/build-api-images

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
usage="Usage: $0 [comfy_version] [torch_version] [cuda_version] [api_version]"
44

5-
comfy_version=${1:-0.7.0}
5+
comfy_version=${1:-0.8.2}
66
torch_version=${2:-2.8.0}
77
cuda_version=${3:-12.6}
88

docker/build-comfy-base-images

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/bash
22

3-
comfy_version=${1:-0.7.0}
3+
comfy_version=${1:-0.8.2}
44
torch_version=${2:-2.8.0}
55
cuda_version=${3:-12.6}
66
bases=("devel" "runtime")

docker/comfyui.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN uv pip install --no-cache-dir --system comfy-cli "huggingface_hub[cli]"
2424

2525
WORKDIR /opt
2626

27-
ARG comfy_version=0.7.0
27+
ARG comfy_version=0.8.2
2828

2929
RUN git clone --depth 1 --branch v${comfy_version} https://github.com/comfyanonymous/ComfyUI.git
3030

docker/push-comfy-base-images

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
usage="Usage: $0 [comfy_version] [torch_version] [cuda_version]"
44

5-
comfy_version=${1:-0.7.0}
5+
comfy_version=${1:-0.8.2}
66
torch_version=${2:-2.8.0}
77
cuda_version=${3:-12.6}
88

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "comfyui-api",
3-
"version": "1.16.1",
3+
"version": "1.17.0",
44
"description": "Wraps comfyui to make it easier to use as a stateless web service",
55
"main": "dist/src/index.js",
66
"scripts": {

src/config.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const {
4444
SYSTEM_WEBHOOK_EVENTS,
4545
SYSTEM_WEBHOOK_URL,
4646
WARMUP_PROMPT_FILE,
47+
WARMUP_PROMPT_URL,
4748
WEBHOOK_SECRET,
4849
WORKFLOW_DIR = "/workflows",
4950
} = process.env;
@@ -606,6 +607,12 @@ const config = {
606607
*/
607608
warmupPrompt,
608609

610+
/**
611+
* (Optional) URL to download the warmup prompt from. Specified by WARMUP_PROMPT_URL env var.
612+
* If both WARMUP_PROMPT_FILE and WARMUP_PROMPT_URL are set, WARMUP_PROMPT_FILE takes precedence.
613+
*/
614+
warmupPromptUrl: WARMUP_PROMPT_URL,
615+
609616
/**
610617
* (Optional) The secret used to sign webhooks. Specified by WEBHOOK_SECRET env var.
611618
*/
@@ -666,4 +673,26 @@ if (
666673
config.saladMetadata = null;
667674
}
668675

676+
/**
677+
* Set the warmup prompt from downloaded content.
678+
* This function is called when WARMUP_PROMPT_URL is used to download the warmup file.
679+
*/
680+
export function setWarmupPrompt(content: string): void {
681+
try {
682+
const parsed = JSON.parse(content);
683+
config.warmupPrompt = parsed;
684+
685+
// Extract checkpoint from warmup prompt
686+
for (const nodeId in parsed) {
687+
const node = parsed[nodeId];
688+
if (node.class_type === "CheckpointLoaderSimple") {
689+
config.warmupCkpt = node.inputs.ckpt_name;
690+
break;
691+
}
692+
}
693+
} catch (e: any) {
694+
throw new Error(`Failed to parse warmup prompt: ${e.message}`);
695+
}
696+
}
697+
669698
export default config;

0 commit comments

Comments
 (0)