Nodes/ComfyUI-OSS-Upload/OSS File Uploader
ComfyUI Node

OSS File Uploader

The Generic Bucket Shovel for Anything on Your Disk

By ahkimkoo·Created about a year ago·Updated 8 months ago· 1
OSS File Uploader
    • url
    file_path
    endpointoss-cn-shanghai.aliyuncs.com
    bucketcck-sh
    access_key
    access_secret
    pathaigc/up
    random_filenametrue
    filenamefile

    The other three nodes in this pack know what they're pushing - an image, a video, an audio file - and handle the encoding for you. This one doesn't care. You give it a path to any file on the machine running ComfyUI, it uploads that file to your Alibaba Cloud OSS bucket and hands you back the URL. That makes it the grab-bag node of the family: a LoRA you just trained, a caption text file, a zip of outputs, a config file, a checkpoint you want mirrored off the local disk.

    It's the same shared setup as the rest of ComfyUI-OSS-Upload: OSS credentials on the node, oss2 under the hood, URL out. If your ComfyUI runs on Alibaba Cloud hosting, this is how arbitrary artifacts get from the box into a bucket.

    How it works

    Simple and honest: it validates the path exists and is a file, grabs the extension from the source filename, then does a put_object via oss2. Retries run up to 20 attempts, three seconds apart (the code; the README says 10). Random filenames keep the source extension - or fall back to .dat for extensionless files - and the URL format is the same https://{bucket}.{endpoint}/{path}/{filename} as the rest of the pack.

    The inputs that matter

    • file_path - a plain STRING. There's nothing to wire in from the graph; type the path, or feed it from a text-producing node.
    • endpoint, bucket, access_key, access_secret - your OSS settings. Defaults are the author's own bucket (cck-sh, path aigc/up) - change them.
    • path - folder prefix in the bucket.
    • random_filename (default on) - timestamp + random string. Off means filename is used.

    What comes out

    One output: a url STRING pointing at the uploaded file.

    Gotchas, and the one worth taking seriously

    First, the practical one: file_path is relative to the machine ComfyUI runs on, not your browser. If ComfyUI is on a remote box, the path has to be one that box can see. People burn real time on this.

    Second, uploads are blocking. A big checkpoint or a multi-GB video will hold the whole graph until the transfer finishes. For files that size, this node is the wrong tool anyway - use OSS's own CLI or a sync job. This node shines on the modest stuff: a trained LoRA, a sidecar text file, a handful of outputs that all need to land in the same bucket.

    Third, the security one, and it's unique to this node. Because it reads an arbitrary path on the server, it's the node in the pack a hostile workflow could use to read local files off your box and push them to a bucket - with your keys sitting right there in the workflow JSON, all four nodes put credentials in the graph. The file uploader adds a path you didn't choose to the exfiltration story. Don't run workflows you don't trust, use a scoped AccessKey, and keep the bucket private.

    Same error-swallowing as its siblings: failures come back as a string starting with Error: rather than a raised exception, with the real problem in the console log.

    Installing it

    Manager → search "ComfyUI-OSS-Upload" → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ahkimkoo/ComfyUI-OSS-Upload
    

    then restart ComfyUI. No model downloads, no GPU cost. Install the pack's full dependency list rather than the README's pip install oss2 one-liner:

    pip install -r custom_nodes/ComfyUI-OSS-Upload/requirements.txt
    

    Reach for it at the end of a training run to archive the LoRA, or any time a file that just got produced should live in the cloud and none of the typed uploaders fit. For media output, prefer the typed nodes - they do the encoding work for you. This one is for everything else.

    CategoryOSS Upload

    Inputs (8)

    NameTypeDefaultDescription
    file_pathSTRING
    endpointSTRINGoss-cn-shanghai.aliyuncs.com
    bucketSTRINGcck-sh
    access_keySTRING
    access_secretSTRING
    pathSTRINGaigc/up
    random_filenameBOOLEANtrue
    filenameSTRINGfile

    Outputs (1)

    NameTypeDescription
    urlSTRING