Nodes/Comfyui_PDuse/PDTool:ZIP Packingsave 📦
ComfyUI Node

PDTool:ZIP Packingsave 📦

Dump images, text and audio into a zip without leaving the graph

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PDTool:ZIP Packingsave 📦
  • data
  • zip_path
  • file_size
filename_prefixPD_ZIP_Archive
custom_names

The "pack everything up and hand me a .zip" node

PD_ZIP_Packingsave (the 📦 one) takes whatever you feed into its data input and writes it into a zip archive saved to ComfyUI's output folder. Images become PNGs, plain strings become .txt files, file paths get their files copied in, audio tensors become .wav, and it all lands in one PD_ZIP_Archive_00001.zip you can download and hand off. It's the "export my run as a bundle" node - for delivering a batch of outputs, packaging a generated asset set, or collecting workflow artifacts into a single file.

It's also a nice illustration of the ANY-type mechanic the KB's comfyui-node-plumbing.md describes: the data socket is typed *, so it accepts anything - and the node does the polymorphic work of figuring out what each item is and how to serialize it. That flexibility is the whole point: one node, many input types, one zip out.

How it works

The source walks the input recursively. A 4D torch tensor is treated as a batch of images, each frame saved as PNG; a 3D HWC tensor becomes a single PNG. A string that points to an existing file on disk gets copied in by filename; any other string is written as a .txt. A dict with waveform and sample_rate keys is saved as .wav via torchaudio. Filenames inside the zip come from the optional custom_names input (one per item, newline- or comma-separated) or are auto-generated (0001_file.png style), and long names are truncated to 120 characters so Windows path limits don't explode. The zip lands in ComfyUI/output/ using ComfyUI's standard save-path machinery, numbered by counter like a SaveImage run.

Inputs and outputs

  • data (required, *) - anything: an IMAGE, a list of strings, paths, whatever.
  • filename_prefix - base name for the zip, default PD_ZIP_Archive.
  • custom_names (optional) - control the internal filenames, one per item.
  • Outputs: zip_path (where it was written) and file_size (human-readable, e.g. 1.42 MB). It's an output node, so it always runs and the zip is immediately visible in the UI.

Installing it

Part of Comfyui_PDuse:

cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/Comfyui_PDuse.git
cd Comfyui_PDuse
pip install -r requirements.txt

Or search "Comfyui_PDuse" in ComfyUI Manager and restart.

The gotchas, honestly

Audio is the flaky corner: the .wav path imports torchaudio, which is not in the pack's requirements.txt, and the whole branch is wrapped in a try/except - so if you feed it audio and torchaudio isn't installed, you get a zip with no audio in it and a silent console error instead of a crash. Install torchaudio yourself if that's your use case. Also, if the node can't recognize anything in data (e.g. you connected nothing valid), it deletes the half-written zip and returns empty strings - which reads like a broken node until you realize it's "nothing to package." And remember the zip goes to output/, not wherever you happened to be working. For everything else - batching images, collecting text, handing off a folder of artifacts - it's the rare node that just does what it says on the box.

CategoryPDTool

Inputs (3)

NameTypeDefaultDescription
data*
filename_prefixSTRINGPD_ZIP_Archive
custom_namesoptSTRING

Outputs (2)

NameTypeDescription
zip_pathSTRING
file_sizeSTRING