Nodes/ComfyUI PDF Nodes/Save PDF 💾📄
ComfyUI Node

Save PDF 💾📄

Write your pages to a real PDF file

By orion4d·Created about a year ago·Updated about a year ago· 1
Save PDF 💾📄
  • pdf_pages
  • saved_pdf_path
output_directoryoutput/
filename_prefixcomfy_pdf
overwrite_existingdisable

Save PDF 💾📄 is where every workflow in the ComfyUI PDF Nodes pack ends. Merge, rotate, or single-page-select all produce in-memory page lists - none of that is a file until this node writes one. It's an output node, the pack's version of ComfyUI's own save-image nodes, and you'll place it at the bottom of practically every graph you build here. No Save, no PDF on disk.

The inputs that matter

  • pdf_pages (PDF_PAGES) - the pages to write out. Comes from Load (whole doc), Merge (combined doc), Select (single page), or Rotate (fixed doc).
  • output_directory (STRING, default output/) - where the file goes, relative to your ComfyUI root folder (so output/ means ComfyUI/output/, where your generated images already land). Absolute paths work too. If the directory doesn't exist, the node creates it for you - one less thing to trip on.
  • filename_prefix (STRING, default comfy_pdf) - the base name. The node appends .pdf, so you get comfy_pdf.pdf.
  • overwrite_existing (enum: enable / disable, default disable) - the one setting with a real opinion. On disable (the default), an existing file never gets clobbered: the node appends a counter instead, so a second save becomes comfy_pdf_1.pdf, then comfy_pdf_2.pdf. On enable, it overwrites the same path every time. If you're re-running a workflow repeatedly and hate .pdf_37 piles, enable is your friend; if you want a trail of runs, keep disable.

The output

saved_pdf_path (STRING) - the full path to the file that was written. It's mostly for your own confirmation - show it in a text node, log it, or pass it to something downstream that wants a file location. The actual saving happens as a side effect; this node's job is done the moment the file exists.

How it works

Under the hood it's pypdf's PdfWriter doing add_page() for every page in the list, then writer.write() to disk. No model, no image libraries, no heavy lifting. It does fail quietly in the pack's signature way: an empty page list just returns an empty string with a console note, so if Save gives you nothing, the empty list almost certainly originated upstream in a failed PDFLoad.

Common issues

  • "Where did my file go?" It went to ComfyUI/output/comfy_pdf.pdf (or wherever you set output_directory). Relative paths resolve against the folder where you launched ComfyUI, not the node's folder - the same gotcha as PDFLoad's pdf_path.
  • Unexpected _1 suffix. That's overwrite_existing set to disable doing its job. Toggle it to enable if you actually want the same filename reused.
  • Nothing appears in the output. Check the console for PDFSaveNode: No PDF pages provided to save. - then walk back up the graph to the load.

Install

Same pack, same routine:

cd ComfyUI/custom_nodes/
git clone https://github.com/orion4d/ComfyUI_pdf_nodes.git
cd ComfyUI_pdf_nodes && pip install -r requirements.txt

Or ComfyUI Manager → search "ComfyUI PDF Nodes", restart, and it's under the PDF category. Requires only pypdf - no PyMuPDF or Pillow. It's the boring final step, and like all boring final steps it's the difference between a workflow that does something and a workflow that just warms up your RAM.

CategoryPDF

Inputs (4)

NameTypeDefaultDescription
pdf_pagesPDF_PAGES
output_directorySTRINGoutput/
filename_prefixSTRINGcomfy_pdf
overwrite_existingCOMBOdisable2 options: enable, disable

Outputs (1)

NameTypeDescription
saved_pdf_pathSTRING