Nodes/LF Nodes/Save Markdown
ComfyUI Node

Save Markdown

Write that LLM-generated doc to disk, timestamp and all

By lucafoscili·Created 2 years ago·Updated 2 years ago· 50
Save Markdown
  • ui_widget
  • string
markdown_text
filename_prefix
add_timestamptrue

Most ComfyUI save nodes are about images. LF_SaveMarkdown is the odd one that writes text - specifically Markdown - to disk, and it exists to close the loop on LF's local-LLM documentation pipeline. LF_MarkdownDocGenerator produces the markdown, this node persists it. Simple, but the details are where it earns its place.

Three inputs, all plain: markdown_text is the content to save. filename_prefix is the path and filename, and the tooltip spells out the convention: use slashes to create directories - docs/api/README gets you a file in a docs/api folder. The add_timestamp toggle (on by default) appends a timestamp to the filename as a suffix, so repeated runs write README-20260816-... files instead of clobbering each other. That's the behavior you want when you're iterating on LLM-generated docs and want a history of every version; flip it off when you want a stable filename that always points at the latest doc.

Output is a single string that passes the markdown back through unchanged. It's marked as an output node, which means it's the end of a branch - you put it after the node that generated the text, it saves, and you're done. But because it passes the text through, you can also chain it: generate, save, and still hand the same markdown to a display or further processing node in one path.

The obvious pairing is LF_RegionExtractorLF_MarkdownDocGenerator → this. Extract code regions, get the LLM to document them, save the result next to your source. The timestamp is what makes that a sane workflow - regenerate docs on every change and you can diff against the previous version, which is how you actually catch an LLM confidently documenting code that no longer exists.

A couple of practical notes. The node writes wherever the path points, relative to ComfyUI's working directory unless you use an absolute path - if you're not finding files where you expected, that's why. And unlike image savers it doesn't touch the output-folder conventions, so keep your own mental model of where markdown lands. There's no built-in overwrite protection beyond the timestamp, so with add_timestamp off, a rerun replaces the file - occasionally exactly what you want, occasionally a foot-gun.

Install is the pack standard: ComfyUI Manager → "LF Nodes", or git clone https://github.com/lucafoscili/comfyui-lf into custom_nodes, then restart. No models, no dependencies. And the note you'll see on every page in this pack: comfyui-lf is frozen in legacy mode (fully functional), with active development in lucafoscili/lf-nodes - the save node is there too if you're starting fresh.

Category✨ LF Nodes/IO Operations

Inputs (4)

NameTypeDefaultDescription
markdown_textSTRINGMarkdown data to save.
filename_prefixSTRINGPath and filename for saving the Markdown. Use slashes to set directories.
add_timestampBOOLEANtrueAdd timestamp to the filename as a suffix.
ui_widgetoptKUL_TREE[object Object]

Outputs (1)

NameTypeDescription
stringSTRING