Nodes/ComfyUI-Just-Nodes/Save Image With Text πŸ’Ž Just Nodes
ComfyUI Node

Save Image With Text πŸ’Ž Just Nodes

Save an image with its caption attached β€” the dataset builder

By Arroz-11Β·Created 7 months agoΒ·Updated 3 days agoΒ· 0
Save Image With Text πŸ’Ž Just Nodes
  • image
  • filepath
β—„pathoutputβ–Ί
β—„filename_prefixJNβ–Ί
β—„filename_delimiter_β–Ί
β—„filename_padding4β–Ί
β—„extensionβ–Ύβ–Ί
β—„quality100β–Ί
β—„embed_workflowfalseβ–Ί
β—„show_previewtrueβ–Ί
β—„textβ€”β–Ί

Save Image With Text is the flagship of the Just Nodes pack - the only one Google has ever bothered asking about - and for good reason: it's the node that turns ComfyUI into a dataset factory. You feed it an image and a text string, and it saves the pair together. PNG gets the text embedded as just_text metadata inside the file; JPEG and WebP get a companion .txt file with the same name. Either way, the caption travels with the image.

If you've ever built training data by generating a thousand images and then manually captioning them, you know the pain this removes. Wire the prompt that produced the image into the optional text input (it's forceInput, so connect a string - a Picker output, a Prompt Stack, anything), save the image, and your captions are already in the files when you sit down to tag a dataset. For jpg/webp, every saved file gets a matching .txt sidecar in the same folder - the exact caption-per-image layout most training tools and WAS's text-file ecosystem expect.

The file handling is where this node shows its thoughtfulness. path is relative to your ComfyUI output directory unless you give it an absolute path (it creates the folder if missing). The counter scans the folder first and starts at the highest existing number plus one, so you can run, re-run, and re-run again without ever clobbering an earlier image. filename_prefix (default "JN"), filename_delimiter, and filename_padding (default 4, giving JN_0001.png) control the naming. quality (1–100) applies to jpg and webp; WebP goes lossless at quality 100. embed_workflow stuffs the full workflow JSON into the PNG metadata - handy if you want the standard "drag the PNG back in" workflow sharing, though it costs a little file size. show_preview toggles whether the saved image pops up in the results panel.

One output: filepath, the full path of the first saved image as a string. If your image input is a batch, every frame gets saved (numbered sequentially) and the first filepath is returned - wire that into a text-display or logging node and you've got a record of where things landed.

Installing it

Standard Just Nodes install - ComfyUI Manager, search "Just Nodes", install, restart; or cd ComfyUI/custom_nodes && git clone https://github.com/Arroz-11/ComfyUI-Just-Nodes.git. No models, no extra dependencies, MIT licensed.

Gotchas

  • The text lives in PNG metadata, not as a file. Round-tripping works because the pack's own Load Image With Text reads just_text back out. External tools that don't know about that metadata key will just see a normal PNG.
  • jpg/webp get a .txt sidecar, not embedded text - JPEG has no metadata slot worth trusting for captions.
  • Watch your path - it's relative to the output dir unless absolute, and it will happily create new folders for you.
  • Counter collision is handled with a while-loop bump, so two nodes writing to the same folder still can't overwrite each other.
CategoryπŸ’Ž Just Nodes

Inputs (10)

NameTypeDefaultDescription
imageIMAGEβ€”
pathSTRINGoutputβ€”
filename_prefixSTRINGJNβ€”
filename_delimiterSTRING_β€”
filename_paddingINT41–9β€”
extensionCOMBO3 options: png, jpg, webp
qualityINT1001–100β€”
embed_workflowBOOLEANfalseβ€”
show_previewBOOLEANtrueβ€”
textoptSTRINGβ€”

Outputs (1)

NameTypeDescription
filepathSTRINGβ€”