Loading...
Loading...
Technical Reference
The exact JSON structures ComfyUI embeds in PNG tEXt/zTXt chunks, with annotated examples for five common workflow types.
Every PNG saved by ComfyUI contains two JSON objects embedded as text chunks in the PNG file header. These are standard PNG tEXt or zTXt (compressed) ancillary chunks, readable by any PNG library.
The execution data. A flat map of node IDs to their class types, inputs, and connections. This is what you need to extract prompts, seeds, models, and parameters.
The visual graph. Contains node positions, sizes, groups, links, and canvas state. Needed to recreate the workflow in ComfyUI's UI, but not for data extraction.
For MP4 files created with ComfyUI-VideoHelperSuite, the same JSON is stored in the ©cmt (Comment) atom as {"prompt": {...}, "workflow": {...}}.
PNG chunk key: prompt
| Field | Type | Req | Description |
|---|---|---|---|
| ▾{nodeId} | object | yes | Each top-level key is a numeric string ("1", "2", etc.) identifying a node in the execution graph. |
| class_type | string | yes | The node type, e.g. "KSampler", "CLIPTextEncode". Must match a registered node in NODE_CLASS_MAPPINGS. |
| inputs | object | yes | Parameters for this node. Values are either direct (string, number, boolean) or a connection reference ["nodeId", outputIndex]. |
| _meta | object | no | Optional metadata. Contains a "title" field with the display name shown in the ComfyUI canvas. |
| is_changed | string[] | no | Array of hashes indicating changed inputs. Used by ComfyUI Cloud for cache invalidation. |
Connection references: When an input value is an array like ["4", 1], it means "connect to output slot 1 of node 4". The first element is always a string (node ID), the second is an integer (output index).
PNG chunk key: workflow · Schema version: 1.0
| Field | Type | Req | Description |
|---|---|---|---|
| version | number | yes | Schema version. 1 for modern workflows (Jan 2024+), 0.4 for legacy LiteGraph format. |
| state | object | yes | Graph counters: lastNodeId, lastLinkId, lastGroupId, lastRerouteId. Used for generating unique IDs. |
| ▾nodes | array | yes | Array of node objects with visual properties (position, size, flags, color) and widget values. |
| id | number | string | yes | Unique node identifier matching prompt keys. |
| type | string | yes | Class type (same as prompt class_type). |
| pos | [x, y] | yes | Canvas position as [x, y] coordinates. |
| size | [w, h] | yes | Node dimensions [width, height] in pixels. |
| flags | object | yes | Display flags: collapsed, pinned, allow_interaction, horizontal. |
| mode | number | yes | 0 = normal, 2 = muted (bypassed), 4 = pinned. |
| widgets_values | array | object | no | Widget parameter values in display order. Legacy format — prefer reading from prompt inputs. |
| inputs | array | no | Input slot definitions with name, type, and link ID reference. |
| outputs | array | no | Output slot definitions with name, type, and array of connected link IDs. |
| links | array | no | Connection definitions: { id, origin_id, origin_slot, target_id, target_slot, type }. Maps to prompt connection refs. |
| groups | array | no | Visual grouping boxes. Cosmetic only — no execution effect. Each has title, bounding [x,y,w,h], color. |
| config | object | no | Canvas configuration: links_ontop (boolean), align_to_grid (boolean). |
| extra | object | no | Workspace metadata including ds (scale/offset for viewport), info (name, author, description, software), linkExtensions. |
| reroutes | array | no | Visual reroute waypoints for links. Cosmetic — no execution effect. |
| models | array | no | Model references with name, url, hash, hash_type, directory. Added by model management extensions. |
The KSampler node is the heart of every generation workflow. These are the parameters that most affect output quality.
| Parameter | Type | Description |
|---|---|---|
| seed | integer | Random seed for reproducibility. Same seed + same parameters = same image. |
| steps | integer | Number of denoising steps. More steps = higher quality, slower generation. |
| cfg | float | Classifier-free guidance scale. Higher = closer to prompt, lower = more creative. |
| sampler_name | string | Sampling algorithm. Different samplers produce different aesthetics at the same step count. |
| scheduler | string | Noise schedule. "karras" is popular for sharper results; "normal" is the default. |
| denoise | float | 1.0 = full generation (txt2img). Lower values preserve more of the input image (img2img). 0.65 is a common starting point. |
| model | reference | Connection to checkpoint model output. |
| positive | reference | Connection to positive conditioning (CLIPTextEncode). |
| negative | reference | Connection to negative conditioning (CLIPTextEncode). |
| latent_image | reference | Connection to latent input (EmptyLatentImage for txt2img, VAEEncode for img2img). |
KSamplerAdvanced uses noise_seed instead of seed and adds add_noise, start_at_step, end_at_step, and return_with_leftover_noise parameters.
Real prompt-chunk JSON for five common workflow types. Expand any example to see the full structure with annotations.
Key Nodes
How to Identify This Workflow Type
Uses EmptyLatentImage (no image input) and KSampler with denoise: 1.0.
{
"4": {
"class_type": "CheckpointLoaderSimple",
"inputs": {
"ckpt_name": "v1-5-pruned-emaonly.safetensors"
},
"_meta": { "title": "Load Checkpoint" }
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"text": "a beautiful landscape, golden hour, mountains",
"clip": ["4", 1]
},
"_meta": { "title": "Positive Prompt" }
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"text": "blurry, low quality, watermark",
"clip": ["4", 1]
},
"_meta": { "title": "Negative Prompt" }
},
"5": {
"class_type": "EmptyLatentImage",
"inputs": {
"width": 512,
"height": 512,
"batch_size": 1
},
"_meta": { "title": "Empty Latent Image" }
},
"3": {
"class_type": "KSampler",
"inputs": {
"seed": 156680208700286,
"steps": 20,
"cfg": 8.0,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1.0,
"model": ["4", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["5", 0]
},
"_meta": { "title": "KSampler" }
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": ["3", 0],
"vae": ["4", 2]
},
"_meta": { "title": "VAE Decode" }
},
"9": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": ["8", 0]
},
"_meta": { "title": "Save Image" }
}
}These schemas cover standard workflows. In practice, custom nodes create unpredictable structures — nested groups, non-standard widget formats, missing metadata fields. Numonic handles all variants automatically and maps the data to a searchable, structured catalog.
Note: This documentation reflects the ComfyUI metadata format as of February 2026. Custom nodes may extend or modify these schemas. ComfyUI is an open-source project — schema changes may occur between releases. Always validate metadata against the actual PNG chunk contents for your specific version.