Load String From Image
Steal the Prompt From Any Posted Image (Legally)
- image
- STRING
Someone posts a gorgeous image and the first thing you want is the prompt. Load String From Image pulls text straight out of the image's embedded workflow metadata - the exact prompt, verbatim, ready to wire into your own CLIP Text Encode. No retyping, no squinting at a screenshot.
It's the most useful node in comfyui-parse-image, shinich39's five-node metadata-reading pack. The other siblings dig out ints, floats, booleans, and combo dropdowns. This one handles free text, and free text is what you actually care about in half of the images you save.
How it works
Every image ComfyUI saves carries its generating workflow as JSON in the PNG metadata - that's why dragging an image back into ComfyUI rebuilds the graph. This node reads that JSON and returns the value of one text widget. The README's examples cover the queries people actually use:
CLIP Text Encode (Prompt).text- the positive prompt, using the node's titleCLIPTextEncode.text- the same node, addressed by its type nameNote.text- the contents of a Note node, handy when people stash workflow notes in the graph
Same mechanism as its siblings: feed it an image from a supported loader - core LoadImage, LoadImageMask, Inspire's LoadImage //Inspire, Crystools' "Load image with metadata", and a few others - and set the query.
Three inputs:
- image - from one of those loaders.
- query - the dotted path, e.g.
CLIP Text Encode (Prompt).text. - string - the fallback text when the query finds nothing. Defaults to empty, and it's a multiline field.
The output is a single STRING, and it wires directly into a CLIP Text Encode's text input, or a Show Text / text display node if you just want to read the prompt on screen.
Why it beats copy-paste
The metadata is exact - punctuation, line breaks, every (emphasis:1.2) weight intact. Copying a prompt from a screenshot is how you lose a stray parenthesis and then spend an hour wondering why your result is nothing like theirs. This node can't fail to transcribe. And because it works on whatever image is in your graph, it makes "here's an image I like, match its prompt" a two-node operation instead of a manual chore.
Installing it
No downloads beyond the pack: no models, no pip dependencies, nothing to fetch. Install via ComfyUI Manager (search "comfyui-parse-image") or:
cd ComfyUI/custom_nodes
git clone https://github.com/shinich39/comfyui-parse-image
Restart ComfyUI and find it under Add node > loaders > Load String From Image.
Common issues
The fallback empty string is the tell. If you keep getting nothing back, your query doesn't match a text widget in that image's workflow - the prompt node was addressed by title in the examples, so if you see CLIP Text Encode (Prompt).text return empty, try CLIPTextEncode.text (type name) or dig the node's ID out of the embedded workflow. Also note this only reads workflow metadata: an image that had its workflow stripped on export, or one loaded through a loader that discards metadata, simply has no prompt to find. And a small reality check: this reads the prompt that was in the workflow, which is almost always what you want, but it's not magic - if the poster cleaned their image before sharing, the prompt may be gone with it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| query | STRING | — | |
| string | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |