๐ฆ RS Image-Text
Hide a prompt inside a PNG and get it back later โ like a poor man's CivitAI workflow
- image
- text
You've downloaded an image from CivitAI, it has no embedded workflow, and the only thing you have is the picture. ๐ฆ RS Image-Text (LoadImageWithText) lets you tuck the prompt into the PNG file itself as a text chunk, then load that same PNG later and have the prompt come out the other side alongside the image. It's two utilities in one node: a writer and a reader.
How it works
The mechanism is the PNG text chunk. The node opens your image, and in write mode it attaches your text_input to a Description metadata field via Pillow's PngInfo, then saves the result to your ComfyUI output folder with the filename_prefix you set (default Civitai/prompt), auto-incrementing a counter so you never overwrite. JPEG input gets converted to PNG first, because JPEG has no place for that metadata. In read mode it opens the image, pulls the Description field back out, and returns it as a STRING alongside the image tensor.
The README frames the use case precisely: you have an image and its prompt, but the image carries no workflow - common on CivitAI. Write the prompt in, and from then on that file carries its own caption. You can also use it as a plain Load Image replacement, since the image output is a normal tensor.
Inputs that matter
mode-read(default) orwrite. Set to write when you want to save the prompt into the file.filename_prefix- output prefix for write mode (tooltip: "Prefix to save to output (write only)").text_input- the text to embed (write only).image- file picker from yourComfyUI/inputfolder, same as the native loader.
Outputs: image (IMAGE) and text (STRING) - the embedded caption, or empty in write mode (where it echoes back what you wrote).
How to install
Part of ComfyUI_RaykoStudio:
cd ComfyUI/custom_nodes
git clone https://github.com/Raykosan/ComfyUI_RaykoStudio.git
Restart ComfyUI, or install via ComfyUI Manager (search "ComfyUI_RaykoStudio"). No extra dependencies beyond the pack's standard ones.
Common issues
- Text doesn't come back in read mode. The image you're reading was written by something else that didn't use the
Descriptionfield - most tools write different metadata keys (likeparametersorprompt), and this node only looks atDescription. So it round-trips its own files, but won't read every PNG on the internet. - Forgetting to switch to write. Default is read; if you set the text and nothing happens, check the mode.
- Where did my file go? Write mode saves to
ComfyUI/output, not next to your input. Look in the output folder.
The honest caveat: if your goal is to recover prompts from arbitrary downloaded images, this only works on files it (or something writing Description) created - it's not a universal prompt extractor. But as a self-contained "image + its prompt" bundle that survives file transfers, it's neat and zero-dependency.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | read | 2 options: read, write |
| filename_prefix | STRING | Civitai/prompt | Prefix to save to output (write only) |
| text_input | STRING | Text to write (write only) | |
| image | COMBO | 1 options: example.png |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | โ |
| text | STRING | โ |