Mememage Extract Workflow
Get the workflow back out of a Mememage record
- workflow
- has_workflow
Here's the combination that makes this pack quietly clever: ComfyUI normally stores your workflow inside the PNG as text metadata - and the moment that image is re-encoded (Discord, a JPEG conversion, a screenshot), the workflow is gone forever. Mememage's Encode node can also embed the generating graph in the record as comfy_prompt - but now it lives inside a verifiable record, which rides in the pixels of the bar and the record file. Strip the PNG metadata all you want; the workflow is still in the record. Mememage Extract Workflow is the node that pulls it back out.
How it works
Feed it a record (required input - from Load / Find / Fetch Record, or from Encode's record output), and it extracts the embedded graph:
workflow- the graph JSON as a string, in ComfyUI API format. This is the same format thepromptchunk in a PNG uses - the flattened, runnable version of the graph, not the annotated UI layout (theimage-io-metadatadoc explains the workflow-vs-prompt distinction).has_workflow- boolean.Truewhen the record actually carried acomfy_prompt;Falsewhen it didn't (for example, the image was stamped withembed_workflowoff, or you've got a record with only fields).
The node is marked as an output node, which means it always runs - and there's a reason: the 💾 download workflow (.json) button on it writes the graph to a file. The design here is deliberately non-destructive. It never touches your current canvas. Queue the node once so it can read the record, hit the button, and you get a .json you can drag onto ComfyUI to open in a new tab - your working graph stays exactly as it was. (You can also just wire workflow into a Preview node to read the JSON inline.)
Why you'd want this
Three scenarios, in order of how often they matter:
- You received a Mememage image + record and want to reproduce it. Extract the workflow, drag it in, done - even if the image's PNG metadata was stripped long ago.
- You're auditing your own archive. Decode an old image, fetch its record, extract the recipe. The record survives where the PNG chunk didn't.
- You want to share the recipe without the canvas. Pull the workflow out of a record and hand someone the
.json- cleaner than screenshotting your graph.
One honest caveat: because the graph is embedded at conception time, it captures the graph as it was when the image was stamped. If you changed nodes since, the record holds the old recipe - which is exactly what provenance should do.
Installing it
Same pack, same routine. ComfyUI Manager → search "Mememage" → Install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/sememtac/mememage-comfy
<ComfyUI-python> -m pip install mememage
Restart; it's under Mememage/Records. No models, no keys.
Common issues
has_workflowis False on a record you expect to have one. The image was likely stamped withembed_workflowoff (it's on by default, but easy to flip). Or the record genuinely predates the feature. Nothing to extract is reported honestly asFalse, not as a crash.- The download button writes nothing. It needs the node to have run first so it has the record in hand - queue the graph once, then hit 💾.
- "The workflow opens as numbered nodes, not my neat layout." Expected. It's the API format - the flattened, runnable graph - not the annotated UI layout with positions and reroutes. It runs; it just isn't a pretty canvas. For the pretty version, you'd need the PNG's
workflowchunk, which is exactly what gets stripped on re-encode - which is why the record version is the survivor.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| record | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| workflow | STRING | — |
| has_workflow | BOOLEAN | — |