💾 Load Your Image From S3
Pull an Image Out of S3 Without Ever Downloading a Local Copy
- IMAGE
The one-line pitch
Load Image From S3 is a tiny node that fetches a single image object from an AWS S3 bucket and hands you a ready-to-wire IMAGE tensor. You type a bucket name, a file key, and the node does the boto3 dance - no local copy, no manual download step.
You'd reach for it in exactly one situation: your images already live in S3. That's a team bucket with shared assets, a pipeline that archives every generation to object storage, or a headless ComfyUI box with no persistent disk. If you just keep files in ComfyUI/input like most of us, this node solves a problem you don't have. But the moment your source of truth is a bucket, it's genuinely handy - you can wire it into the same graph position as the core Load Image node and never think about where the file physically is.
How it works
Under the hood it's the same pattern as ComfyUI's built-in Load Image, pointed at S3 instead of your input folder. It builds a boto3 S3 client, downloads the object into a BytesIO buffer with download_fileobj, and opens it with PIL. Then the standard Load Image post-processing kicks in: EXIF orientation is corrected, the image is converted to RGB, and if the file has an alpha channel that gets turned into a mask.
Two details worth knowing. First, this is a single-object fetch, not a folder listing - pathname is the exact key of one file, extension included. Second, multi-frame files (GIFs, animations) get flattened: each frame becomes one entry in the output batch, so a six-frame file arrives as a batch of six, ready to feed a batch-savvy pipeline. One quirk: the code computes that alpha mask the way core Load Image does, but the node only declares a single IMAGE output - there's no MASK slot. Don't go hunting for one.
The inputs that matter
You set region (defaults to us-east-1), s3_bucket, and pathname - that's the object key, so "myfolder/render_042.png", not just "render_042". The rest is credentials.
And here's the bit most people miss: aws_ak, aws_sk, and session_token are all plain text fields with empty defaults, and empty is the right answer. If all three are blank, the node falls back to boto3's default credential chain - your environment variables, ~/.aws/credentials, or an attached IAM role. That's the setup you actually want. Fill in both an access key and secret for explicit credentials, add a session token if you're on temporary creds. Fill in only one of them and the code silently falls through to a no-region, no-credential client that will almost certainly error out. Both or neither.
Install
Install the whole pack - it ships both S3 nodes together. Easiest route is ComfyUI Manager: search for "ComfyUI-S3-Tools" and hit install. Or, manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kealiu/ComfyUI-S3-Tools
Then restart ComfyUI. No models to download. The dependency list (boto3, numpy, torch, PIL) looks longer than it is - only boto3 is actually new, since ComfyUI already ships the other three. If Manager doesn't install requirements, pip install boto3 in your ComfyUI environment fixes it.
Common issues
- "NoSuchKey" out of the box. The
pathnamedefault is the literal placeholder"pathname for file". Run without changing it and the node tries to fetch an object with exactly that name. Same for the bucket default. Fill in real values first. - Your secret key ends up in the workflow. This is the one that actually matters. The workflow JSON - including every widget value - gets embedded in your output PNG's metadata, and you will eventually drag a shared workflow into a node editor. If
aws_skwas typed into the graph, your key just went for a walk. This is why leaving credentials blank and using the default chain isn't just laziness; it's the secure option. - Mask never appears. The code builds one, the node doesn't expose it. If your workflow needs the alpha channel as a mask, you'll have to add a node that derives it from the image yourself.
- Don't expect support to find you. This is a quiet little pack - last touched in mid-2024, basically no community chatter. If something's off, the whole thing is one short Python file, and reading it beats waiting for a reply.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| region | STRING | us-east-1 | — |
| aws_ak | STRING | — | |
| aws_sk | STRING | — | |
| session_token | STRING | — | |
| s3_bucket | STRING | s3_bucket | — |
| pathname | STRING | pathname for file | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |