Save DOC
Save a document to disk — from .wasdoc to .pdf, from one node
- doc
- file_path
Save DOC is the file-writing end of WAS Node Suite's document story: it takes a DOC or plain text from any string output and writes it to disk, in whichever format you ask for. The file_format dropdown is the whole node - .wasdoc, .html, plain text, or a laid-out .docx, .odt or .pdf - so "what format does the world need this in" is a menu choice, not a pipeline redesign.
It pairs with the document side of the pack: Load Document brings a file in on a DOC wire, Rich Text Editor or Text to DOC produce one from nothing, and this node is where any of that ends up as a real file. The .wasdoc format is the suite's own container - the only format that keeps the metadata and embedded files intact for a later Load Document round trip. The rest are conversions for the outside world.
What each format actually is
.wasdoc- the container itself. Loses nothing: markup, metadata, embedded files. Choose this for anything you'll read back into ComfyUI..html- a whole page with the metadata in its head. The natural format for a document you're going to publish or email..txtand friends - the text alone, tags removed..docx,.odt,.pdf- the document laid out on a page. These are a conversion, not a copy, so some styling doesn't survive - that's the honest caveat baked into the tooltips.
The docx/odt/pdf trio is the one part of the pack that wants packages you don't have yet. Save DOC reads through python-docx, odfdo and xhtml2pdf, named in the error when any is missing, and the group sits behind document_export in config.yaml. The README's optional install, for a portable ComfyUI:
python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\was-node-suite-comfyui\requirements\document_export.txt
then set document_export: true under features: in config.yaml and restart. Everything else this node does needs nothing beyond the pack itself.
The filename machinery
Like the other save nodes it numbers files unless you stop it: filename_prefix (tokens expand here, so a date can go in), filename_delimiter, filename_number_padding (4 gives _0001; 0 drops the number entirely and the exact name is written). A filename_suffix of _draft lands after the number. For the page formats there's also page_size (A4 by default) and orientation. The single output, file_path, is the full path written - wire it into a log, a report, or a ZIP collection so the document doesn't vanish into the output folder unnoticed.
The containment rule
The file has to land somewhere the pack may write: ComfyUI's own output or temp, or a folder you've added under paths.allow_write in config.yaml. Outside those, the write is refused rather than silently dumping somewhere. That boundary is why root is a menu of permitted places rather than a free-text path box - it's a security feature wearing a UX hat.
Installing
Save DOC ships in WAS Node Suite v3 - ComfyUI Manager, search WAS Node Suite v3, or clone https://github.com/WASasquatch/was-node-suite-comfyui into custom_nodes and restart. Needs ComfyUI 0.14.0+ and Python 3.10+. The pack itself installs nothing; the only extra step is the optional document_export requirements above, if you want the three laid-out formats.
Worth knowing: .pdf is written, never read - the pack's Load Document explicitly refuses PDFs. Save DOC is an output node in the practical sense; if you need a PDF into a workflow, convert it first.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| doc | DOC,STRING | What to write. A DOC carries its markup, its metadata and every embedded file; a string is written through unchanged, which suits generated code. This socket takes a connection. | |
| file_format | COMBO | .wasdoc | What the file holds, and the extension it gets. '.wasdoc' loses nothing, the plain formats write the text alone, and '.docx', '.odt' and '.pdf' are laid out from the markup. |
| root | COMBO | Which folder the file lands in: ComfyUI's own 'output' or 'temp', or any folder added under paths.allow_write in config.yaml, listed by its own name. filename_prefix names the part below it, so '[time(%Y-%m-%d)]/notes' files each day's under a dated folder. | |
| filename_prefix | STRING | ComfyUI | The name part of each file, before the number. Tokens are expanded here too, so a date or a custom token can go in the name rather than the folder. |
| filename_delimiter | STRING | _ | What sits between the name and the number: 'ComfyUI_0001.wasdoc' with the default, 'ComfyUI0001.wasdoc' if cleared. |
| filename_number_padding | INT | 40–9 | How many digits the number is padded to with leading zeros: 4 gives '_0001', 1 gives '_1'. 0 drops the number and rewrites the same file every run. |
| filename_suffixopt | STRING | Extra text placed after the number and before the extension, so a suffix of '_draft' gives 'ComfyUI_0001_draft.wasdoc'. Empty by default. | |
| page_sizeopt | COMBO | A4 | Paper the page is laid out on, for '.docx', '.odt' and '.pdf' only. A4 is the size used everywhere but North America, where Letter is. |
| orientationopt | COMBO | portrait | Which way round the page is, for '.docx', '.odt' and '.pdf' only. 'landscape' swaps the width and the height, which a wide table needs; 'portrait' is the usual way up for prose. |
| margin_mmopt | FLOAT | 20.00–100 | Blank edge left on all four sides in millimetres, for '.docx', '.odt' and '.pdf' only. 25.4 is one inch, and 0 runs the text to the very edge. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | The full path of the file that was written, so a later node can report it, print it, or collect it into an archive. It names the file that actually got the bytes, numbering and all, rather than the folder that was asked for. |