ComfyUIWorkflow & organisation

ComfyUI Workflow Metadata: Save and Reload from PNG

By Marco Cavazzana · Updated · 5 min read
ShareEmail
Short answer

Every image written by ComfyUI’s Save Image node carries the complete workflow as JSON in the PNG metadata. Drag that PNG back onto the canvas and the whole graph, prompts, seed and settings reappear. The metadata survives copying the file but is stripped by JPEG conversion, screenshots and most social platforms, so keep the original PNGs and export the workflow JSON for anything you must reproduce later.

The most useful thing about ComfyUI is also the least advertised: the image is the workflow. Each PNG saved by the Save Image node contains the graph that produced it, including every prompt, seed and setting. Lose the workflow file and you can recover it from the picture. This guide explains what is stored, how to get it back, when it is lost and how to organise outputs so a project is still readable months later.

What ComfyUI writes into a PNG

PNG files can carry text chunks alongside the pixels. ComfyUI stores two: prompt, the API-style record of the nodes that actually ran with their input values, and workflow, the full editor graph with node positions, groups and notes. The first is what a script would need to rerun the generation; the second is what you see on the canvas. Both are plain JSON, so any metadata viewer or a few lines of Python can read them.

Only the Save Image node writes files. Preview Image shows the result in the interface and nothing more. If you built a workflow with previews only, your outputs exist in the temp folder at best and will not carry a reload-able graph.

Reloading a workflow from an image

  1. Drag the PNG onto the ComfyUI canvas. The graph replaces whatever is open, so save your current work first.
  2. Check for missing nodes. If the image came from someone else, a dialogue may list custom nodes you do not have. With ComfyUI Manager installed, use the install-missing option, then restart.
  3. Check the model names. Loader nodes reference checkpoints, LoRAs and VAEs by filename. If yours are named differently, the fields will show red and you pick the equivalent from the dropdown.
  4. Queue once with the seed fixed. If the result matches the image, you have an exact reproduction. If not, a model version or a custom node has changed.

The same drag-in works with the workflow JSON file itself, and the Load option in the workflow menu does the same from a file picker.

Saving and exporting workflows deliberately

The workflow menu offers Save (the editor graph as JSON) and, in current builds, Export and Export (API). The API export is the stripped-down version used by scripts and by the queue; keep it when a workflow feeds an automation. Save the editor version for anything you will open again yourself. Give the file the same name as the project folder it belongs to.

Add a Note node (a core node, found under utilities) to the canvas and write what the workflow is for, which models it needs and what the last change was. Notes are saved in the workflow and therefore in every PNG, so the explanation travels with the image.

Naming and organising outputs

The Save Image node has a filename_prefix field. By default it writes ComfyUI_00001_.png and counts up, which tells you nothing. Change the prefix per project: clientname/shot03 creates a subfolder inside the output directory and names the files inside it. Recent builds also expand date tokens such as %date:yyyy-MM-dd% and can pull values from other nodes into the filename; check the current documentation for the exact syntax, which has changed over time.

  • One subfolder per client or project, set through the prefix.
  • Keep the final selects and the exported workflow JSON in the same folder.
  • Do not rename files to describe their contents until you have copied the originals; the metadata survives renaming, but a rushed rename often goes with a convert to JPEG, which does not.
  • Write the seed and model in the filename when you expect to hand the shot to someone who will not open ComfyUI.

When the metadata is lost

The workflow lives in PNG text chunks, so anything that rewrites the image drops it. Converting to JPEG or WebP, taking a screenshot, uploading to most social and messaging platforms, running an image through many online upscalers, and saving from some photo editors all strip it. Some editors keep PNG text chunks; test yours by saving a copy and dragging it back into ComfyUI. Cloud storage and ordinary file copying preserve the chunks.

When the chunks are gone there is no recovery from the image alone. That is why the exported workflow JSON and a plain-text record of the key settings matter. The habit is simple: PNG for the archive, JPEG only for delivery, and the JSON saved beside both. For a cross-tool view of this, see how to track prompts across AI tools.

Settings at a glance

SettingWhat it doesStart with
Save Image vs Preview ImageSave writes a PNG with the workflow; Preview only displaysSave Image on every output you might want back
filename_prefixFilename and optional subfolder for outputsproject/shot, changed per job
Workflow SaveExports the editor graph as JSONSave after every meaningful change
Export (API)Exports the run-ready JSON for scriptsOnly when automating
Note nodeFree text stored inside the workflowPurpose, models required, last change
Seed controlfixed, increment or randomizefixed before saving a final
Output formatPNG is the only format that keeps the workflowPNG for archive, convert copies for delivery

Try it

Save Image node, filename_prefix:
  portfolio/lighthouse_v2

Note node text:
  Lighthouse series. SDXL checkpoint + coastal LoRA at 0.7.
  v2: lowered cfg to 5.5, switched scheduler to karras.
  Seed fixed. Final selects go in /portfolio/lighthouse_v2/final

Queue one image, close the workflow, then drag the saved PNG back in. If the note and the settings return exactly, your archive habit works. Then convert a copy to JPEG and try again to see what you lose.

Frequently asked questions

How do I get a ComfyUI workflow from an image?
Drag the PNG onto the ComfyUI canvas. If the file was saved by ComfyUI’s Save Image node and has not been converted or re-saved by another app, the full graph with prompts, seed and settings loads. Missing custom nodes can be installed through ComfyUI Manager, and model names may need re-selecting.
Why does my ComfyUI image have no workflow in it?
Either it was shown with a Preview Image node rather than saved, or something stripped the PNG metadata afterwards. JPEG conversion, screenshots, social platforms and many editors remove text chunks. Keep the original PNG and export the workflow JSON separately for anything important.
What is the difference between Save and Export (API) in ComfyUI?
Save writes the editor graph with node positions, groups and notes, which is what you reopen yourself. Export (API) writes the stripped-down list of nodes and values the queue actually runs, which scripts and automations use. Keep the first for your own work and the second only when integrating.

Nothing you makeis lost.

Free · No card · Read-only · 2-minute setup

DreamdriveFree plan · Chrome
Add to Chrome — it’s free