ComfyUI Node

FL PDF Saver

Write a PDF object from your graph to disk

By filliptm·Created 3 years ago·Updated about 6 hours ago· 628
FL PDF Saver
  • pdf
  • STRING
output_directory
filenameoutput

Fill-Nodes (by filliptm, aka Machinedelusions) has its own little PDF toolkit buried inside its much bigger pile of image, GPT, and video nodes - loaders, a merger, a text extractor, an encryptor, and this: the node that actually commits a PDF to your filesystem. Every one of those PDF nodes passes around an in-memory PDF object, and FL_PDFSaver is the terminal step that turns that object into a real file.

How it works

It's about as plain as a save node gets: take the bytes carried inside the incoming PDF object, write them to output_directory/filename.pdf, creating the directory if it doesn't already exist. If your filename doesn't already end in .pdf, it appends the extension for you - you can't accidentally save report instead of report.pdf.

The inputs and outputs that matter

  • pdf - the PDF object to write. This has to come from an upstream PDF-producing node (FL_PDFMerger, FL_TextToPDF, FL_ImagesToPDF, FL_PDFEncryptor, or FL_PDFLoader if you're just round-tripping a file).
  • output_directory - where to write it. Defaults to an empty string, which is the one thing to get right up front (see below).
  • filename - defaults to output; set something meaningful, since this node doesn't auto-increment or protect you from overwriting a previous run.

The output is a single STRING: the full path it actually wrote to. That's genuinely useful - wire it into FL_ShowText if you want to confirm on-node exactly where the file landed, or pass it to something else that needs the path as a string (a Discord webhook message, a log node, whatever).

How to install it

ComfyUI Manager: search "Fill-Nodes" and install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
pip install -r ComfyUI_Fill-Nodes/requirements.txt

Restart ComfyUI afterward - this specific node has no dependency beyond plain file I/O, but the pack installs its whole PDF stack (PyPDF2, ReportLab, PyMuPDF) as one unit regardless of which single node you actually wanted.

Common issues & troubleshooting

output_directory defaulting to "" is a trap. An empty string resolves relative to wherever ComfyUI's process working directory happens to be, which is rarely where you expect. Set an explicit path - either an absolute one, or something clearly relative to your ComfyUI install (./output/pdfs, say) - rather than leaving it blank and hunting for the file afterward.

Silent overwrites. Unlike ComfyUI's built-in image saver, there's no auto-incrementing counter here. Run the same graph twice with the same output_directory/filename and the second run clobbers the first. If you're batching, put something variable - a timestamp, a seed, an index from upstream - into the filename yourself.

"It ran but I can't find the file." Check the STRING output. It's the exact path the node wrote to, which is the fastest way to settle any confusion about where output_directory actually resolved.

Category🏵️Fill Nodes/PDF

Inputs (3)

NameTypeDefaultDescription
pdfPDF
output_directorySTRING
filenameSTRINGoutput

Outputs (1)

NameTypeDescription
STRINGSTRING