comfyui-gcs-uploader
A custom ComfyUI node that uploads generated images directly to Google Cloud Storage and notifies your Supabase database — with zero Supabase Egress cost.
comfyui-gcs-uploader 🪣
A custom ComfyUI node that uploads generated images directly to Google Cloud Storage and notifies your Supabase database — with zero Supabase Egress cost.
Why?
The default setup routes images through Supabase Edge Function → GCS, costing ~4MB of Egress per image. This node sends images directly from ComfyUI (RunPod) to GCS, then only sends a small URL string to Supabase.
Before: ComfyUI → Supabase Edge Function → GCS ❌ Egress ~4MB/image
After: ComfyUI → GCS ✅ Egress ~0
↓ (URL only)
Supabase DB
Installation
Via ComfyUI Manager (Recommended)
- Open ComfyUI → Manager → Install via Git URL
- Paste:
https://github.com/YOUR_USERNAME/comfyui-gcs-uploader - Restart ComfyUI
- Install dependencies:
pip install -r requirements.txt
Manual
cd ComfyUI/custom_nodes
git clone https://github.com/YOUR_USERNAME/comfyui-gcs-uploader
pip install -r comfyui-gcs-uploader/requirements.txt
Configuration
Step 1: Create config.json
cp config.json.example config.json
Edit config.json:
{
"supabase_url": "https://YOUR_PROJECT.supabase.co",
"supabase_service_role_key": "YOUR_SERVICE_ROLE_KEY"
}
This is the only thing you need to configure locally.
config.json is gitignored — your credentials are safe.
Step 2: Set GCS Credentials in Web Dashboard
- Go to your AI Influencer dashboard → Settings → GCS Credentials
- Enter: Project ID, Client Email, Private Key, Bucket Name
- Save — the node fetches these automatically at runtime from Supabase.
Usage in Workflow
Add the "Upload to GCS 🪣" node after your image generation node:
| Input | Type | Description |
|-------|------|-------------|
| image | IMAGE | Output from KSampler or VAE Decode |
| job_id | STRING | The production_jobs.id from Supabase |
| content_item_id | STRING | The content_items.id from Supabase |
| image_type | SFW/NSFW | Type of image |
| slot_index | INT | Slot number (0, 1, 2...) |
Output: gcs_url — the public GCS URL of the uploaded image.
Passing Job ID via Workflow
Use a "String Literal" or "Load Text" node to inject the job_id and content_item_id.
When your system queues a job, include these values in the ComfyUI prompt payload so the workflow can read them.
How It Works
- Fetches GCS credentials from your Supabase
system_configstable (set via web dashboard). - Converts the image tensor → PNG bytes.
- Uploads directly to GCS:
images/{content_item_id}/{image_type}/{job_id}_{slot_index}.png - Notifies Supabase:
- Inserts record into
generated_imagestable - Updates
production_jobs.status→Completed
- Inserts record into
- On failure: marks job as
Failedin DB with error message.
License
MIT