What am I looking at when I open the file?

A ComfyUI workflow is a node graph: the nodes are the steps, and the links show how data moves between them. You can save that graph as JSON, separate from the generated media. Workflows

The frontend can save two kinds of JSON, and both use the extension .json. Save format is File, then Save, or Ctrl+S, and it is the file you reopen in the frontend. API format, from File, then Export Workflow (API), is what you submit to the API, and the UI can load it back without the layout. API format

graphToPrompt returns a workflow object whose version is the LiteGraph version, 0.4 when that guide was written. Comfy objects The schema page marks version 1.0 as latest and keeps 0.4 as an older page. Workflow JSON v1.0

If you wanted the graph drawn for a project, the request article packages six inputs before anyone starts. How to request a workflow

What is inside a node in the file I saved?

A version 1.0 workflow requires version, state, and nodes. version is the number 1. state can name lastGroupid, lastNodeId, lastLinkId, and lastRerouteId. The schema also lists links, groups, models, extra, config, and reroutes outside that required list. Workflow JSON v1.0 The legacy 0.4 workflow requires last_node_id, last_link_id, nodes, links, and version. Workflow JSON 0.4 The frontend object guide describes the saved object with last_node_id, last_link_id, nodes, links, groups, config, extra, and version, and it says version was 0.4 when the guide was written. Comfy objects

Each saved node is one entry in the nodes array. Version 1.0 and version 0.4 both require id, type, pos, size, flags, order, mode, and properties on that entry. Workflow JSON v1.0 Workflow JSON 0.4 id may be an integer or a string. type is the node class. On the live node, that string is the unique Python class name. Comfy objects

pos and size are each two numbers, an array or an object with keys 0 and 1. Workflow JSON v1.0 The frontend stores pos as the canvas x and y, and size as the node's width and height. Comfy objects widgets_values, inputs, and outputs are optional. When widgets_values is present, it holds the widget settings as an array or an object. Workflow JSON v1.0 The frontend stores the current widget values there. Comfy objects An input, when present, needs name and type, and link is a number or null. An output, when present, needs name and type, and links is an array or null. A node with no outputs omits outputs. Workflow JSON v1.0 Comfy objects

Comfy Core nodes are the native nodes shipped with ComfyUI, and custom nodes are additional nodes from other authors. Custom nodes Load, encode, constrain, sample, and save are five jobs across the starter graph. A job may use more than one node. A node's type is its class. When that class comes from another author, the dependency budget is the record to keep.

How does a link point from one node to another?

A link connects an output on one node to an input on another, and only compatible types connect. Workflows

In schema 1.0, each entry in links is an object requiring id, origin_id, origin_slot, target_id, target_slot, and type. Workflow JSON v1.0 In schema 0.4, each entry is an array of exactly six items: a number, four values that may each be an integer or a string, and a type that may be a string, an array of strings, or a number. Workflow JSON 0.4 The frontend object guide names those six positions for the workflow it serializes: link id, upstream node id, upstream output slot, downstream node id, downstream input slot, and the data type. Comfy objects

API format nests the connection on the input. In the published fragment, the node keyed "3" has class_type KSampler, and its model input is ["4", 0]. That pair is the upstream node id and the upstream output slot, and the node id in the pair is a string. API format Comfy objects Node "4" in the same fragment has class_type CheckpointLoaderSimple, inputs.ckpt_name v1-5-pruned-emaonly-fp16.safetensors, and _meta.title. API format The API examples page says its examples use the default SD1.5 workflow. API examples

Where is the model, if it is not in the file?

Each entry in schema 1.0's optional models array requires name, url, and directory, may include hash and hash_type, and allows no other keys. Schema 0.4 defines the same entry. Workflow JSON v1.0 Workflow JSON 0.4 The embedded workflow does not include the model files, the input assets, or the custom node packages it depends on. Workflow metadata In the API fragment, ckpt_name is a filename. API format

A built-in save node can store the workflow inside the output file, and dragging that file onto the canvas recovers the graph. Workflows Embedded metadata commonly stores workflow (nodes, links, and layout, for restoring the frontend) and prompt (the API prompt). A file may contain one of those fields without the other, and the metadata does not change the visible image. Workflow metadata

The reproducibility checklist is the rest of the record: the graph, the models, the custom nodes, the inputs, the versions, the settings, and a geometry test. Reproducibility checklist Inspect the graph before you install the nodes or download the models those names point at. Read before you run

What does Export Workflow (API) throw away?

Save format stores nodes as an array. Each entry carries an id and a type, and that id may be an integer or a string. Workflow JSON v1.0 Workflow JSON 0.4 API format is an object keyed by strings such as "3" and "4". Those keys look numeric and are strings. API format

The comparison table on that page says save-format node keys are titles or labels, and that API keys are numeric node ids. Both workflow schemas store the saved nodes as the array above. _meta.title in the fragment is a label on the node. The key beside it is the id string. API format Workflow JSON v1.0

API format includes widget values and excludes positions, colors, groups, and node sizes. Open a save-format file with File, then Load, then export with File, then Export Workflow (API). API format

Why did the download save as the wrong extension?

On a sketch-to-image thread, a commenter wrote that the JSON wanted to save as a .customization file and asked whether to change the extension to .json. The thread Both formats on the API format page use the extension .json. API format

Who is this file for, and who should leave?

If you already hold a JSON, use the read-before-run article before you add a node or fetch a model. Read before you run If you want a graph made for a project, the request article packages the six inputs. How to request a workflow

Downloaded workflows rot as custom nodes and models change. Hunting trap A shared architecture graph needs an owner, a dependency record, a test scene, an update window, and a recovery route. Maintenance cost A useful tutorial shows the failed outputs and a recovery path. Failure frames

The file ends at the filename.