calesthio/OpenMontage · error · ComfyUIError

Prompt error: {json.dumps(data['error'])}

Error message

Prompt error: {json.dumps(data['error'])}

What it means

ComfyUIError raised when the /prompt response contains a top-level error object (distinct from per-node node_errors). This is ComfyUI rejecting the prompt as a whole — commonly malformed workflow structure, an unserializable value, or an execution-type error during prompt preparation. The raw error JSON is embedded for diagnosis. Like node_errors, this fires before queueing.

Source

Thrown at tools/_comfyui/client.py:192

    # ------------------------------------------------------------------
    # Core cycle
    # ------------------------------------------------------------------

    def submit(self, workflow: dict) -> str:
        """Queue a workflow for execution.  Returns the ``prompt_id``."""
        resp = requests.post(
            f"{self.server_url}/prompt",
            json={"prompt": workflow, "client_id": self.client_id},
            timeout=30,
        )
        try:
            data = resp.json()
        except ValueError:
            data = {}
        if data.get("node_errors"):
            raise ComfyUIError(f"Node errors: {json.dumps(data['node_errors'])}")
        if data.get("error"):
            raise ComfyUIError(f"Prompt error: {json.dumps(data['error'])}")
        resp.raise_for_status()
        prompt_id = data.get("prompt_id")
        if not prompt_id:
            raise ComfyUIError(f"No prompt_id in response: {data}")
        return prompt_id

    def poll(
        self,
        prompt_id: str,
        *,
        timeout: int = 600,
        interval: int = 5,
    ) -> dict:
        """Block until *prompt_id* finishes.  Returns the history entry."""
        deadline = time.time() + timeout
        while time.time() < deadline:
            entry = self._history_entry(prompt_id)
            if entry is not None:

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Confirm you are submitting API-format workflow JSON (nodes keyed by id with class_type and inputs), not the UI export format
  2. Read the embedded error JSON — 'type'/'message' identify the exact structural problem
  3. Re-export the workflow from the target server via 'Save (API Format)' and resubmit
  4. If a node type is unknown, install the matching custom node or remove the node from the workflow

Example fix

# before
workflow = json.load(open('workflow_ui.json'))  # UI format, has "links"
prompt_id = client.submit(workflow)

# after
workflow = json.load(open('workflow_api.json'))  # API format
prompt_id = client.submit(workflow)
Defensive patterns

Strategy: validation

Validate before calling

def is_api_format(workflow: dict) -> bool:
    if not isinstance(workflow, dict) or not workflow:
        return False
    return all(
        isinstance(v, dict) and "class_type" in v and "inputs" in v
        for v in workflow.values()
    )
if not is_api_format(workflow):
    raise SystemExit("workflow is not API-format (contains UI 'links' export?)")

Type guard

def is_api_format(workflow: dict) -> bool:
    return (
        isinstance(workflow, dict)
        and bool(workflow)
        and all(isinstance(v, dict) and "class_type" in v for v in workflow.values())
    )

Try / catch

try:
    prompt_id = client.submit(workflow)
except ComfyUIError as e:
    if "Prompt error" in str(e):
        raise SystemExit(f"server rejected the prompt wholesale: {e}")
    raise

Prevention

When it happens

Trigger: submit() posts a workflow whose top-level structure is wrong (not a dict of node ids, bad edge format), a node type string that doesn't exist on the server at all, or ComfyUI returns a validation error object from its /prompt handler.

Common situations: Submitting a UI-format workflow (with 'links' arrays) instead of API-format (prompt) JSON; workflow exported from a newer ComfyUI submitted to an older server; a typo'd class_type; server plugin disabled mid-session.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/75231d074fa0aa49. Report an issue: GitHub.