- Setup node now prints FULL values (not truncated) for easy copy to RunPod Secrets - Setup node saves token.json for local users - Removed folder_id from AutoUploader node (only needed in Setup) - AutoUploader now reads folder_id only from environment variable
ComfyUI DriveSend Node
A ComfyUI custom node for uploading output files to Google Drive with optional encryption. Automatically monitors your output folder and uploads images/videos to your Google Drive.
⚠️ Important: Authentication Requirements
DriveSend supports two authentication methods, each with different requirements:
| Method | Account Type | Cost | Token Expiry | Recommended For |
|---|---|---|---|---|
| Service Account | Google Workspace only | ~$7+/month | Never expires | Business/paid users |
| OAuth 2.0 | Personal Gmail | Free | Auto-refreshes* | Personal/free users |
* OAuth tokens auto-refresh on each pod startup, effectively working like permanent credentials.
Why These Limitations?
- Service Accounts have 0 GB storage quota on personal Gmail accounts. Google blocks uploads entirely.
- Google Workspace ($7+/month) provides Shared Drives where service accounts can upload.
- OAuth 2.0 works with personal Gmail but requires initial browser authorization.
📤📦 Features
-
DriveSend AutoUploader Node - Automatically uploads new files to Google Drive
- Monitors output folder in real-time
- Supports:
.png,.jpg,.jpeg,.webp,.gif,.mp4,.avi,.mov - Optional AES-128 encryption before upload
- SHA256 checksum verification
- Queue system for reliable uploads
-
DriveSend Setup Node - Configures authentication and credentials
- Generates OAuth refresh tokens
- Outputs credentials for RunPod environment variables
- Optional encryption key generation
💾 Installation
cd ComfyUI/custom_nodes/
git clone https://github.com/machinepainting/ComfyUI_DriveSendNode.git
pip install -r ComfyUI_DriveSendNode/requirements.txt
Restart ComfyUI after installation.
🔧 Google Cloud Setup (Required for Both Methods)
Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Sign in with your Google account
- Click Select a project (top, next to "Google Cloud" logo) → New Project
- Name it (e.g.,
ComfyUI-DriveSend) → Click Create - Make sure your new project is selected (check dropdown at top)
Step 2: Enable Google Drive API
- Go to APIs & Services → Library (left sidebar)
- Search for Google Drive API
- Click on it → Click Enable
Step 3: Create OAuth Credentials
- Go to APIs & Services → Credentials (left sidebar)
- Click + Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen:
- User Type: External → Click Create
- App name:
DriveSend - User support email: Your email
- Developer contact: Your email
- Click Save and Continue through all steps
- Back in Credentials, click + Create Credentials → OAuth client ID
- Application type: Desktop app
- Name:
DriveSend - Click Create
- Download JSON and save as
client_secret.jsonin the DriveSend node folder:ComfyUI/custom_nodes/ComfyUI_DriveSendNode/client_secret.json
Step 4: Add Yourself as Test User
- Go to APIs & Services → OAuth consent screen
- Under Test users, click + Add Users
- Add your Gmail address
- Click Save
🔐 Option A: OAuth 2.0 Setup (Personal Gmail - FREE)
Best for: Personal Gmail accounts, RunPod users who want free Google Drive uploads.
How It Works
OAuth uses a refresh token that auto-refreshes on every pod startup. You authorize once, and it works indefinitely (as long as you don't revoke access).
Local Setup
- Add the DriveSend Setup node to your workflow
- Configure:
auth_method: oauthstorage_method: display_only (for cloud) or env_file (for local)encryption_key_method: Your preference
- Run the node
- A browser window opens - sign in and authorize the app
- Copy the credentials from the console output
RunPod Setup
-
Complete local setup first to get your refresh token
-
In RunPod, create these Secrets:
Secret Name Value GOOGLE_CLIENT_IDYour OAuth client ID GOOGLE_CLIENT_SECRETYour OAuth client secret GOOGLE_REFRESH_TOKENThe refresh token from setup GOOGLE_DRIVE_FOLDER_IDYour Drive folder ID comfyui_encryption_key(Optional) Your encryption key -
Add Environment Variables to your pod template:
GOOGLE_CLIENT_ID→{{ RUNPOD_SECRET_GOOGLE_CLIENT_ID }}GOOGLE_CLIENT_SECRET→{{ RUNPOD_SECRET_GOOGLE_CLIENT_SECRET }}GOOGLE_REFRESH_TOKEN→{{ RUNPOD_SECRET_GOOGLE_REFRESH_TOKEN }}GOOGLE_DRIVE_FOLDER_ID→{{ RUNPOD_SECRET_GOOGLE_DRIVE_FOLDER_ID }}comfyui_encryption_key→{{ RUNPOD_SECRET_comfyui_encryption_key }}
-
Deploy your pod and add the DriveSend AutoUploader node with:
auth_method: oauthrun_process: True
🏢 Option B: Service Account Setup (Google Workspace - PAID)
Best for: Google Workspace subscribers who want simpler, permanent authentication.
Requirements:
- Google Workspace account (~$7+/month)
- Custom domain (e.g., yourbusiness.com)
Why Service Account Requires Google Workspace
Service accounts have 0 GB storage quota. On personal Gmail, uploads fail immediately with "storageQuotaExceeded". Google Workspace provides Shared Drives where service accounts CAN upload.
Setup Steps
- Go to IAM & Admin → Service Accounts
- Click + Create Service Account
- Name it (e.g.,
comfyui-uploader) → Click Create and Continue → Done - Click on the service account → Keys tab → Add Key → Create new key → JSON
- Rename downloaded file to
service_account.json - Place in:
ComfyUI/custom_nodes/ComfyUI_DriveSendNode/service_account.json
Create a Shared Drive
- In Google Drive, click Shared drives (left sidebar)
- Click + New to create a Shared Drive
- Add the service account email as a Content Manager
- Get the Shared Drive ID from the URL
RunPod Configuration
Create secrets and environment variables similar to OAuth setup, but use:
GOOGLE_SERVICE_ACCOUNT_JSON(base64-encoded JSON)GOOGLE_DRIVE_FOLDER_ID(Shared Drive ID)
📁 Getting Your Folder ID
- Open Google Drive
- Navigate to your target folder (or Shared Drive)
- Look at the URL:
https://drive.google.com/drive/folders/XXXXXXXXXXXXXXXXX - Copy the long string after
/folders/- that's your Folder ID
🔒 Encryption (Optional)
DriveSend supports AES-128 encryption for files before upload.
Enable Encryption
- In DriveSend Setup node, set
encryption_key_methodto Display Only or save to .env - Run the setup node to generate a key
- Save the key securely (you'll need it to decrypt files)
- In DriveSend AutoUploader, set
enable_encryptionto True
Decrypt Files Locally
Use the scripts in the /scripts/ folder:
macOS:
./scripts/decrypt_folder_mac.sh
Windows:
python scripts/decrypt_folder_win.py
Linux:
./scripts/decrypt_folder_linux.sh
🛠️ Troubleshooting
"storageQuotaExceeded" Error
- Cause: Using service account with personal Gmail
- Fix: Use OAuth instead, or upgrade to Google Workspace
"invalid_grant" Error
- Cause: Refresh token expired or revoked
- Fix: Run setup node again to get new refresh token
"Access blocked: App not verified"
- Cause: OAuth consent screen in testing mode
- Fix: Add your email as a test user (Step 4 in Google Cloud Setup)
Files not uploading
- Check: Console output for error messages
- Check: Folder ID is correct
- Check: Auth credentials are set in environment variables
Browser doesn't open for OAuth
- Cause: Running on headless server (RunPod)
- Fix: Complete OAuth setup locally first, then copy credentials to RunPod
📊 Comparison: DriveSend vs DropSend
| Feature | DriveSend (Google Drive) | DropSend (Dropbox) |
|---|---|---|
| Free with personal account | ✅ OAuth only | ✅ Yes |
| Service account support | ⚠️ Workspace only | N/A |
| Storage (free tier) | 15 GB | 2 GB |
| Token management | Auto-refresh | Auto-refresh |
| Setup complexity | Medium | Easy |
🧪 Tested On
- Python 3.10 / 3.11
- ComfyUI (Feb 2026)
- RunPod GPU instances
- Google Drive API v3
License
MIT