home/ atoms/ comfyui-api-json-workflow

ComfyUI's HTTP API accepts workflows as JSON with nodes keyed by numeric IDs and links as [node_id, slot_index] arrays

The ComfyUI HTTP API (POST /prompt) accepts a workflow JSON where each node is keyed by a string numeric ID. Node inputs that come from other nodes are represented as a [source_node_id, output_slot_index] array. Constant (non-linked) inputs are plain values. The API returns immediately; callers poll completion via the WebSocket or /history endpoint using a prompt_id (UUID). This format is the export target of File → Export (API Format) in the UI and is stable across versions — it is the primary integration surface for driving ComfyUI programmatically.

Examples

POST /prompt with {“prompt”: {“3”: {“class_type”: “KSampler”, “inputs”: {“model”: [“4”, 0], “seed”: 42, …}}}}

Assessment

Write the minimal JSON to invoke a single CLIPTextEncode node that receives its CLIP input from node ‘4’ output slot 1 and encodes the text ‘a sunset’. What field stores the text?

“If you want it for a specific workflow you can "File -> Export (API)" in the interface.”