Nodes/ComfyUI-Light-Tool/Light-Tool: Save File To Aliyun OSS
ComfyUI Node

Light-Tool: Save File To Aliyun OSS

Push files to Alibaba's OSS bucket and get back a URL

By ihmily·Created 2 years ago·Updated 4 months ago· 20
Light-Tool: Save File To Aliyun OSS
    • file_url
    file
    save_name
    endpoint
    bucket
    oss_access_key_id
    oss_access_key_secret
    oss_session_token
    visit_endpoint
    use_cnamefalse
    signfalse
    timeout0

    This node is for a specific audience: people already living in Alibaba Cloud's ecosystem who want their ComfyUI outputs uploaded straight to an OSS bucket and handed back as a shareable URL. If that's you, it's genuinely handy - one node does upload plus optional signed-URL generation. If you're not on Aliyun, this is a hard pass; there's no generic cloud-upload here, and it needs credentials you'll have to keep in the workflow.

    What you set

    The full list of inputs is: file, save_name, endpoint, bucket, oss_access_key_id, oss_access_key_secret, oss_session_token, visit_endpoint, use_cname, sign, and timeout. The ones you'll actually touch:

    • file - what to upload. It's flexible: a bare filename (searched in ComfyUI's output dir, then input dir), a full local path, or an http(s):// URL (which it downloads first, using save_name or the URL's filename).
    • endpoint + bucket - your OSS endpoint (e.g. oss-cn-hangzhou.aliyuncs.com, https:// is added if missing) and bucket name. Both required.
    • oss_access_key_id / oss_access_key_secret - your Aliyun credentials.
    • sign + timeout - set sign true to get a signed URL valid for timeout seconds (default 0, which means the bucket's default policy applies). Useful for private buckets.
    • visit_endpoint + use_cname - for custom domains: use_cname tells the client the endpoint is your own domain, and visit_endpoint overrides the domain used in the returned URL.

    Output is a single file_url string - either the plain bucket URL or a signed one, per the above. That string is the whole point: it's what you hand to a webhook, a database, or a "share this render" step.

    Why you'd use it

    If you're automating renders into an object store - a bot that posts images, a gallery backend on Aliyun, a pipeline that ships results to a bucket for a frontend to serve - this collapses the "upload + get URL" step into one node. The optional STS session token input is a genuinely good touch: prefer temporary credentials over long-lived keys.

    Installing it

    Part of ComfyUI-Light-Tool by Hmily. ComfyUI Manager → search "ComfyUI-Light-Tool" → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ihmily/ComfyUI-Light-Tool
    pip install -r requirements.txt
    # restart ComfyUI
    

    The oss2 dependency (from requirements.txt) is required and gets installed with the pack. Network access needed at runtime; no models.

    Where people get burned

    • Credentials live in the workflow. Your access key is a plain text field that gets saved with the graph JSON. Never share the workflow, and use an STS token / scoped key with minimal permissions.
    • Missing file errors are explicit but blunt. If the resolved path doesn't exist you get a FileNotFoundError naming the path - so double-check the file resolution rules (bare name → output, then input).
    • Signed URL expiry. sign URLs die after timeout seconds; if your consumer is slow, extend it.
    • It's Aliyun-specific. No S3, no GCS, no general object storage. If you're not on OSS, this node is dead weight for you.
    • Uploads are synchronous. Big files block the queue while they push. Fine for occasional uploads, annoying at scale.

    An honest niche tool: right audience, right job, and it does the job without fuss - just keep those keys out of any workflow you share.

    CategoryComfyUI-Light-Tool/OSS

    Inputs (11)

    NameTypeDefaultDescription
    fileSTRING
    save_nameSTRING
    endpointSTRING
    bucketSTRING
    oss_access_key_idSTRING
    oss_access_key_secretSTRING
    oss_session_tokenSTRING
    visit_endpointSTRING
    use_cnameBOOLEANfalse
    signBOOLEANfalse
    timeoutINT0

    Outputs (1)

    NameTypeDescription
    file_urlSTRING