Nodes/ComfyGCS/Save Image to GCS
ComfyUI Node

Save Image to GCS

Ship your renders to a GCS bucket instead of your output folder

By benmizrahi·Created about a year ago·Updated about a year ago· 1
Save Image to GCS
  • images
  • gcs_image_paths
gcs_bucket
gcs_project
filename_prefixImage
google_application_credentials_file

Save Image to GCS is the write half of the ComfyGCS pack: it behaves like the stock Save Image node, except the finished PNG goes up to a Google Cloud Storage bucket instead of sitting in your output/ folder. If you run ComfyUI on a box where you don't trust the local disk to survive, or you're feeding a downstream service that reads renders from GCS, this is the node that gets your image from the sampler to the bucket with zero shell commands in between.

Straight talk on scope: this pack is a minimalist two-node utility with essentially no community footprint, so it's only worth reaching for if your output must land in GCS. If you just want renders on your own machine, the built-in Save Image is strictly better. And if you want a genuinely full-featured cloud save - S3, Drive, Azure, Dropbox, progress bars, the works - the community's Save/Load Extended pack covers way more ground. ComfyGCS is the "just one bucket, just PNGs" option.

How it works

When the graph reaches it, the node takes the IMAGE tensor, converts each frame to a numpy array, and writes a PNG (compression level 4) to a temp file on disk. Then it uploads that temp file to your bucket via the google-cloud-storage client and deletes the local copy. The object path it builds looks like this:

output/{filename_prefix}_{width}x{height}_{counter:05}_.png

So a default run at 1024x1024 becomes output/Image_1024x1024_00000_.png in your bucket. It's an output node, so it also shows the saved files in the UI's results pane like the core Save Image does.

The inputs that matter

  • images - the IMAGE tensor, straight off your VAE decoder (or upscaler, or wherever the wire comes from).
  • gcs_bucket / gcs_project - the bucket name and project ID, same as the load node. Defaults come from GCS_BUCKET and GCS_PROJECT env vars.
  • filename_prefix - defaults to "Image", and this one matters more than you'd think (see below).
  • google_application_credentials_file - optional service account key path. Same caveat as LoadImageGCS: in the current code it's effectively decorative; set GOOGLE_APPLICATION_CREDENTIALS for Application Default Credentials and let ADC handle auth.

The one output is gcs_image_paths - a list of strings, one per uploaded object path. Wire it into any node that eats strings, like a notifier or an API call that tells the next service "your image is at this key."

Where people get burned

The filename counter. The node's save-path helper hardcodes the counter at 0 - every run, regardless of history. That means the same prefix plus the same dimensions produce the same object path every single time, and GCS overwrites the previous render. Run the same workflow twice and your first output is gone, silently.

The fix is boring and reliable: put something unique in filename_prefix. A timestamp, the date, your seed - anything that changes between runs.

filename_prefix: mybatch_2026-08-27   →  output/mybatch_2026-08-27_1024x1024_00000_.png

Also note it writes under the output/ prefix in the bucket (mirroring ComfyUI's local convention), and it re-uploads the full file every run - it's not an incremental thing, so keep an eye on storage and egress costs if you're generating a lot.

Installing it

Same shared story as the whole pack. Search "ComfyGCS" in ComfyUI Manager and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/benmizrahi/ComfyGCS

Then restart ComfyUI. Manager installs the pip dependencies (google-cloud-storage, google-auth, python-dotenv); on a manual clone you need those in your ComfyUI environment yourself. As always with a custom node that handles a service account key, give the repo a quick skim before you trust it with cloud credentials.

Troubleshooting

  • Auth errors on upload - Application Default Credentials aren't configured. Export GOOGLE_APPLICATION_CREDENTIALS to your service account key file, restart, and make sure that key has storage.objects.create permission on the bucket.
  • The upload succeeds but the file "isn't there" - check under output/ in the bucket, not the bucket root, and remember that a repeated prefix overwrites the previous file.
  • Output paths come back empty or it silently drops the render - the temp-file write happens in the pack's directory; if ComfyUI's working directory isn't writable, the upload never happens.

It's two nodes and one job. If that job is "get renders off this machine and into Google Cloud Storage," Save Image to GCS does exactly that - with one counter bug you now know to work around.

CategoryComfyGCS

Inputs (5)

NameTypeDefaultDescription
gcs_bucketSTRING
gcs_projectSTRING
imagesIMAGE
filename_prefixSTRINGImage
google_application_credentials_fileoptSTRING

Outputs (1)

NameTypeDescription
gcs_image_pathsSTRING