Practical guide
Tell a ComfyUI UI workflow from an API prompt JSON
A .json extension does not identify a document's role. Open two defined ComfyUI representations, inspect where each stores its node type and parameters, and keep an unrelated JSON object from being mistaken for a usable workflow.
18 October 2026 · Check AI Free
Know which document you are opening
These are input roles, not interchangeable file extensions. The viewer interprets the supported saved structures without executing them or converting formats. A complete UI-to-API conversion would require additional node/widget behavior; this tutorial does not invent that behavior from names.
| Representation | Stored structure to inspect | This walkthrough's own fixture |
|---|---|---|
| UI workflow 0.4 | version, nodes array, per-node type/widgets_values, links array | Four node entries; two link tuples |
| UI workflow 1.0 | Separate versioned UI shape, including object-form links where present | Supported as a distinct shape; consult the official 1.0 reference |
| API prompt | Node-ID object keys, class_type and named inputs; connection arrays inside inputs | Four node keys; three connection references |
| Unrelated JSON | Valid syntax without a supported workflow/API shape | note and nodes only; unrecognized |
- Official ComfyUI UI workflow JSON 0.4 specification — Versioned format reference for nodes, widget values and link tuples. Reading supported structure does not certify complete schema compliance or runtime compatibility.
- Official ComfyUI UI workflow JSON 1.0 specification — The separate 1.0 shape includes object-form links and allows string identifiers/slots in its defined locations. The viewer reports its recognized format rather than converting it.
- Official API prompt example, fixed revision — Reference ce1e922d8623; only its stored prompt_text was read. The seven-node JSON example yields nine connections and one checkpoint reference. Its Python/network code is not run.
Inspect and locate the self-authored UI nodes
Step 1
Load workflow.json
Open the JSON viewer and choose workflow.json, or click Try UI workflow. Expect workflow-0.4, four nodes and two connections. The fixture's node 4 is ProjectDynamicLoader, a deliberately fictional type outside the fixed base catalog.
Step 2
Find the sampler without changing the document
Search for KSampler, or choose that type in Filter node type. Inspect node 3's Stored widget values and Original node JSON. Its first widget contains the exact numeric token 18446744073709551615. The preview and original download preserve those digits.
Step 3
Follow a stored connection
Under Connections, choose the endpoint for node 1 output 0 or node 3 slot 0. The viewer clears the search/filter and locates the corresponding node. This locates a saved reference; it does not run the connection or validate that all runtime input types are compatible.
- Download the self-authored UI workflow JSON — Four saved node entries, two connections, a fictional checkpoint and one fictional unknown node. Raw seed 18446744073709551615 is preserved as a numeric token; the graph is never executed.
Inspect the API representation separately
Step 1
Load api-prompt.json
Choose the API sample, or click Try API prompt. Expect api-prompt, four node-ID keys and three connections. The named inputs live under inputs, and type lives under class_type rather than the UI node's type field.
Step 2
Read the sampler's named input
Find node 3 KSampler and expand Stored inputs. seed is the original unquoted token 18446744073709551615; steps is 20 and cfg is 7. A connection such as positive:["2",0] stores the referenced node ID and output slot. The viewer retains that typed JSON rather than flattening every value into display text.
Step 3
Keep the original document when exporting
Expand Original JSON preview and click Copy original JSON or Download original JSON. The generic download name is original-workflow.json for either recognized shape; record whether your source was UI or API. The download is the exact input, not a synthesized conversion.
- Download the self-authored API prompt JSON — Four node-ID keys with class_type and named inputs, three connection references, one fictional checkpoint and one fictional unknown node. It is a stored-structure exercise, not a runnable model package.
Use the official pair as an interoperability check
Extract the official SDXL PNG's two fields as described in the preceding guide, then open each saved JSON directly. The checked UI document has 24 nodes and 23 links; the API prompt has 11 nodes and 15 connection references. The official basic_api_example.py also contains a fixed seven-node API prompt with nine connections. Only its stored JSON is used; its Python request code is not executed.
A difference in document layout or counts does not establish semantic equivalence or a visual difference. Node IDs, stored widget values, UI-only information and runtime representation have different roles. Preserve the two originals when you need a later comparison instead of editing one until it merely looks like the other.
- Official ComfyUI SDXL example PNG, fixed revision — Original example from the upstream repository at f9431bb000ce. Use its raw/original download. The checked 1024 × 1024 PNG has SHA-256 038bf565ca4db12e070db3507bed9a6242f0d5200a392962172a207af32ad941; this site does not mirror it.
- Official API prompt example, fixed revision — Reference ce1e922d8623; only its stored prompt_text was read. The seven-node JSON example yields nine connections and one checkpoint reference. Its Python/network code is not run.
- Extract the official pair first — Download exact prompt and workflow fields from the same original PNG.
Try the three diagnostic buttons
Direct input is limited to 5 MiB, 1000 nodes and 10000 links, with bounded depth and total values. Duplicate JSON keys remain in the original and produce a warning; interpretation uses the first occurrence. Unsupported entries remain in the original rather than silently becoming a complete supported graph. A recognized reading is an inspection result, not a safety verdict or an installation check.
| Button | Expected state | What is not inferred |
|---|---|---|
| Try unrelated JSON | Valid JSON, shape unknown, status unrecognized | No workflow success, model list or runtime compatibility |
| Try empty workflow | workflow-0.4 with zero nodes and links; empty | No missing graph is recovered |
| Try malformed JSON | Syntax failure near the incomplete input | No parse-success or empty-workflow conclusion |
- Download the unrelated-JSON control — Valid JSON with a note and an empty nodes array, but no supported workflow/API structure. The viewer reports unrecognized rather than workflow success.
- Download the empty supported-workflow control — Empty is a supported structure with no graph entries, distinct from unrelated JSON.
Sources and reproducible inputs
- Download the self-authored UI workflow JSON — Four saved node entries, two connections, a fictional checkpoint and one fictional unknown node. Raw seed 18446744073709551615 is preserved as a numeric token; the graph is never executed.
- Download the self-authored API prompt JSON — Four node-ID keys with class_type and named inputs, three connection references, one fictional checkpoint and one fictional unknown node. It is a stored-structure exercise, not a runnable model package.
- Download the unrelated-JSON control — Valid JSON with a note and an empty nodes array, but no supported workflow/API structure. The viewer reports unrecognized rather than workflow success.
- Official ComfyUI UI workflow JSON 0.4 specification — Versioned format reference for nodes, widget values and link tuples. Reading supported structure does not certify complete schema compliance or runtime compatibility.
- Official ComfyUI UI workflow JSON 1.0 specification — The separate 1.0 shape includes object-form links and allows string identifiers/slots in its defined locations. The viewer reports its recognized format rather than converting it.
- Official API prompt example, fixed revision — Reference ce1e922d8623; only its stored prompt_text was read. The seven-node JSON example yields nine connections and one checkpoint reference. Its Python/network code is not run.
- RFC 8259: JSON syntax and number interoperability — The number section describes interoperability limits of common numeric implementations. This viewer retains original numeric lexemes instead of first passing large seeds through JavaScript Number.
Continue with your file
- List literal resource references — Known loader fields, connected values and unknown node types stay separate.
- Start from a PNG instead of direct JSON — The stored field is extracted before the same structural inspection.
- Choose the next workflow task — Keep the original role and the unresolved questions with the result.