---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "Fix ComfyUI Prompt Has No Outputs API Error"
description: "Ensure your ComfyUI API JSON ends in a real SaveImage or SaveVideo node, wrap API POST bodies in {\"prompt\": <graph>}, and when opening API JSON in the browser UI enable Settings -> Enable Dev Mode Options -> Load (API Format)."
canonical: "https://framesfield.com/fixes/comfyui-prompt-has-no-outputs-api-error"
---

# Fix ComfyUI Prompt Has No Outputs API Error

> Ensure your ComfyUI API JSON ends in a real SaveImage or SaveVideo node, wrap API POST bodies in {"prompt": <graph>}, and when opening API JSON in the browser UI enable Settings -> Enable Dev Mode Options -> Load (API Format).

- **Canonical URL:** https://framesfield.com/fixes/comfyui-prompt-has-no-outputs-api-error
- **Category:** ComfyUI & Local GPU
- **Error Signature:** `HTTP 400 Bad Request: {"error": {"type": "prompt_no_outputs", "message": "Prompt has no outputs"}} | Blank canvas on drag-and-drop`
- **Last Verified:** 2026-12-01

## Observed Symptom

Submitting a workflow JSON to http://127.0.0.1:8188/prompt fails with HTTP 400 "Prompt has no outputs", OR dragging an API-format JSON file into the ComfyUI web canvas shows a blank screen or silent import error.

## Technical Root Cause

Two distinct ComfyUI architecture rules: (1) ComfyUI /prompt builds its execution DAG backwards from sink nodes—so any graph missing a real output node (SaveImage, SaveVideo, PreviewImage) OR missing the outer {"prompt": ...} envelope executes zero nodes; (2) ComfyUI uses two incompatible JSON schemas—UI Format (canvas coordinates) vs API Format (flat node-ID dictionary).

## Under the Hood

Unlike sequential scripts, ComfyUI evaluates workflows lazily starting strictly from terminal output nodes (`OUTPUT_NODE = True` in Python, such as `SaveImage`, `SaveVideo`, `CreateVideo` -> `SaveVideo`, or `VHS_VideoCombine`). If your graph ends at `VAEDecode` or `KSampler` without wiring decoded images into an output sink, ComfyUI validates the JSON cleanly and immediately rejects execution with `prompt_no_outputs`.

Equally common when copying headless API workflows is sending the flat node dictionary (`{"1": {...}, "2": {...}}`) directly as the HTTP POST body to `/prompt` instead of wrapping it inside `{"prompt": <graph>}`. Without the top-level `"prompt"` key, ComfyUI sees an empty node graph and emits the exact same `"Prompt has no outputs"` error. Finally, dragging an API-format JSON into the default browser canvas fails because standard drag-and-drop expects UI-layout JSON (`nodes`/`links` arrays)—to inspect API JSON visually in the browser, you must toggle Dev Mode ON and click Load (API Format).

## Before vs. After

### Broken (Broken POST Payload (Missing Outer {"prompt": ...} Wrapper))

```
curl -X POST http://127.0.0.1:8188/prompt \
  -H "Content-Type: application/json" \
  -d @workflow.api.json   # Fails with HTTP 400 "Prompt has no outputs"!
```

### Verified Fix (Verified Wrapped API Submission (Checks Output Node + Wraps {"prompt": ...}))

```
python3 -c 'import json,sys,urllib.request; g=json.load(open(sys.argv[1])); print(urllib.request.urlopen(urllib.request.Request("http://127.0.0.1:8188/prompt", data=json.dumps({"prompt": g}).encode(), headers={"Content-Type":"application/json"})).read().decode())' workflow.api.json
```

Wrapping the flat node dictionary inside `{"prompt": g}` plus verifying a terminal `SaveImage` / `SaveVideo` node guarantees `/prompt` returns HTTP 200 with a valid `prompt_id`.

## Copy-Paste Fix (queue-comfy-api-safely.py)

