Nodes/Comfyui_PDuse/PD加载文本ZIP(输出列表)
ComfyUI Node

PD加载文本ZIP(输出列表)

Unzip a caption pack in the browser and read every text file

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD加载文本ZIP(输出列表)
    • text_list
    • concat_text
    • filename_text
    • file_count
    zip_file_upload

    Most "share your dataset" downloads arrive as a zip. PD_LoadTextsFromZip ("PD加载文本ZIP(输出列表)") is the loader that skips the unzip step: you upload a zip through the node's own upload button, and it extracts every text file inside and returns them as a list - same four outputs as the pack's folder-text loader, but driven by a file you dragged in instead of a path on disk. For grabbing a caption pack from a friend or a training-prep collection, it's the most convenient loader in the pack: no CLI unzip, no folder path, just click and go.

    It's from 7BEII/Comfyui_PDuse, the PDuse utility pack. Its sibling PD_LoadTextsFromDir does the same job from a folder; this one trades the folder path for an upload.

    How it works

    The zip_file_upload input is a string slot with custom frontend JavaScript that turns it into a real upload button (the pack ships a web/ directory for exactly this). You upload the zip, the file lands in ComfyUI's input/ directory, and the node opens it, walks the archive, and reads the text files out of it. Outputs mirror the folder version exactly:

    • text_list - file contents as a list (the one you actually wire forward).
    • concat_text - everything concatenated into one string.
    • filename_text - filenames, newline-joined.
    • file_count - how many text files were in the archive.

    Because the contents come out index-aligned with the filenames, you can zip captions and images together, load the captions here, load the images with the pack's folder image loader, and the pairing holds - same ordering assumptions, same gotchas.

    The inputs

    • zip_file_upload - the upload slot. That's the entire schema: no path, no limit, no options. If the field is empty or the file can't be found, you get the same fail-soft empty list ([""], "", "", 0) as the rest of the pack.

    Installing

    ComfyUI Manager, search Comfyui_PDuse; or:

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

    Restart. No models. The upload button only appears after the frontend loads its web/ assets, so if you don't see the button after restarting, hard-refresh the browser.

    Gotchas

    The display name is Chinese, so search for the class PD_LoadTextsFromZip in the node menu. The node reads text files but doesn't filter aggressively - a nested info.json or README.md inside the zip will be read too and will shift your index alignment, so keep caption packs clean. And there's no recursion cap or file-size guard worth trusting: a giant zip unzips fully into memory, so don't feed it your entire drive. For the everyday case - "someone sent me a caption pack, let me read it into my workflow" - this is the fastest path in the pack, and honestly the upload-button UX is the nicest part of it.

    CategoryPDuse/Text

    Inputs (1)

    NameTypeDefaultDescription
    zip_file_uploadSTRING

    Outputs (4)

    NameTypeDescription
    text_listSTRING
    concat_textSTRING
    filename_textSTRING
    file_countINT