Nodes/ComfyUI_yanc/๐Ÿ˜ผ> Save Text
ComfyUI Node

๐Ÿ˜ผ> Save Text

Write a string to disk, the same way Save Image writes a file

By ALatentPlaceยทCreated 2 years agoยทUpdated 2 years agoยท 80
๐Ÿ˜ผ> Save Text
      โ—„textโ€”โ–บ
      โ—„filename_prefixComfyUIโ–บ
      โ—„folderโ–บ
      โ—„filename_optโ€”โ–บ

      ComfyUI has a Save Image node built in. It doesn't have a Save Text node built in, and there's plenty of text worth keeping around outside the image itself - the exact prompt a batch used, an LLM captioner's output, a generated story or translated caption. This node is that missing piece.

      How it works

      Feed it a string and it writes it to a file in your output directory, inside a subfolder if you give one, with a filename built from filename_prefix. It's a terminal node - it has no outputs, nothing chains off it, same as Save Image. Useful pairings: log the settings or prompt a run used alongside its output images, save a captioning node's result as a sidecar text file next to the image it describes, or just dump any text your graph produces instead of watching it disappear once the queue finishes.

      The inputs and outputs that matter

      • text (STRING) - required, whatever you want written to disk.
      • filename_prefix (STRING, default "ComfyUI") - the base name for the output file.
      • folder (STRING, default empty) - an optional subfolder inside your output directory; leave it blank to save directly in the output root.
      • filename_opt (STRING, optional) - see the warning below before you connect this.

      No outputs - this node is a sink.

      How to install it

      Via ComfyUI Manager: search "yanc" or "ComfyUI_yanc" and install, then restart. Manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/ALatentPlace/ComfyUI_yanc
      

      then restart ComfyUI. No extra dependencies or model downloads.

      Common issues & troubleshooting

      Your text file keeps getting overwritten instead of piling up. This is the same documented behavior as this pack's Save Image node, and it's worth taking seriously: connecting filename_opt turns off the automatic dynamic naming that normally guarantees a fresh filename per run. If filename_opt produces the same value across runs - which it will, unless you're actively varying it - every run silently overwrites the last one's file. Leave filename_opt disconnected if you want every run to land as its own file; only wire it in deliberately, for something like a single "always the latest" file you want overwritten on purpose.

      Nothing appears to happen. Check text actually has content flowing into it - an empty or disconnected string input will still "succeed" but write nothing useful. Also confirm you're looking in the right place: with folder set, the file lands in a subfolder of your output directory, not the root.

      You expected to chain something off this node and can't. It has zero outputs by design - it's a save/sink node like Save Image, not a passthrough. If you need the text to keep flowing elsewhere in the graph, branch it off before it hits Save Text, not after.

      CategoryYANC/๐Ÿ˜ผ Text

      Inputs (4)

      NameTypeDefaultDescription
      textSTRINGโ€”
      filename_prefixSTRINGComfyUIโ€”
      folderSTRINGโ€”
      filename_optoptSTRINGโ€”

      Outputs (0)

      No outputs