GU Extract Prompt
Get the actual prompt back out of an image's metadata
- meta
- pos_prompt
- neg_prompt
- unsure_prompt
Every ComfyUI image embeds its workflow in the PNG. Dragging that image back onto the canvas rebuilds the whole graph - but sometimes you don't want the graph, you want the words: the positive prompt, the negative prompt, as plain strings you can reuse. That's the entire reason GU Extract Prompt exists.
It reads the embedded workflow metadata from an incoming image and tries to reconstruct what your prompt actually was, splitting it into positive, negative, and "couldn't tell" buckets.
What feeds it
The single input is meta, type METADATA_RAW, and it's forceInput - you don't type anything. The intended upstream is a loader that surfaces raw metadata, like the "Load Image with Metadata" nodes various packs ship (the README names that one explicitly). Those emit the parsed metadata object; this node digs into the workflow section and inspects every node.
How it works - and why it's a heuristic, not magic
The node walks the embedded workflow's node list and scores each node by its title or class name. If the name contains words like prompt, encode, string, positive, negative, pos, neg - or matches text-display nodes such as ShowText, which often hold the final combined prompt - the node's first widget value (the string in its text field) gets collected. A name with "pos" routes the text to pos_prompt, "neg" to neg_prompt, and anything ambiguous to unsure_prompt.
It also filters: nodes named things like openpose, vaeencode, joinstring, or anything starting with get_/set_ are excluded, because they contain text that isn't your prompt. Disabled (muted) nodes are skipped entirely.
So the three outputs:
- pos_prompt - likely positive prompt, accumulated line by line.
- neg_prompt - likely negative prompt.
- unsure_prompt - strings it found that it couldn't confidently classify.
The honest caveats
This is keyword matching over workflow titles, not an LLM reading your graph. Results are only as good as the node titles in the workflow you're reading. Cleanly labeled graphs (positive/negative CLIP Text Encode, a ShowText at the end) extract beautifully; a graph where every node is named "Node 1" through "Node 40" gives you a shrug and everything in unsure_prompt. And it takes only the first widget value per node - fine for a single text box, wrong if a node's real prompt lives in a later field. It's a "get me back into the ballpark" tool for prompt recovery, and it's very good at that. For pixel-perfect reconstruction, the full workflow replay is still the PNG itself.
Install & notes
ComfyUI Manager → search "GU Nodepack" → install → restart, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/alexguryev/ComfyUI-GU_Nodepack
cd ComfyUI-GU_Nodepack
pip install -r requirements.txt
No model downloads. Windows-tested, single-user design, everything else best-effort. If you're chaining this into a GU Image Label to caption your outputs, that's the intended loop: label the image, and the label itself can be re-extracted later.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| meta | METADATA_RAW | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| pos_prompt | STRING | — |
| neg_prompt | STRING | — |
| unsure_prompt | STRING | — |