Skip to content

Commit 910c426

Browse files
1.16.1 bug fixes (#127)
* version bump, add tests * version bump comfyui * improved custom workflow debugging * more test * bug fix and test
1 parent e3c7d45 commit 910c426

18 files changed

Lines changed: 530 additions & 26 deletions

DEVELOPING.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ It covers setting up the development environment, coding standards, testing proc
1111
- [Running Tests](#running-tests)
1212
- [Generating New Workflow Endpoints](#generating-new-workflow-endpoints)
1313
- [Automating with Claude 4 Sonnet](#automating-with-claude-4-sonnet)
14+
- [Debugging Custom Workflows](#debugging-custom-workflows)
1415
- [Storage Providers](#storage-providers)
1516
- [Adding a New Storage Provider](#adding-a-new-storage-provider)
1617

@@ -307,6 +308,88 @@ Where `<inputFile>` is the JSON prompt graph, and `<outputFile>` is the output f
307308

308309
As with all AI-generated code, it is strongly recommended to review the generated code before using it in production.
309310

311+
### Debugging Custom Workflows
312+
313+
When developing or troubleshooting custom workflows, enable debug logging to see detailed information about what's happening under the hood.
314+
315+
#### Enabling Debug Logging
316+
317+
Set the `LOG_LEVEL` environment variable to `debug`:
318+
319+
```shell
320+
# Docker
321+
docker run -e LOG_LEVEL=debug ...
322+
323+
# Docker Compose
324+
environment:
325+
- LOG_LEVEL=debug
326+
```
327+
328+
#### What Debug Logging Shows
329+
330+
With `LOG_LEVEL=debug`, the server will log:
331+
332+
1. **Workflow Loading** (at startup):
333+
- Which workflow directories are being scanned
334+
- TypeScript files being transpiled
335+
- Each workflow file being evaluated
336+
- Successfully loaded workflows
337+
- Warnings for files that don't export valid Workflow objects
338+
- Errors if workflow files fail to evaluate (with stack traces)
339+
340+
2. **Workflow Execution** (per request):
341+
- The input received from the request (`Workflow input received`)
342+
- The generated ComfyUI prompt (`Generated ComfyUI prompt from workflow`)
343+
- The full request body sent to `/prompt` (`Sending request to /prompt endpoint`)
344+
- Any errors from the `/prompt` endpoint (including the full prompt that failed)
345+
346+
#### Common Issues and Solutions
347+
348+
**Problem: 400 error from `/prompt` endpoint with validation errors**
349+
350+
Debug logs will show the exact prompt being sent. Common causes:
351+
- Missing required nodes (e.g., no `SaveImage` node with `filename_prefix`)
352+
- Invalid node references (e.g., referencing a node ID that doesn't exist)
353+
- Invalid input types (e.g., string where number expected)
354+
355+
Check the `promptRequestBody` in the error log to see exactly what was sent.
356+
357+
**Problem: Workflow file not loading**
358+
359+
Debug logs will show if the file:
360+
- Failed to transpile (TypeScript syntax error)
361+
- Failed to evaluate (JavaScript runtime error)
362+
- Doesn't export a valid Workflow object
363+
364+
**Problem: Workflow generates wrong output**
365+
366+
Use debug logs to compare:
367+
1. The `input` received by the workflow
368+
2. The `prompt` generated by your `generateWorkflow` function
369+
3. Compare against a known-working prompt from ComfyUI's web interface
370+
371+
#### Example Debug Output
372+
373+
```
374+
{"level":30,"workflow":"txt2img","msg":"Workflow input received","input":{"prompt":"a cat","width":512}}
375+
{"level":30,"workflow":"txt2img","msg":"Generated ComfyUI prompt from workflow","prompt":{"3":{"inputs":{"seed":123...}}}}
376+
{"level":30,"workflow":"txt2img","msg":"Sending request to /prompt endpoint","promptRequestBody":{...}}
377+
{"level":30,"workflow":"txt2img","msg":"Workflow completed successfully","status":200}
378+
```
379+
380+
When a workflow fails:
381+
```
382+
{"level":50,"workflow":"txt2img","msg":"Workflow request to /prompt endpoint failed","status":400,"error":"Prompt must contain a node with a \"filename_prefix\" input","location":"prompt","promptRequestBody":{...}}
383+
```
384+
385+
#### Inspecting Prompts Without Debug Logging
386+
387+
If you can't enable debug logging, you can still inspect your generated prompts by:
388+
389+
1. **Using the `/docs` endpoint**: Access the Swagger UI at `http://localhost:3000/docs` to test your workflow endpoints interactively
390+
2. **Testing generateWorkflow locally**: Import your workflow file and call `generateWorkflow()` with test inputs to see the output
391+
3. **Comparing with ComfyUI**: Export a working prompt from ComfyUI's web interface and compare it to your generated prompt
392+
310393
## Storage Providers
311394

312395
Storage providers are modular components that handle the downloading of models and input media, as well as the uploading of completed outputs.

README.md

Lines changed: 1 addition & 1 deletion
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.15.0
81+
ARG api_version=1.16.1
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 .

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.5.1-torch2.8.0-cuda12.8-runtime
3+
image: ghcr.io/saladtechnologies/comfyui-api:comfy0.7.0-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.5.1
2+
ARG comfy_version=0.7.0
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.0
11+
ARG api_version=1.16.1
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.5.1}
5+
comfy_version=${1:-0.7.0}
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.5.1}
3+
comfy_version=${1:-0.7.0}
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.5.1
27+
ARG comfy_version=0.7.0
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.5.1}
5+
comfy_version=${1:-0.7.0}
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "comfyui-api",
3-
"version": "1.16.0",
3+
"version": "1.16.1",
44
"description": "Wraps comfyui to make it easier to use as a stateless web service",
55
"main": "dist/src/index.js",
66
"scripts": {
77
"full-test": "mocha --require ts-node/register --timeout=0 test/*.spec.ts",
8-
"test": "mocha --require ts-node/register --timeout=0 test/core.spec.ts",
8+
"test": "mocha --require ts-node/register --timeout=0 test/core.spec.ts test/utils.spec.ts",
9+
"unit-test": "mocha --require ts-node/register --timeout=0 test/utils.spec.ts",
910
"build": "tsc",
1011
"build-binary": "./build-binary",
1112
"postinstall": "npm install --cpu=wasm32 sharp"

0 commit comments

Comments
 (0)