Nodes/ComfyUI_zip/Unzip To Input
ComfyUI Node

Unzip To Input

Feed ComfyUI a whole zip of images without extracting it yourself

By hmwl·Created 2 years ago·Updated about a year ago· 9
Unzip To Input
    • images
    • folder
    zip_path

    You've got a zip of reference images - a dataset you're about to process, a batch of source photos for a face-swap pipeline, whatever - and you don't want to manually extract it and drag each file into ComfyUI one at a time. That's the entire point of this node: point it at a zip, and it unpacks the images straight into ComfyUI's input folder and hands them to the rest of your graph as a proper IMAGE list. It's especially useful if you're running ComfyUI somewhere you don't have casual desktop access to the filesystem - an API worker, a headless box, a hosted instance - where "just drag the folder in" isn't an option. It can even pull the zip from a URL, so you don't need it on disk at all first.

    How it works

    Feed it a zip_path. If that string starts with http:// or https://, the node downloads it first; otherwise it treats it as a local path. Either way, it extracts into a fresh folder - unzip_<timestamp> - inside ComfyUI's real input directory, and it makes a brand-new one every single run. Unlike its sibling Zip Compress, there's no state carried between runs here.

    A few details that show the author actually hit these problems in practice: it strips out __MACOSX junk and ._ AppleDouble files that macOS stuffs into zips (annoying if you've ever opened a Mac-made zip on anything else), and it tries to fix the classic cp437-vs-UTF-8 filename mangling that happens when a zip with non-Latin filenames gets made on Windows. It walks every folder inside the zip recursively looking for files ending in .png, .jpg, .jpeg, .webp, or .bmp - anything else in there (captions, docs, subfolders of non-images) is just ignored, not extracted as an error. Every matched image gets converted to RGB before it's handed off, so if you cared about an alpha channel, it's gone by the time you see it.

    The inputs and outputs that matter

    One input: zip_path (STRING, no default) - a local filesystem path or a direct URL to a .zip file.

    Two outputs:

    • images - a list of IMAGE tensors, one per extracted image, not a single stacked batch. That's deliberate: since the images in your zip can be different resolutions, they can't be forced into one batch tensor anyway. Wire this into anything that accepts an image list - it gets processed item by item.
    • folder - the name of the unzip_<timestamp> folder it just created. Mostly useful for one thing: feed it straight into Clean Folders' input_path afterward so that scratch folder gets swept up once you're done with it, instead of typing the folder name by hand.

    Installing it

    ComfyUI Manager: search ComfyUI Zip (the pack's repo is ComfyUI_zip), install, restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hmwl/ComfyUI_zip
    

    Restart afterward. Nothing to download - no models, no heavyweight extras - it's built on the standard library plus PIL/torch/numpy, which ComfyUI already needs anyway.

    Where people get burned

    The error you'll actually hit is "No image files found in ZIP archive" - the node raises this if it walks the whole zip and finds zero files matching those five extensions. Double-check your zip actually contains plain PNG/JPG/JPEG/WEBP/BMP files and not, say, TIFFs or a nested inner zip - those get silently skipped, not converted.

    If you're feeding it a URL and the download fails, know that it uses Python's plain urllib.request with no custom headers - some hosts that block generic, non-browser user agents will refuse the request outright. If that happens, download the zip yourself once and point zip_path at the local file instead.

    The alpha-channel drop is easy to miss until you notice your "transparent" PNGs came back solid - this node always converts to RGB, no way around it via this node's inputs.

    And because a fresh unzip_<timestamp> folder gets created on every run and nothing here ever removes it, your ComfyUI input directory will quietly fill up with stale extracted-image folders over repeated runs. Pair it with Clean Folders - wire this node's folder output into Clean Folders' input_path - rather than letting them pile up.

    Categorycomfyui_zip

    Inputs (1)

    NameTypeDefaultDescription
    zip_pathSTRING

    Outputs (2)

    NameTypeDescription
    imagesIMAGE
    folderSTRING