Nodes/comfyui-get-meta/Get Prompt from Image
ComfyUI Node

Get Prompt from Image

See the exact executed values behind a generated image

By shinich39·Created about a year ago·Updated 5 months ago· 9
Get Prompt from Image
  • image
  • STRING
prompt

When ComfyUI runs a workflow, it serializes the actual executed graph into a JSON structure called the "prompt" - every node, every input, with the real values that ran. Get Prompt from Image pulls that record out of a saved image and dumps it into a text widget. If you've ever wanted the ground truth of what a generation actually used, this is it.

It's part of shinich39's comfyui-get-meta pack, and it sits at the "give me the raw data" end of the pack's spectrum. The query-based nodes in the family extract one value at a time; this one hands you the whole executed graph so you can read it, archive it, or feed it somewhere else.

How it works

The pack's standard pipeline, aimed at a different field. The browser extension traces the image loader feeding the image input, has the backend open the file with Pillow, and pulls the embedded prompt metadata (JSON5-parsed, since that's ComfyUI's metadata format). It re-serializes the whole thing pretty-printed into the multiline prompt widget. The Python class just echoes the widget back, and a hardcoded always-true IS_CHANGED makes sure it re-runs and refreshes each queue.

The useful nuance is the distinction this node is built around. The workflow JSON (the pack's other dump node) is the visual graph - layout, links, node titles. The prompt JSON is what actually executed: the resolved inputs, the seed that was really used, the actual prompt string fed to the text encoder. If someone tweaked a widget and saved without rerunning, the prompt is the honest record.

The inputs and output that matter

  • image - from a supported loader: core LoadImage/LoadImageMask, Inspire Pack's "LoadImage //Inspire", Crystools' "Load image with metadata [Crystools]", or WAS Node Suite's "Image Load".
  • prompt - the multiline widget that fills with the JSON. Read it or pipe it; don't edit it.

The single STRING output carries the full prompt JSON - send it to a save-text node, a text viewer, or any consumer that wants the executed graph as data.

Installing it

ComfyUI Manager → search comfyui-get-meta → Install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/shinich39/comfyui-get-meta

Restart after cloning. No models, no requirements.txt, no heavy dependencies - just Pillow (already a ComfyUI dependency) and a bundled JSON5 parser.

Common issues

  • Widget shows {} - the image carries no prompt metadata. Stripped saves, re-uploads, screenshots. The #1 cause, as with every node in this pack.
  • It's JSON, so it's ugly - expected. You're looking at a machine record, not a summary. If you want the human-readable prompt instead, that's Get String from Image with a CLIPTextEncode.text query.
  • Unsupported loader - only the supported image loaders get traced; anything else means no file path and no fill.

Honest take: this is an audit tool more than a creative one. It shines when you want proof of what a workflow ran, when you're archiving generations with their exact settings, or when you're writing something that consumes the executed graph as data. For day-to-day image work, you'll reach for the query nodes far more often - but when you need the record, nothing else in the pack gives it to you whole.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
promptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING