Nodes/Comfyui-GLM_Prompt/Aliyun OSS Download
ComfyUI Node

Aliyun OSS Download

Pull a file out of Aliyun OSS and into ComfyUI as a local path

By jiandanplus·Created about a year ago·Updated about a year ago· 2
Aliyun OSS Download
    • local_file
    access_key_id
    access_key_secret
    endpoint
    bucket_name
    oss_file_path
    local_save_path

    The mirror image of the pack's Aliyun OSS Upload node: give it a file key that lives in an Alibaba Cloud OSS bucket, and it downloads that object to a local path and returns the path as a string. Where the uploader mints URLs, this one mints local files.

    You reach for it when your inputs live in the cloud instead of on disk - a shared bucket your team or your scripts drop reference images, masks, LoRAs, or configs into, and you want them inside a ComfyUI graph without manually dragging files around. It's the "fetch an asset from object storage" node, and it's bundled in Comfyui-GLM_Prompt, a GLM prompt-helper pack, purely as a companion utility (it sits in the menu under JFD/aliyun_oss). If that pack is already on your install for the GLM prompt nodes, this is a free downloader.

    How it works

    Same oss2 SDK plumbing as its sibling, reversed: Auth from your key pair, open the Bucket, then get_object_to_file(oss_file_path, local_save_path). One nice touch the source does for you - it creates the parent directory of local_save_path before downloading, so you don't get cryptic failures for a folder that doesn't exist yet.

    The fields, all plain strings:

    • access_key_id / access_key_secret - your Aliyun RAM key pair, typed straight into the node.
    • endpoint - regional URL like https://oss-cn-hangzhou.aliyuncs.com; must match the bucket's region.
    • bucket_name - the bucket the object lives in. The key needs read permission on it.
    • oss_file_path - the object key inside the bucket, e.g. references/mask_01.png.
    • local_save_path - where to write it, e.g. C:/ComfyUI/input/mask_01.png. Absolute path.

    Output is one local_file STRING - the path you asked for, assuming it worked. And the same caveat as its sibling: errors are returned as strings, not raised. The node catches everything and hands back "Download failed: ..." as a normal-looking output, so a run can report success while the real value is an error message. Verify the string before wiring it anywhere important.

    Install

    Identical to the upload node since they share a pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jiandanplus/Comfyui-GLM_Prompt
    

    then restart. Or ComfyUI Manager → Install Custom Nodes → search Comfyui-GLM_Prompt. The pack's requirements.txt pins oss2==2.15.0 and aliyun-python-sdk-core==2.15.0; Manager handles deps, and a manual clone means pip install -r requirements.txt in the pack folder before restarting.

    Gotchas

    • Keys in the workflow. Same story as the uploader - credentials are node inputs, so they get baked into saved workflow JSON and PNG metadata. Never share a workflow with real keys in it. Scope a RAM sub-user to just this bucket and rotate if anything leaks.
    • Don't expect to plug it into Load Image. Load Image wants a filename relative to ComfyUI/input, not an absolute path. If you set local_save_path inside the input folder, you can load the file normally afterwards - otherwise wire local_file to a ShowText or a downstream node that genuinely consumes a path string.
    • Region mismatch is a silent 404. Endpoint and bucket region have to agree, and the key needs read access. Both failures surface as a "Download failed" string rather than a thrown exception, so a blank-looking output usually means permissions, not network.

    It's a thin node, but it's the right thin tool: two string inputs that matter, one path out, and it does the one job without fuss.

    CategoryJFD/aliyun_oss

    Inputs (6)

    NameTypeDefaultDescription
    access_key_idSTRING
    access_key_secretSTRING
    endpointSTRING
    bucket_nameSTRING
    oss_file_pathSTRING
    local_save_pathSTRING

    Outputs (1)

    NameTypeDescription
    local_fileSTRING