Nodes/comfyui-bunny-cdn-storage/Save Image to BunnyStorage
ComfyUI Node

Save Image to BunnyStorage

Push ComfyUI images straight to Bunny CDN

By k-komarov·Created 2 years ago·Updated 2 years ago· 0
Save Image to BunnyStorage
  • images
    api_key
    storage_zone
    storage_zone_regionla
    pathnamepathname for file

    You know that moment when your ComfyUI pipeline finishes a batch and you just want the results to exist on a URL - for a Discord bot to post, a gallery page to show, an API caller to fetch - and instead you're SSH-ing around, copying files off a headless box, and half-writing an upload script? This node is that script, inlined into your graph. It takes the IMAGE coming out of your VAEDecode, uploads each frame as a PNG to your Bunny.net storage zone, and hands back https://<your-zone>.b-cdn.net/<pathname>/<uuid>.png. Nothing else leaves your machine - no model, no prompt, no workflow. Just pixels, on a public CDN.

    Bunny is the cheap object storage + CDN of choice for this: pennies a gigabyte, no S3 credential dance, and files land on Bunny's edge network the second they're written. If you've ever wanted "generate now, share instantly" without babysitting an uploader, that's the whole pitch.

    Let's be honest about what this is first: a ~100-line, one-node pack with no README to speak of and essentially zero community footprint. It does exactly one thing and asks you to trust it for that one thing. For a weekend bot or a personal gallery it's fine. For a serious production pipeline, you'd write your own Python node or use a workflow-integrating uploader - but for "make my images publicly fetchable," this works out of the box.

    How it works

    For every image in the batch, the node does a very mechanical thing:

    1. Converts the float tensor to a PIL image and saves it as PNG to a temp file.
    2. PUTs it over HTTP to https://<region>.storage.bunnycdn.com/<zone>/<pathname>/<uuid>.png, passing the zone's access key in a header (via the bunnycdnpython library - the only real dependency, since pillow and numpy already ship with ComfyUI).
    3. Builds the public CDN URL and returns it through the node UI.

    Filenames are random uuid4 hex, so nothing ever collides - but you also get zero control over names. Every run uploads fresh files, and nothing ever gets cleaned up, so zones accumulate cruft until you prune them in the Bunny dashboard.

    One subtle thing: the node's code accepts ComfyUI's hidden prompt/extra_pnginfo inputs (the mechanism the built-in Save Image uses to stamp workflow metadata into PNGs) and then… never uses them. Your uploaded PNG carries no ComfyUI metadata at all. That's arguably good for privacy and bad for reproducibility - you can't drag an uploaded image back into ComfyUI and reconstruct the graph the way you can with a locally-saved output.

    The inputs that matter

    Only five fields, four of them plain strings. The ones you'll actually set:

    • images - wire your final VAEDecode output here.
    • api_key - the storage zone's API access key (listed as the "FTP/API password" in your zone's settings). Not your Bunny account API key; those are different credentials.
    • storage_zone - the name of your zone, e.g. mygen.
    • storage_zone_region - the zone's region code, default la. It must match where the zone actually lives (chosen when you create it), or uploads fail.
    • pathname - folder prefix inside the zone, e.g. gallery/run3.

    There are no outputs. It's a terminal node: the URL is the product.

    Installing it

    ComfyUI Manager, search comfyui-bunny-cdn-storage, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/k-komarov/comfyui-bunny-cdn-storage
    

    then restart ComfyUI. The node's requirements.txt pulls in bunnycdnpython; ComfyUI usually installs missing deps on startup, and if it doesn't, pip install bunnycdnpython sorts it. No models to download, nothing heavy.

    The traps

    • Windows breaks it. The temp dir is hardcoded to /tmp, which doesn't exist on Windows - you'll hit a FileNotFoundError on save. Linux and macOS are fine. If you're on Windows, this node is a fork-and-patch job.
    • Region mismatch. Point the region field at the wrong code and Bunny rejects the PUT. Match it to the zone you actually created.
    • The API key lives in the workflow JSON. Share a workflow with this node in it and your storage key goes with it. Strip it before sharing, or treat those workflows as private.
    • No format options. Always PNG, exactly as ComfyUI outputs it - no compression level, no JPEG.

    So: Linux user with a Bunny zone who wants image URLs without ceremony? This is a three-minute setup and it just works. Windows user or someone who needs predictable filenames? Look elsewhere.

    Categoryimage

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE
    api_keySTRING
    storage_zoneSTRING
    storage_zone_regionSTRINGla
    pathnameSTRINGpathname for file

    Outputs (0)

    No outputs