Nodes/ComfyUI-Image-Process/Save Image (ICO)
ComfyUI Node

Save Image (ICO)

Save a whole batch of frames as one Windows icon file

By wakaura-asaho·Created 5 months ago·Updated 2 months ago· 1
Save Image (ICO)
  • images
    filename_prefixComfyUI
    save_invalid_as_pngtrue

    Save Image (ICO) does one specific thing ComfyUI's built-in savers won't: it bundles a whole batch of images into a single .ico file - the multi-resolution container Windows uses for app icons. Feed it frames at 16, 24, 32, 48, 64, 128, and 256 pixels and it writes one .ico holding all of them, which is exactly what Windows wants for a proper app icon (it picks the right size for the context, down to the taskbar).

    Most ComfyUI users will never need this. If you're generating icons - app icons, tray icons, favicons, game launcher art - the alternatives are grim: core ComfyUI has no ICO saver at all, and your other option is saving PNGs and hand-assembling the .ico in an image editor. This node kills that round-trip.

    How it works

    It converts every input frame to RGBA, then checks each one against the seven legal ICO dimensions (16, 24, 32, 48, 64, 128, 256 - square, obviously). Valid frames get written into one .ico via Pillow's append_images mechanism, each at its own size. Anything that doesn't match is handled by the Save Invalid as PNG toggle (default on): non-conforming frames get dumped next to the icon as _INVALID.png files so you can see what failed. Turn it off and invalid frames are silently discarded - handy if you're feeding a batch and only some frames are meant to land.

    Two other things worth knowing. The batch is capped at 256 frames (a hard ValueError if you exceed it - the ICO format can't hold more anyway). And there's no alpha-mask input here: alpha comes straight from the input image's own alpha channel, so if you want a transparent icon, feed it an image that already has transparency.

    The inputs that matter

    • Images (IMAGE) - the batch to bundle. Sizes must be square and on the legal list; the node won't resize for you, so match them in the graph (an ImageScale or the target size is on you).
    • Filename Prefix - the only other thing you'll set. Supports this pack's token system: %date:yyyy-MM-dd%, %hour%, %minute%, %width%, %height% all resolve here. Right-click the node for the "Insert Filename Token" helper menu.

    No outputs - it's a terminal save node, like every savers in the pack. The .ico lands in ComfyUI/output and shows up in your history.

    Install

    This node ships in ComfyUI-Image-Process:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wakaura-asaho/comfyui-image-process
    pip install -r comfyui-image-process/requirements.txt
    

    then restart - or find "ComfyUI-Image-Process" in ComfyUI Manager. Dependencies are the usual numpy/Pillow/scipy/opencv/scikit-image stack; no models to download. It targets modern ComfyUI (frontend ≥ 1.37, base ≥ 0.12), so a stale install won't list it.

    The trap to dodge

    The classic mistake is feeding it one big image (like a 1024×1024 render) expecting the node to downscale into an icon. It doesn't. Frames must already be the legal sizes, or they're either discarded or saved as invalid PNGs. If you're starting from a single render, generate your sizes in the graph - a batch of resized copies - and let the icon be born complete. The pack even ships an example workflow (example_workflow_imagesv_ico.json) showing the size chain; steal it if you don't want to rebuild by hand.

    CategoryWakaura

    Inputs (3)

    NameTypeDefaultDescription
    imagesIMAGEThe images to be bundled into a single ICO file. Each image must be square and match a valid ICO size (16, 24, 32, 48, 64, 128, or 256 px).
    filename_prefixSTRINGComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.
    save_invalid_as_pngBOOLEANtrueWhen enabled, images that fail ICO validation are saved as individual PNG files with an `_INVALID` suffix. When disabled, invalid images are silently discarded.

    Outputs (0)

    No outputs