Nodes/ComfyS3/Upload File to S3
ComfyUI Node

Upload File to S3

Get any file off your machine from inside ComfyUI

By TemryL·Created 3 years ago·Updated 2 years ago· 62
Upload File to S3
    • s3_paths
    s3_filename
    local_pathinput/example.png
    s3_folderoutput
    delete_local

    UploadFileS3 is the general-purpose exit door of the ComfyS3 pack: it takes any file sitting on your machine and pushes it into an Amazon S3 bucket, straight from the graph. Finished images, a LoRA you just trained, a pile of reference PNGs, a half-baked checkpoint - if it's a file, this node can ship it to the cloud. It's the upload half of the pack's file shuttle, and it pairs naturally with DownloadFileS3, which does the reverse.

    Why would you bother? Most people reaching for this are running ComfyUI on a box they don't want to babysit. You generate, upload the results, and let the bucket be the source of truth that another machine, a teammate, or an API consumer pulls from. It also quietly solves "I trained a LoRA on this machine but generate on that one" - no SCP, no USB stick, no remembering which folder you put it in.

    How it works

    The node is marked as both an input node and an output node, which is ComfyUI's way of saying it hands you a file picker widget. You either click through to a local file or type a path, and on run it calls boto3's upload_file against the bucket configured in the pack's .env file.

    The four inputs that matter:

    • local_path - the file(s) to upload, relative to your ComfyUI root (default input/example.png). It accepts a list, so you can select several files and push them all in one go.
    • s3_folder - the object prefix in the bucket where the file lands (default output).
    • s3_filename - leave it empty and the node keeps the local file's basename; fill it in to rename on the way up.
    • delete_local - the true/false toggle that decides whether the local file is deleted after a successful upload.

    It returns s3_paths (a STRING, or list of STRINGs if you fed it several files) with the object key(s) it just wrote, so you can wire the result into whatever else wants to know where the file went.

    One subtlety that trips people up: unlike the pack's save nodes, this one does not prepend S3_OUTPUT_DIR to your target folder. s3_folder is used literally, so the default output is a folder named output at the bucket root. If your .env sets S3_OUTPUT_DIR=output and you expect uploads and saves to land in the same place, you need to type that same value here.

    Installing and configuring the pack

    ComfyS3 installs like any custom node: in ComfyUI Manager, search "ComfyS3" and make sure the author is TemryL, or clone it manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TemryL/ComfyS3
    cd ComfyS3
    pip install -r requirements.txt   # boto3==1.34.32, python-dotenv==1.0.1
    

    Then restart ComfyUI. The real setup is the .env file in custom_nodes/ComfyS3/:

    S3_REGION=us-east-1
    S3_ACCESS_KEY=your_access_key
    S3_SECRET_KEY=your_secret_key
    S3_BUCKET_NAME=your-bucket
    S3_INPUT_DIR=input
    S3_OUTPUT_DIR=output
    

    It also supports S3_ENDPOINT_URL (for S3-compatible storage like MinIO or Cloudflare R2) and S3_ADDRESSING_STYLE (auto/virtual/path) if you're not on plain AWS.

    Common issues

    The big one: the S3 client is built the moment the node loads, not when you run it. If the .env is missing or the credentials are wrong, you'll see ComfyS3 - ERROR - Missing required S3 environment variables. in the console and every node in the pack refuses to work until you fix it. No lazy-loading your way around it.

    Also keep in mind those credentials are plaintext in a .env file, and ComfyUI custom nodes run arbitrary code on install. This pack is small, open-source, and only moves files - but don't hand a sketchy pack your AWS keys, and don't expose your ComfyUI instance to the internet while they're sitting there. And because the upload is synchronous boto3, a big file will stall your queue until it finishes - nothing else runs while it's up there.

    CategoryComfyS3

    Inputs (4)

    NameTypeDefaultDescription
    s3_filenameSTRING
    local_pathSTRINGinput/example.png
    s3_folderSTRINGoutput
    delete_localCOMBO2 options: false, true

    Outputs (1)

    NameTypeDescription
    s3_pathsSTRING