Nodes/ComfyUI-Simple_Readable_Metadata-SG/Simple Readable Metadata Save Text-SG
ComfyUI Node

Simple Readable Metadata Save Text-SG

Save any string to .txt, .json, or .md without leaving the graph

By ShammiG·Created 10 months ago·Updated 6 months ago· 63
Simple Readable Metadata Save Text-SG
      text
      filename_prefixComfyUI_text
      file_formattxt
      pretty_jsontrue

      Sometimes you want the metadata to outlive the workflow. The main metadata node shows you a readable summary on screen, but screens reset when you close ComfyUI. SimpleReadableMetadataSaveTextSG is the dump-it-to-disk sibling: it takes any STRING and writes it to a file in your ComfyUI output folder as .txt, .json, or .md. Wire it the pack's readable-metadata output, or just feed it any text you want preserved.

      It's about as simple as a node gets. Four inputs, no outputs, it's a terminal node - the thing your string flows into and stops.

      The inputs

      • text (multiline) - whatever you're saving. Typically the Simple_Readable_Metadata or metadata_raw output from the image nodes in this pack, so you get a permanent, human-readable record of every image you generate or inspect.
      • filename_prefix (default ComfyUI_text) - the base name. It supports ComfyUI-style date placeholders: %date% expands to YYYY-MM-DD, %time% to HH-MM-SS, and there's fancier %date:format% handling under the hood. If the file already exists, a _00001-style counter is appended so you never overwrite an earlier save. Set it to something like metadata_%date% and you get one record per day instead of a pile of same-named files.
      • file_format - txt, json, or md. Pick json when you're saving metadata_raw and want to keep it machine-readable.
      • pretty_json (default on) - when writing JSON, indent it so a human can actually read it. Leave it on.

      Why you'd bother

      Honestly, this node earns its keep in two situations. First, batch inspection: if you're running a bunch of images through the metadata reader to check what sampler or CFG someone used, dumping each one to a text file gives you a searchable archive instead of a scrolling terminal. Second, workflow documentation: saving your positive/negative prompts as .md next to your output images is a nice habit for anything you're going to revisit months later.

      The mechanism is boring in the good way - the source grabs ComfyUI's output directory, parses the prefix, and writes the text straight out. No image encoding, no format conversion beyond plain file writing.

      Installing

      Shared with the whole pack:

      cd ComfyUI/custom_nodes
      git clone https://github.com/ShammiG/ComfyUI-Simple_Readable_Metadata-SG.git
      cd ComfyUI-Simple_Readable_Metadata-SG
      pip install -r requirements.txt   # just opencv-python
      

      Or via Manager → Custom Nodes Manager, searching Simple Readable Metadata-SG, install, restart. No models, no extra downloads.

      Pitfalls worth knowing

      • Where did the file go? It lands in ComfyUI/output, same place your images go. If you can't find it, that's where to look.
      • Pretty JSON doesn't change JSON validity - metadata_raw from a ComfyUI image is a JSON string, and saving it as .json keeps it parseable either way.
      • The Node 2.0 watch item applies pack-wide: on ComfyUI 0.3.76+, keep Node 2.0 switched off or this pack's widgets misbehave.

      If you need the same save-on-a-schedule convenience for prompts specifically, the pack's Save Prompt nodes do something similar but write into the image metadata instead of a sidecar file - different job, same family.

      Categoryutils

      Inputs (4)

      NameTypeDefaultDescription
      textSTRING
      filename_prefixSTRINGComfyUI_text
      file_formatCOMBOtxt3 options: txt, json, md
      pretty_jsonBOOLEANtrue

      Outputs (0)

      No outputs