```bash
# 1. Verify your JSON is API-format, contains a terminal output node, has zero dangling links, and queue properly wrapped in {"prompt": ...}
python3 -c '
import json, sys, urllib.request
g = json.load(open(sys.argv[1]))
assert "nodes" not in g, "This is UI-Format JSON! Re-export via Dev Mode -> Save (API Format)."
types = [n.get("class_type") for n in g.values() if isinstance(n, dict)]
assert any(t in ("SaveImage", "SaveVideo", "VHS_VideoCombine") for t in types), f"Missing output node! Found: {types}"
for nid, node in g.items():
  for k, v in (node.get("inputs") or {}).items():
    if isinstance(v, list) and len(v) == 2 and isinstance(v[0], str):
      assert v[0] in g, f"Dangling link in node {nid}.{k} -> missing node {v[0]}"
req = urllib.request.Request(
  "http://127.0.0.1:8188/prompt",
  data=json.dumps({"prompt": g}).encode(),
  headers={"Content-Type": "application/json"}
)
print(urllib.request.urlopen(req).read().decode())
' workflow.api.json
```

## Step-by-Step Resolution

1. **Verify the graph is API Format and contains a terminal output node:** Confirm the JSON has flat string node IDs ("1", "2", ...) and ends with SaveImage (stills) or SaveVideo / CreateVideo -> SaveVideo (video). Stopping at VAEDecode triggers "Prompt has no outputs" every time.
2. **Wrap flat API JSON inside {"prompt": ...} when POSTing to /prompt:** Posting raw node keys directly to http://127.0.0.1:8188/prompt without the outer "prompt" key causes ComfyUI to ignore every node.
3. **Use Settings -> Enable Dev Mode Options -> Load (API Format) in browser UI:** To inspect or edit any API-format JSON visually inside the ComfyUI browser interface, turn on Dev Mode Options first so the dedicated Load (API Format) button appears.

## Verification Check (Verify Queued Job Accepted by Local ComfyUI Server)

```bash
curl -s http://127.0.0.1:8188/queue | python3 -m json.tool
```

**Expected healthy output:**

```text
{"queue_running": [[...]], "queue_pending": []}   # And POST returns {"prompt_id": "...", "node_errors": {}}
```

## Prevention Guardrails

1. **Name files explicitly *.api.json vs *.ui.json across repositories:** Suffixing every headless graph `.api.json` immediately prevents teammates from dragging API graphs blindly onto the browser canvas.
2. **Run pre-flight node-link & sink validation in batch runner scripts:** Validating `SaveImage`/`SaveVideo` presence and dangling `["nodeId", idx]` links locally takes 2 milliseconds and prevents silent overnight batch failures.
3. **Always check node_errors in the /prompt HTTP response:** Verify `node_errors` is an empty object `{}` and that every model filename (`ckpt_name`, `unet_name`) matches files actually present inside `ComfyUI/models/`.

## FAQs

### How can I tell instantly whether a JSON file is ComfyUI UI Format or API Format?

UI Format JSON has top-level "nodes": [...] and "links": [...] arrays with x/y canvas coordinates. API Format JSON is a flat dictionary keyed by node ID strings ("1", "2", "3") containing class_type and inputs.

### Does FramesField validate all its ComfyUI JSON downloads automatically?

Yes. Every ComfyUI graph served from /raw/skills/ is checked on every build for valid JSON, zero dangling node links, and a real terminal SaveImage or SaveVideo node.

### Why did /prompt accept my JSON but fail immediately with a missing checkpoint error?

Model filenames inside inputs (like unet_name or clip_name) must exactly match filenames downloaded inside ComfyUI/models/. Query http://127.0.0.1:8188/object_info/UNETLoader to list exact installed model strings.

### Can I pass a client_id alongside {"prompt": graph} for WebSocket progress tracking?

Yes. Sending {"prompt": graph, "client_id": "batch-01"} lets your Python script subscribe to ws://127.0.0.1:8188/ws?clientId=batch-01 and stream live step-by-step progress.
