Merge PDFs ➕📄
Stitch two PDFs into one page list, then chain it
- pdf_pages_a
- pdf_pages_b
- PDF_PAGES
Merge PDFs ➕📄 takes two PDF_PAGES lists and combines them into one. That's the entire feature set, and it's the node you reach for whenever a single PDF isn't one PDF. Combine a cover page with a body document. Append an appendix. Put two scans into one file before you rotate or save them. It's the pack's only combining operation, so most multi-document workflows route through it.
The inputs that matter
Only two, and they're both the same type:
pdf_pages_a(PDF_PAGES) - first list.pdf_pages_b(PDF_PAGES) - second list.
Output is a single PDF_PAGES list with a's pages followed by b's pages. Order is just concatenation - whatever you put in a comes first in the output, no reordering options. If you need a different order, wire the lists in differently, not in a different order into the same node.
There's no "merge three PDFs" input. You chain: Load A and Load B into one Merge, then merge that output with Load C. Merging is cheap - it's just pypdf pages being collected - so chaining five of them for a batch of documents is completely normal and won't cost you meaningful time.
How it works
Under the hood it builds a pypdf.PdfWriter, adds every page from a and every page from b, and returns the writer's page list. Two things worth knowing about the mechanism:
- Each loaded PDF is its own universe.
PDFLoadhands you livePageObjects from that file's reader. Merge copies them into a fresh writer, so the output list is self-contained - you can save it, rotate it, or extract text from it independently. - Page dimensions and rotation carry over. If page 2 of doc A is landscape and page 3 is portrait, they stay that way in the merged output. There's no normalization here; that's a preview/render concern, and the batch render node has its own opinions about mixed sizes.
Where it bites
The most common beginner stumble is wiring two PDFLoad outputs straight into Merge and forgetting the second load. The other is expecting the merged result to be a real file - it isn't. Merge produces an in-memory page list; you still need Save PDF to write it to disk. A "merge and save" workflow is Load → Load → Merge → Save, and Save is the step people leave out on their first try.
Also: empty inputs are tolerated, not rejected. If one of your loads failed (wrong path, wrong password), Merge happily produces a list that's just the other PDF's pages, and nothing tells you a whole document vanished. Check the console when the saved result is missing content.
Install
Same pack install as the rest of the PDF Nodes:
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, find it under PDF. This node needs only pypdf - no image libraries, no models. It's a boring, dependable utility node, which is exactly what you want when the alternative is opening five PDFs in a separate program and manually concatenating them for the hundredth time.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| pdf_pages_a | PDF_PAGES | — | |
| pdf_pages_b | PDF_PAGES | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PDF_PAGES | PDF_PAGES | — |