PDF文件製作器
From Renders to a Print-Ready A4 Magazine, Pages and All
- images
- floorplanimage
- result
This is the payoff node of the whole pack: the thing that turns a pile of rendered room images into an actual A4 magazine PDF with covers, a contents page, room spreads, and a summary - laid out, not just concatenated. Where PDFMagazineGenerator is the writer, PDFMagazineMaker is the typesetter, and it's the piece of this pack that has the most code and the least hype behind it.
What it is
A pure document-assembly node built on reportlab. No LLM, no API, no image generation - everything arrives on its inputs: the render batch from your sampler, the json_data from PDFMagazineGenerator, and the original floor plan. What it adds is layout: four page-layout schemes × five templates, all drawn with reportlab's canvas primitives on A4 pages.
How it works
The node parses json_data, smartly distributes your images across the pages (recycling images if you're short), registers the bundled cht.ttf for Chinese text, and then draws each page by its page_type. Covers and room pages each come in four layouts - 版型A-經典佈局, 版型B-滿版圖文, 版型C-藝術拼貼, 版型D-反轉經典 - while the contents page is where your floor plan gets reused (that's what the floorplanimage input is for, the same plan you fed the generator, now drawn as a page element instead of analyzed). It writes the file with a timestamp appended to the name - magazine_20260826_143022.pdf style - so it never overwrites your previous run, and returns the full saved path in the result output.
The inputs that matter
images- your rendered images, as a batch.json_data- the JSON string from PDFMagazineGenerator.floorplanimage- the original floor plan, reused for the layout/contents page. Easy to forget; the node just won't draw that page element if it's missing.template- five editorial looks (經典雜誌, 現代簡約, 時尚風格, 專業商務, 溫馨居家).layout- the four page layouts above. If you want variety without touching code, this andtemplateare the knobs.font- defaults to the pack'scht.ttf.output_path- default./output/magazine.pdf(the timestamp is added to the filename, and the directory is created if needed).
The single output, result, is a string naming the saved file.
Installing it
It ships in ComfyUI-DesignPack, so it's the same shared install: ComfyUI Manager → search "ComfyUI-DesignPack" → Install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/dseditor/ComfyUI-DesignPack
cd ComfyUI-DesignPack
pip install -r requirements.txt
then restart ComfyUI. The dependency that actually matters for this node is reportlab. No model downloads.
Where people get burned
The Chinese font is the big one. The node registers fonts/cht.ttf with reportlab at runtime, and if that file is missing or renamed, register_font silently falls back to Helvetica - which does not contain Chinese glyphs, so every character in the magazine renders as a blank box. Keep the pack's fonts folder intact; if you've been tidying your custom_nodes directory, this is the node that will punish you for it. (The console will print 字體註冊失敗 when it happens, which is your clue.)
Beyond that, the same count-matching rule as the PowerPoint maker applies: the number of images has to line up with what json_data expects, and mismatches produce error strings instead of a file. And because every page is drawn element by element, expect the first run to take a few seconds - it's doing real layout work, not stamping images.
It's also worth being honest about scope: everything here is Traditional Chinese, the default output path is relative to your ComfyUI working directory, and the magazine structure is hard-coded around an interior-design proposal. This is a specialist's tool built for a specific job - if that job is yours, it's impressively complete. If not, you're likely to fight the assumptions more than you enjoy the output.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| json_data | STRING | — | |
| floorplanimage | IMAGE | — | |
| template | COMBO | 經典雜誌 | 5 options: 經典雜誌, 現代簡約, 時尚風格, 專業商務, 溫馨居家 |
| layout | COMBO | 版型A-經典佈局 | 4 options: 版型A-經典佈局, 版型B-滿版圖文, 版型C-藝術拼貼, 版型D-反轉經典 |
| font | COMBO | cht.ttf | 1 options: cht.ttf |
| output_path | STRING | ./output/magazine.pdf | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |