Nodes/InstaSD nodes for ComfyUI/InstaSD S3 - Load Image
ComfyUI Node

InstaSD S3 - Load Image

Pull an image straight out of S3 and into your workflow

By WaddingtonHoldings·Created 2 years ago·Updated 10 months ago· 4
InstaSD S3 - Load Image
    • IMAGE
    • MASK
    regionus-east-1
    aws_ak
    aws_sk
    session_token
    s3_buckets3_bucket
    pathnamepathname for file

    InstaCLoadImageFromS3 downloads an image from an AWS S3 bucket and loads it into ComfyUI as a tensor, no local file step in between. If your workflow's inputs live in object storage - which is exactly the pattern InstaSD deployments use, since the worker may not have your local input folder - this is how you get them in.

    It uses boto3 under the hood, so it behaves like any S3 client: give it a bucket and a key, it fetches the object into memory and hands you an image tensor. One difference from a plain downloader: it also returns a mask built from the image's alpha channel, matching the local loader's convention.

    What you set

    • region - AWS region, default us-east-1. Change it to match your bucket or you'll get region-mismatch errors.
    • aws_ak / aws_sk - access key ID and secret access key. Leave both empty and the node falls back to boto3's default credential chain (environment variables, ~/.aws/credentials, IAM role) - handy on an EC2 or InstaSD worker.
    • session_token - optional STS session token for temporary credentials. Only meaningful if you're using temporary keys.
    • s3_bucket - the bucket name. Default is literally the string s3_bucket, which is a trap: you must change it.
    • pathname - the object key (the "path" of the file inside the bucket), e.g. inputs/jobs/12345.png. This one is exact - unlike the save node, there's no timestamp or suffix added.

    Outputs are IMAGE and MASK - the image and its inverted-alpha mask (or a blank mask if there's no alpha). Wire IMAGE into a VAE encode or sampler, and MASK into an inpaint workflow if you have transparent PNGs.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/WaddingtonHoldings/ComfyUI-InstaSD
    

    Restart ComfyUI, or use ComfyUI Manager (search "InstaSD"). This is one of the nodes that actually needs the pack's dependencies - boto3 is in requirements.txt and Manager installs it for you. No model downloads, but you do need AWS credentials that can read the bucket.

    Gotchas

    • Credentials. If aws_ak/aws_sk are empty, boto3 tries the default chain - which includes instance profiles. On a fresh local setup that usually means no credentials found, so you'll either fill the fields or export AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY.
    • Region mismatches are the classic S3 error. Bucket in eu-west-1 but region says us-east-1? You'll get a redirect/301 or signature error. Match them.
    • The key is exact. If you saved the file with the pack's save node, remember it appends a timestamp to the name - you need the full resulting key, not just the prefix you typed.
    • No existence check before download. A bad key throws an S3 NoSuchKey exception that shows up as a red node; check the key spelling first.
    CategoryInstaSD/S3

    Inputs (6)

    NameTypeDefaultDescription
    regionSTRINGus-east-1
    aws_akSTRING
    aws_skSTRING
    session_tokenSTRING
    s3_bucketSTRINGs3_bucket
    pathnameSTRINGpathname for file

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK