Nodes//Nougan Workflow PNG Baker 🧬
ComfyUI Node

Nougan Workflow PNG Baker 🧬

The Nougan Workflow PNG Baker

By WinnouganΒ·Created 3 months agoΒ·Updated about 16 hours agoΒ· 10
Nougan Workflow PNG Baker 🧬
  • image
  • saved_path
β—„json_textβ€”β–Ί
β—„filename_prefixWorkflow_PNG/workflowβ–Ί

A ComfyUI PNG carries the graph that made it - but only if ComfyUI's own Save Image wrote the file. The moment an image comes from anywhere else - an extracted video frame, a photo you're upscaling, a render re-saved as JPEG - there's no workflow to find.

The Nougan Workflow PNG Baker writes those chunks back in: feed it any image plus a workflow JSON and it saves a PNG that ComfyUI opens as that workflow when you drop it on the canvas.

Why you'd want this

The obvious use: attaching a workflow to a non-render image - a before/after sheet, a cover, a reference picture - so the example and its explanation travel as one file. The more useful one: it's how you re-home a workflow onto a picture you actually want to post. Saved as WebP by mistake? Run it through here and you get a lossless PNG that carries your graph.

That's the "workflow included" habit extended past ComfyUI's own saves: the file is the picture and the project file at once.

How it works, and the one distinction that matters

Save Image writes two PNG tEXt chunks, and they're not the same thing. workflow is the full UI graph - node positions, titles, groups, wires, muted branches - and dragging the image in rebuilds this; it's the editable thing you want. prompt is the API/execution format: node IDs and resolved values with the UI decoration stripped, which is what the backend actually ran.

It detects which one it was handed: a nodes list plus a links key means a workflow save file, which goes in workflow; every entry having a class_type means an API export, which goes in prompt. Hand it a {"workflow": {...}, "prompt": {...}} object - what PNG info tools give you - and it writes both.

Writing is plain json.dumps, exactly like ComfyUI does it, so the output stays ASCII-safe even when node titles contain emoji - tEXt is Latin-1, the detail that quietly breaks hand-rolled versions of this node. It also reopens the file and compares the stored JSON to what you gave it, so a truncated write errors instead of handing you a PNG that won't load.

Two things to expect: the PNG is rebuilt from decoded pixels, so the source EXIF doesn't come along, and a PNG is usually bigger than the source JPEG or WebP.

Inputs and outputs

Three required inputs, one known papercut.

image - the picture that carries the workflow. Any source format.

json_text - the workflow JSON, and it's a socket-only input: you can't paste into the widget, it expects ComfyUI's native String (Multiline) node. "Required input is missing: json_text" means exactly that.

filename_prefix - defaults to Workflow_PNG/workflow, saved under ComfyUI's output folder; the tooltip says the rest, that dragging the result onto the canvas opens the workflow. Slashes make subfolders, each path segment is sanitized, and .. is dropped, so it can't write outside output.

The single output is saved_path - the file written, one line per image in a batch. It's an output node, so it always runs and the saved image shows in the usual preview; nothing needs wiring downstream.

Install

ComfyUI Manager, search Nougan. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/Nougan_Nodes
# restart ComfyUI

No pip install - the pack declares zero Python dependencies; this node needs only PIL, numpy and folder_paths, which ComfyUI ships. Every family in the suite loads in its own guard, so an unrelated failure on boot doesn't take it down.

Troubleshooting

"This doesn't look like a ComfyUI workflow … Top-level keys received: [...]" - check that list. If it shows name, description, first_mes, you pasted a character card; that's the V2 PNG Baker. They're deliberately not interchangeable, and each names the keys it received so you can see which JSON you wired.

It opens, but as a mess of unplaced nodes. You embedded an API export. prompt has no positions, groups or titles, so ComfyUI auto-arranges what it can rebuild. It'll run, but for a faithful copy paste the regular workflow save file.

The person you sent it to gets no workflow. Something re-encoded the file in transit - Discord inline previews, X, most image hosts and CDNs strip text chunks. Re-encode once and the graph is gone, with no recovering it from pixels. Share it as a file download, and check by dropping your own downloaded copy back on the canvas before you blame the node.

"Verification failed … did not round-trip." The write didn't stick - disk space or output-folder permissions, in practice.

One last thing: this bakes a workflow, not character data. If you're posting publicly, remember what a graph contains - every node title, every LoRA name, any path with your username in it.

Categoryimage/cards

Inputs (3)

NameTypeDefaultDescription
imageIMAGEβ€”
json_textSTRINGβ€”
filename_prefixSTRINGWorkflow_PNG/workflowSaved in the ComfyUI output folder. Drag the resulting PNG onto the canvas to open the workflow.

Outputs (1)

NameTypeDescription
saved_pathSTRINGβ€”