GCP Storage Upload Model
Push a model up to GCS from inside ComfyUI — the reverse of the download node
- gcs_url
Once the download side of the GCP Cloud Storage Integration pack (koirpraw/ComfyUI-GCP-storage-decouple) is working, the obvious next question is: how do models get into the bucket in the first place? GCP Storage Upload Model is the in-graph answer. You give it a local file path, it uploads the file to your bucket, and returns the gs:// URL it landed at.
How it works: model_path is the local path to the file - the node verifies it exists and raises FileNotFoundError if you typo it - and bucket_path is where in the bucket it goes, default models/. An optional bucket_name overrides the env-configured bucket. The file is streamed up via blob.upload_from_filename, the same code path the pack's auto-sync uses, and you get the gcs_url (STRING) back: gs://bucket/models/whatever.safetensors.
When would you actually reach for this? Three cases. You trained a LoRA or finetune on the instance and want it in the bucket before the VM dies. You pulled a model down to iterate on it and want the corrected version synced back up. Or you're seeding a fresh bucket and this beats opening a terminal. One case it's not great for: moving a big existing model collection up. A single 6 GB checkpoint over a normal uplink is slow, and the upload isn't resumable - a dropped connection restarts it. For bulk transfer the README points you at gsutil -m cp -r ./models/* gs://your-bucket-name/models/, or the pack's selective_migrate.py script for hand-picking files. Use the node for the occasional file, gsutil for the migration.
Worth knowing for context: this pack also has a transparent mode - set COMFYUI_ENABLE_GCP_STORAGE=true and it patches ComfyUI's file handling so models and outputs sync to the bucket automatically, with a local cache. The upload/download nodes are the explicit, manual layer on top of that. This one matters because a bucket full of models is only useful if the download side can reach it - so the gcs_url you get back is exactly the string you'll paste into GCP Storage Download Model (or a loader) on the next instance you spin up.
Install is the pack standard: ComfyUI Manager → search "GCP Cloud Storage" (pack title "ComfyUI GCP Cloud Storage Integration"), or clone https://github.com/koirpraw/ComfyUI-GCP-storage-decouple into custom_nodes and restart. Then pip install google-cloud-storage (the pack's requirements.txt covers it) and configure GCP_PROJECT_ID, GCP_STORAGE_BUCKET, and credentials via GOOGLE_APPLICATION_CREDENTIALS or GCP_CREDENTIALS_JSON.
Troubleshooting: 403 Forbidden means the service account can't write - grant it object admin on the bucket. 404 means a wrong bucket name. DefaultCredentialsError means credentials are misconfigured. And if you get a runtime error saying the file wasn't found, check model_path - the node won't invent a path for you. This one touches your real cloud credentials, so keep the service account scoped to just this bucket, and don't run ComfyUI exposed to the internet without auth.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_path | STRING | Local path to model file | |
| bucket_path | STRING | models/ | Path in bucket to store model |
| bucket_nameopt | STRING | Override default bucket name |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| gcs_url | STRING | — |