ComfyUI Node

string2file

String2file

By ForeignGods·Created 2 years ago·Updated 2 years ago· 249
string2file
      string
      filename_prefixtext_files\text

      string2file writes a string out to a text file in your output folder. Simple as that. It's the older name for what Mana Nodes now labels Save/Preview Text, and while it's the least flashy node in the pack, it's the one that turns the caption pipeline from "take what the model gives you" into "fix it and use the good version."

      Why you'd reach for it

      Inside a ComfyUI graph, text lives as strings you can't really see or edit. string2file gets a string out of the graph and onto disk where you can open it. The main reason you'd bother: speech recognition mishears words, and the fix is to save the timed transcript, correct it in a text editor, and paste the corrected version back into the text-renderer's input (with the live transcription unplugged). This node is the "save" half of that loop. It doubles as a quick debugging tool too - hang it off any string output to see exactly what's passing through.

      The inputs

      The entire node is two fields:

      • string - the text to write; connect any string output to it.
      • filename_prefix - where the file lands, relative to the output folder (default text_files\text).

      There are no outputs. It's a terminal node - it writes the file and previews the content, and that's the end of that branch.

      Installing it

      It's bundled with Mana Nodes. ComfyUI Manager → search Mana Nodes → install → restart. Or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/ForeignGods/ComfyUI-Mana-Nodes.git
      

      Install requirements and restart. No models, no heavy dependencies - it's straight file writing.

      Common issues

      Naming, first: a fresh install may show Save/Preview Text rather than string2file. It's the same node under a newer label, so if a downloaded workflow calls for string2file, point it at Save/Preview Text.

      Otherwise there's little to trip on. The one recurring "where's my file" is the filename_prefix path - it's relative to ComfyUI's output directory and the default drops into a text_files subfolder, so check there, not the root. If the subfolder doesn't exist yet, it gets created on the first write.

      And remember the file is a dead end: edits you make to it stay in the file. To use corrected text you copy it back into the graph by hand (usually into the generator's text widget) - nothing re-imports it automatically. That manual round-trip is deliberate, not a missing feature; the pack's whole caption-correction workflow assumes you'll eyeball the transcript and paste the fixed version back yourself. If you're only using this node to peek at a string mid-graph rather than to save anything, that works fine too - just ignore the file it leaves behind.

      CategoryMana Nodes

      Inputs (2)

      NameTypeDefaultDescription
      stringSTRING
      filename_prefixSTRINGtext_files\text

      Outputs (0)

      No outputs