Nodes/ComfyUI_RaykoStudio/๐ŸฆŠ RS Image-Prompt
ComfyUI Node

๐ŸฆŠ RS Image-Prompt

Steal your own prompt back from any PNG

By RaykosanยทCreated about a year agoยทUpdated about 17 hours agoยท 79
๐ŸฆŠ RS Image-Prompt
    • prompt
    โ—„imageโ–บ
    โ—„prompt_previewโ–บ

    Every ComfyUI image you save carries its whole workflow inside the file - drag it back onto the canvas and the graph rebuilds. RS Image-Prompt exploits the same metadata for a narrower job: it reads the prompt out of an image and hands it to you as a STRING, no queue run required. Find a render you like on CivitAI, drop it in, and the exact positive prompt pops out before you've even queued anything. It's the fastest way to answer "wait, what did I actually prompt for that?"

    How it works

    ComfyUI stores two chunks in a PNG: a prompt chunk with the API graph and a workflow chunk with the UI graph. The node digs into those, finds a text-encode node (CLIPTextEncode, or RaykoStudio's own RS Prompts), and extracts the positive prompt. It falls back through other formats in priority order: A1111/Forge/SD.Next parameters text, then EXIF UserComment for JPG and WebP, then generic text/Comment/Title chunks. So an image from almost any generator works - ComfyUI, A1111, Forge, SD.Next - as long as the metadata is still embedded.

    The interface is dead simple: drag an image onto the preview zone (or click it, or hit ๐Ÿ“‚ UPLOAD IMAGE), and the prompt appears in the read-only text area instantly. ๐Ÿ“ COPY puts it on your clipboard. Your selection and the extracted prompt survive page reloads, which is handy mid-workflow.

    The schema is worth a look because it's unusual: image is a STRING (the file path the widget resolves, not an IMAGE tensor) and prompt_preview is a widget holding the extracted text. The single output is prompt (STRING), and that's the whole show - wire it into a CLIP Text Encode or an RS Prompts node and regenerate.

    When you'll actually reach for it

    • Reusing your own work. That image you made three weeks ago and never wrote down the prompt for? Drop it in, done.
    • Anything you downloaded. CivitAI images routinely strip workflows but keep the prompt in the parameters text. This node is the tool that gets it out.
    • Regeneration with edits. Pull the prompt, tweak it, and run - you get continuity with a result you liked without reconstructing it from memory.

    The honest limitation: it's a prompt extractor, not a workflow extractor. You get the text, not the full graph - no samplers, no seeds, no LoRA stack. If you want the whole pipeline back, that's what dragging the PNG into ComfyUI's canvas does. This node is for when the prompt is the part you need, and you don't want to rebuild a workflow just to read a string.

    Common snags

    • "No prompt found" - the image genuinely has no metadata (screenshots, heavily recompressed files) or it was stripped by a metadata remover. Nothing to recover.
    • It only reads files, not live tensors - there's no IMAGE input. You're feeding it a path to an image file, which is exactly why it works without running the queue.

    Installing it

    Part of the RaykoStudio pack, so one install covers all of it. ComfyUI Manager โ†’ search ComfyUI_RaykoStudio โ†’ install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Raykosan/ComfyUI_RaykoStudio
    

    Restart ComfyUI. The pack's dependencies (pycairo, opencv-python, scipy, Pillow>=10) are handled by Manager; a manual clone needs pip install -r requirements.txt in the node folder. Apache 2.0, tested on ComfyUI 0.15+, Python 3.10+, Torch 2.8+.

    Category๐ŸฆŠ RaykoStudio

    Inputs (2)

    NameTypeDefaultDescription
    imageSTRINGโ€”
    prompt_previewSTRINGExtracted prompt preview (updates on file select)

    Outputs (1)

    NameTypeDescription
    promptSTRINGโ€”