Nodes/ComfyUI-CloudStorage/Load Image From Cloud
ComfyUI Node

Load Image From Cloud

Load Image From Cloud — the built-in Load Image, but the file lives in a bucket

By philipy1219·Created about a year ago·Updated about a year ago· 2
Load Image From Cloud
    • IMAGE
    • MASK
    storage_typeoss
    endpoint
    bucket
    file_key
    regionus-east-1

    Load Image From Cloud is the cloud twin of ComfyUI's stock Load Image node - same behavior, different disk. Instead of picking a file from ComfyUI/input/, you point it at a file path inside an Aliyun OSS or AWS S3 bucket and it downloads, decodes, and feeds the exact same IMAGE tensor into your graph. If you already have a workflow built around Load Image, you can swap it out with zero rewiring downstream.

    Where it pays off: you're generating on a rented GPU box that resets between sessions, or your source images live in a shared bucket that a few machines read from. Point every box at the same bucket and they all pull the same references without you syncing files around.

    How it works

    It's a thin wrapper over the same logic the core LoadImage node uses. It pulls the file down into memory (via oss2 for OSS, boto3 for S3), opens it with Pillow, applies EXIF rotation, converts to RGB, and returns an image tensor. Straightforward - the only real machinery is the network hop.

    The one ComfyUI-ism worth knowing: like core Load Image, it returns both IMAGE and MASK. The mask is the inverted alpha channel (1 - alpha), so an opaque PNG gives you an all-zero mask. In ComfyUI's convention, 1 means "the masked/inpainted region," which is why it's inverted - if you only want the image, just leave the MASK output unwired.

    Inputs that matter

    • storage_type - oss or s3.
    • endpoint - OSS: oss-cn-beijing.aliyuncs.com style, no scheme. S3: optional; blank means standard S3.
    • bucket - bucket name.
    • file_key - the file's path inside the bucket. This is the one you'll actually edit per-run.
    • region - S3 only, defaults to us-east-1.

    Credentials, the pack-wide quirk

    Like every node here, Load Image From Cloud takes no key inputs - it reads ALIYUN_ACCESS_KEY_ID / ALIYUN_ACCESS_KEY_SECRET (OSS) or AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (S3) from the environment. Set them where ComfyUI launches and restart. No keys in widgets means none of them leak into saved workflows, which is a nice property, but it's also the first thing that trips people up. Missing env vars raise Missing required environment variables for oss/s3 storage.

    Install

    Via ComfyUI Manager (search "ComfyUI-CloudStorage"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/philipy1219/ComfyUI-CloudStorage
    pip install oss2 boto3
    

    Restart ComfyUI. No models to download.

    Common issues

    • Stale image. This node has no IS_CHANGED override, so ComfyUI caches its output based on the widget values. If the file in the bucket changes but you keep the same file_key, the node may not re-run - change something (or clear the cache) to force a fresh download. The pack's other load nodes do force reloads; this one doesn't.
    • The read-403 problem. A private bucket URL loads fine from the node's own SDK but won't work in a browser. That's an access-policy question, not a node bug.
    • Network errors. The failure message wraps the underlying download error, so check that the endpoint, bucket, and file_key actually exist before assuming credentials are wrong.

    It's a small node that does exactly one job. If your images are local, the built-in Load Image is objectively better - use this one when the source of truth is genuinely in the cloud.

    Categorycloud_storage

    Inputs (5)

    NameTypeDefaultDescription
    storage_typeCOMBOoss2 options: oss, s3
    endpointSTRING
    bucketSTRING
    file_keySTRINGFile path in cloud storage
    regionoptSTRINGus-east-1Region for S3 storage only

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK