Nodes/ComfyUI-FairLab/Download Image
ComfyUI Node

Download Image

The name is a lie — Download Image actually saves your images with alpha support

By yanhuifair·Created 2 years ago·Updated 3 months ago· 2
Download Image
  • images
  • masks
    filename_prefixComfyUI_{time}_{batch_num}

    Let's get the confusion out of the way first: despite the name, this node downloads nothing from the internet and needs no network access or API key. What it actually does - per the author's own description - is save image tensors to ComfyUI's output area with optional mask-driven alpha, so you can preview and download the result. It's a save node with a misleading label, and once you know that, it's genuinely useful.

    Where it beats the stock SaveImage is in the filename and the alpha handling. The filename_prefix supports two tokens that the core save node doesn't give you: {time}, which gets stamped with a YYYY-MM-DD-HH-MM-SS timestamp, and {batch_num}, which substitutes each image's position in the batch. That makes it a clean way to save batch output with per-image, time-stamped names straight out of the box - the default prefix is literally ComfyUI_{time}_{batch_num}.

    The alpha part is the feature people actually seek out. If you wire a masks input in, the node treats 1 − mask as the alpha channel and saves the image as a transparent PNG - the classic way to export an object cut from its background, or a mask-driven composite, without a separate flatten step. No mask, no problem: it saves a plain RGB PNG. Either way, it embeds the standard workflow/prompt metadata into the PNG text chunks, so the "image is the project file" property the KB's image-I/O doc describes applies here - drag the output back onto the canvas and your graph comes back.

    The inputs:

    • images - the image batch to save.
    • filename_prefix - name template with {time} and {batch_num} tokens, default ComfyUI_{time}_{batch_num}.
    • masks (optional) - if connected, becomes the alpha channel (1 − mask).

    No outputs - it's an output node that returns UI results, which is why it has an empty RETURN_TYPES. In ComfyUI terms that makes it a terminal node like Save Image: it always runs, and it's where a workflow can end.

    A couple of honest notes. Files go to ComfyUI's temp/output directory rather than a custom folder - you'll find them in the usual output location shown in the UI, not necessarily in ComfyUI/output/ depending on how your instance routes temp. And the node is basically a fork of core ComfyUI's save logic (same PngInfo metadata embedding, same compression-level handling), so if you already have a save setup you like, this is mainly worth it for the alpha-from-mask trick and the filename tokens.

    Install is the standard pack path: ComfyUI Manager → search ComfyUI-FairLab → install → restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yanhuifair/ComfyUI-FairLab.git
    cd ComfyUI-FairLab
    pip install -r requirements.txt
    

    Restart, search "Download Image". No models, no network, no extra dependencies beyond what the pack installs - it's just Pillow and ComfyUI's own folder helpers under the hood.

    CategoryFair/image

    Inputs (3)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGComfyUI_{time}_{batch_num}
    masksoptMASK

    Outputs (0)

    No outputs