Nodes/ComfyUI Easy Use/easy saveText
ComfyUI Node Runs on cloud

easy saveText

Write a string to a file, mid-graph

By yolain·Created 3 years ago·Updated 8 days ago· 2,633
easy saveText
  • image
  • text
  • image
text
output_file_path
file_name
file_extension
overwritetrue

You generated an image, and you also generated the prompt (or caption, or metadata, or a wildcard-populated string) that made it. You want that text on disk next to the picture. easy saveText writes a string to a file from inside your ComfyUI graph - no copy-paste, no separate script.

It lives in the Logic category of yolain's ComfyUI-Easy-Use pack, and the thing that makes it more useful than a bare "save a string" node is that it passes its inputs through. It doesn't dead-end the branch. Both the text and an optional image come back out the other side, so you can drop it into the middle of a chain rather than parking it at a leaf - which is exactly what you want when the save has to happen inside a conditional or a loop and still let the branch continue.

How it works

You hand it a text string and tell it where to put the file: output_file_path (the folder), file_name (the base name), and file_extension (picked from a dropdown of formats like .txt). The overwrite toggle decides whether an existing file gets replaced or left alone. Then it writes the file - and forwards the text and the passed-through image on its outputs.

The optional image input is what lets it sit in a save chain: route your final image through it and the node becomes a natural checkpoint that both records the text and keeps the picture moving downstream to your image save. It's an output node, so it also actually triggers on execution rather than getting pruned.

Inputs and outputs

The ones you'll set:

  • output_file_path - the destination folder.
  • file_name - base name for the file.
  • file_extension - the format from the dropdown.
  • overwrite - on (default) replaces, off preserves an existing file.

Outputs are text (the same string, forwarded) and image (the optional image, forwarded). Wire the image output into your image-save node so the two files land together.

Installing it

Ships with the pack. ComfyUI Manager → "ComfyUI Easy Use" → install → restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/yolain/ComfyUI-Easy-Use, then install.bat / pip install -r requirements.txt, restart.

Common issues

Same failure mode as any file-writing node: the path has to be writable by the ComfyUI process. Point it at a folder that exists and that ComfyUI can write to. On a hosted or containerized instance, that means a path inside the environment, not somewhere on your local machine - and files written there live wherever that instance stores them, so know where you're looking before you go hunting for the output.

Watch overwrite if you're saving in a loop with a fixed file_name: with overwrite on and a static name, every iteration clobbers the last, and you end up with one file instead of a set. Vary the name per iteration (fold the loop index into file_name) if you want one file per pass. And if the file never appears at all, it's almost always the path - check that first, before assuming the node is broken.

CategoryEasyUse/Logic

Inputs (6)

NameTypeDefaultDescription
textSTRING
output_file_pathSTRING
file_nameSTRING
file_extensionCOMBO2 options: txt, csv
overwriteBOOLEANtrue
imageoptIMAGE

Outputs (2)

NameTypeDescription
textSTRING
imageIMAGE