Updated README to reflect changes in encryption key naming and script usage instructions for different operating systems.
ComfyUI DriveSend Node
A ComfyUI custom node for seamless Google Drive uploads with optional encryption capabilities. Automatically upload your ComfyUI output files (images and videos) to Google Drive cloud storage — with or without encryption.
⚠️ Note: This is a development/untested version based on the working DropSend Node. Community testing welcome!
🔄 How It Works
┌─────────────────────────────────────────────────────────────────────────────┐
│ CLOUD (RunPod, etc.) │
│ │
│ ComfyUI generates files ──→ DriveSend Node ──→ Uploads to Google Drive │
│ (png, mp4, etc.) │ │
│ │ │
│ ▼ │
│ ┌──────────────────────┐ │
│ │ Encryption OPTIONAL │ │
│ │ ☐ OFF: file.png │ │
│ │ ☑ ON: file.png.enc │ │
│ └──────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
📁 GOOGLE DRIVE
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ YOUR LOCAL MACHINE │
│ │
│ Google Drive syncs/downloads ──→ If encrypted: Run decrypt script (local) │
│ ──→ file.png (viewable!) │
│ │
│ If not encrypted: Ready to use! │
└─────────────────────────────────────────────────────────────────────────────┘
Encryption is completely optional. If you don't need it, simply leave enable_encryption off and your files upload directly to Google Drive as-is. Enable encryption only if you want an extra layer of security for your files in cloud storage.
📤📦 Features
-
📤📦 DriveSend AutoUploader Node Automatically uploads newly created files to Google Drive with optional file encryption capabilities.
- Monitors a specified folder (e.g., ComfyUI's
output/) in real time, with optional recursive subfolder monitoring. - Supports common ComfyUI file types:
.png,.jpg,.jpeg,.webp,.gif,.mp4,.avi,.mov. - Optional encryption of files before upload, creating
.encfiles using a secure Fernet key (AES-128). - Configurable toggles for:
enable_encryption: Encrypt files before upload (default: off).Post_Delete_Enc: Delete encrypted.encfiles after upload verification (default: off).Subfolder_Monitor: Monitor subfolders in the watch directory (default: on).run_process: Start or stop the monitoring and uploading process (default: on).
- Uses a queue system to ensure reliable processing of files, even under high load, preventing skipped files.
- Verifies upload integrity using SHA256 checksums to ensure files are not corrupted during transfer.
- Monitors a specified folder (e.g., ComfyUI's
-
🛠️📦 DriveSend Setup Node Streamlines Google Drive API access setup and encryption key management.
- Supports two authentication methods:
- Service Account (Recommended for cloud/RunPod): No browser interaction needed after initial setup.
- OAuth 2.0: For local setups where you want to use your personal Google account.
- Provides API credentials and optional encryption key for easy integration into Environment Variables and RunPod Secrets.
- Supports two storage methods:
env_file: Saves credentials to a.envfile (recommended for local user setups).display_only: Displays credentials in the console for manual copying (recommended for cloud setups like RunPod).
- Supports three encryption key methods:
off: No encryption key is generated (use if encryption is not needed).Display Only: Displays the encryption key in the console with other credentials.save to .env: Saves the encryption key to the.envfile.
- Supports two authentication methods:
-
🔐📁 Standalone Decryption Scripts (Local Use Only) Decrypt
.encfiles on your local machine using the included scripts in the/scripts/folder.- Local use only — Run these on your computer after downloading/syncing encrypted files from Google Drive.
- Cross-platform support for macOS, Windows, and Linux.
- Restores encrypted files back to their original format (PNG, JPG, MP4, etc.).
- Supports recursive folder processing.
- Option to organize
.encfiles after decryption. - Includes optional encryption scripts for manual local encryption (not needed for normal DriveSend operation).
💾📦 Installation
Clone this repository into the ComfyUI/custom_nodes/ directory:
cd ComfyUI/custom_nodes/
git clone https://github.com/machinepainting/ComfyUI_DriveSendNode.git
Install dependencies:
pip install -r requirements.txt
🔧📦 Google Drive Setup Instructions
Option A: Service Account (Recommended for Cloud/RunPod)
Service accounts allow server-to-server authentication without browser interaction — ideal for cloud deployments.
-
Go to the Google Cloud Console
-
Create a new project (or select an existing one)
-
Enable the Google Drive API:
- Navigate to APIs & Services > Library
- Search for "Google Drive API"
- Click Enable
-
Create a Service Account:
- Navigate to IAM & Admin > Service Accounts
- Click Create Service Account
- Enter a name (e.g.,
comfyui-drivesend) - Click Create and Continue
- Skip the optional steps, click Done
-
Create and Download the Key:
- Click on your newly created service account
- Go to the Keys tab
- Click Add Key > Create new key
- Select JSON and click Create
- Save the downloaded file as
service_account.json
-
Share Your Google Drive Folder:
- Open Google Drive and create a folder for uploads (e.g.,
ComfyUI_Output) - Right-click the folder > Share
- Add the service account email (found in
service_account.jsonasclient_email) - Give it Editor access
- Copy the Folder ID from the URL (the long string after
/folders/)
- Open Google Drive and create a folder for uploads (e.g.,
Option B: OAuth 2.0 (For Local/Personal Use)
OAuth allows you to upload to your personal Google Drive account.
-
Go to the Google Cloud Console
-
Create a new project (or select an existing one)
-
Enable the Google Drive API (same as above)
-
Configure OAuth Consent Screen:
- Navigate to APIs & Services > OAuth consent screen
- Select External (unless you have Google Workspace)
- Fill in the required fields (App name, support email)
- Add your email as a test user
- Save
-
Create OAuth Credentials:
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Desktop app
- Download the JSON file as
credentials.json
🏃♂️➡️🫛📦 DriveSend Setup Node Instructions (RunPod & Cloud Users)
Using Service Account authentication (recommended for cloud):
-
Upload your
service_account.jsonto a secure location on your pod, or encode it as base64 and store as an environment variable. -
Open the 'DriveSend Setup Node' in your ComfyUI and configure:
auth_method[ service_account ]service_account_json[ path to service_account.json OR leave blank if using env var ]folder_id[ paste your Google Drive folder ID ]storage_method[ display_only ]encryption_key_method[ Display Only ] (or off if not needed)
-
Click 'Run' on the node. Note the returned credentials in the terminal:
GOOGLE_DRIVE_FOLDER_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
GOOGLE_SERVICE_ACCOUNT_JSON=<base64 encoded or path>
comfyui_encryption_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (if encryption enabled)
-
For RunPod users, create secrets:
Secret Name Secret Value GOOGLE_DRIVE_FOLDER_IDYour folder ID GOOGLE_SERVICE_ACCOUNT_JSONBase64-encoded service account JSON comfyui_encryption_keyYour encryption key (if using encryption) -
Add Environment Variables to your RunPod Pod:
GOOGLE_DRIVE_FOLDER_ID→{{ RUNPOD_SECRET_GOOGLE_DRIVE_FOLDER_ID }}GOOGLE_SERVICE_ACCOUNT_JSON→{{ RUNPOD_SECRET_GOOGLE_SERVICE_ACCOUNT_JSON }}comfyui_encryption_key→{{ RUNPOD_SECRET_comfyui_encryption_key }}
-
Add the DriveSend AutoUploader Node to your workflow and run!
🛠️💻📦 DriveSend Setup Node Instructions (Local Computer Users)
Using OAuth 2.0 authentication:
-
Place your
credentials.jsonin theComfyUI_DriveSendNodefolder -
Open the 'DriveSend Setup Node' in your ComfyUI and configure:
auth_method[ oauth ]folder_id[ paste your Google Drive folder ID ] (optional - uploads to root if blank)storage_method[ env_file ]encryption_key_method[ save to .env ] (or off if not needed)
-
Click 'Run' on the node. A browser window will open for Google authentication.
-
After authenticating, a
token.jsonfile will be created automatically. -
Restart ComfyUI and add the DriveSend AutoUploader Node to your workflow.
🔑📦 Encryption Key Management
If you enable encryption in the DriveSend AutoUploader Node, an encryption key is generated during setup (unless encryption_key_method is off). This key is required to decrypt .enc files downloaded from Google Drive.
Saving the Encryption Key
Display Only (Recommended for Cloud):
If encryption_key_method is Display Only, the key is shown in the console:
comfyui_encryption_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Copy the key and store it securely using one of the methods below.
Save to .env (Recommended for Local):
If encryption_key_method is save to .env, the key is saved in ComfyUI/custom_nodes/ComfyUI_DriveSendNode/.env as:
comfyui_encryption_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Ensure the .env file is excluded from version control (add to .gitignore).
🔐📁 Standalone Decryption Scripts (Local Use Only)
The /scripts/ folder contains standalone scripts to decrypt files on your local machine.
⚠️ These scripts are for LOCAL USE ONLY. Run them on your personal computer after downloading or syncing encrypted files from Google Drive. Do not run on cloud instances.
💡 Universal Compatibility: These scripts work with both DriveSend (Google Drive) and DropSend (Dropbox) nodes. They use the same encryption key (
comfyui_encryption_key), so you only need to set up key storage once.
What Are These Scripts For?
Decryption Scripts — The primary scripts. Use these on your local machine to decrypt .enc files you've downloaded/synced from Google Drive. When encryption is enabled in the DriveSend node, your files are uploaded as encrypted .enc files. These scripts restore them to their original format so you can view and use them.
Encryption Scripts — Optional utility scripts. You do NOT need these for normal DriveSend operation—the node handles encryption automatically during upload. These are provided for users who want to manually encrypt local files for backup or other purposes using the same key.
Supported File Types
The scripts support all formats the DriveSend node handles:
- Images:
.png,.jpg,.jpeg,.webp,.gif - Videos:
.mp4,.avi,.mov
When decrypting, the original file extension is preserved (e.g., video.mp4.enc → video.mp4).
Prerequisites (All Platforms)
Python 3.8+ and the cryptography library are required:
pip install cryptography
🍎 macOS Setup & Usage
Storing Your Encryption Key in Keychain
- Open Keychain Access (search in Spotlight)
- Click File > New Password Item
- Fill in the fields:
- Keychain Item Name:
ComfyUI_Encryption_Key - Account Name:
ComfyUI - Password: Paste your encryption key
- Keychain Item Name:
- Click Add
To retrieve later: Search for ComfyUI_Encryption_Key in Keychain Access, double-click, check Show Password, and authenticate.
Running the Scripts
-
Navigate to the scripts folder:
cd ComfyUI/custom_nodes/ComfyUI_DriveSendNode/scripts -
Make the script executable (first time only):
chmod +x decrypt_folder_mac.sh chmod +x encrypt_folder_mac.sh -
Run the decryption script:
./decrypt_folder_mac.sh -
When prompted:
- Drag and drop the folder containing
.encfiles into the terminal, or type the path - Choose whether to process subfolders recursively (Y/N)
- Optionally move
.encfiles to a separate folder after decryption
- Drag and drop the folder containing
🪟 Windows Setup & Usage
Storing Your Encryption Key
Using Environment Variable (Recommended):
- Press
Win + R, typesysdm.cpl, press Enter - Go to Advanced tab → Environment Variables
- Under User variables, click New
- Set:
- Variable name:
COMFYUI_ENCRYPTION_KEY - Variable value: Your encryption key
- Variable name:
- Click OK to save
- Restart any open terminals/command prompts
Running the Scripts
-
Open Command Prompt or PowerShell
-
Navigate to the scripts folder:
cd ComfyUI\custom_nodes\ComfyUI_DriveSendNode\scripts -
Run the decryption script:
python decrypt_folder_win.py -
When prompted:
- Enter the full path to the folder containing
.encfiles - Choose whether to process subfolders recursively (Y/N)
- Optionally move
.encfiles to a separate folder after decryption
- Enter the full path to the folder containing
🐧 Linux Setup & Usage
Storing Your Encryption Key
Option A: Environment Variable (Recommended)
Add to your ~/.bashrc or ~/.zshrc:
export COMFYUI_ENCRYPTION_KEY="your_encryption_key_here"
Then reload:
source ~/.bashrc
Option B: Secret Service (GNOME Keyring / KWallet)
If you have secret-tool installed (comes with libsecret-tools):
# Store the key
echo -n "your_encryption_key_here" | secret-tool store --label="ComfyUI Encryption Key" service ComfyUI username ComfyUI
# Retrieve the key (for verification)
secret-tool lookup service ComfyUI username ComfyUI
Install secret-tool if needed:
# Debian/Ubuntu
sudo apt install libsecret-tools
# Fedora
sudo dnf install libsecret
# Arch
sudo pacman -S libsecret
Running the Scripts
-
Navigate to the scripts folder:
cd ComfyUI/custom_nodes/ComfyUI_DriveSendNode/scripts -
Make the script executable (first time only):
chmod +x decrypt_folder_linux.sh chmod +x encrypt_folder_linux.sh -
Run the decryption script:
./decrypt_folder_linux.sh -
When prompted:
- Enter the full path to the folder containing
.encfiles - Choose whether to process subfolders recursively (Y/N)
- Optionally move
.encfiles to a separate folder after decryption
- Enter the full path to the folder containing
🔄 Cross-Platform Python Script (Alternative)
For maximum compatibility, use the Python script directly on any platform:
cd ComfyUI/custom_nodes/ComfyUI_DriveSendNode/scripts
python decrypt_folder.py
This script will:
- Automatically detect your operating system
- Check for your encryption key (environment variable, Keychain, or Secret Service)
- Prompt for the key if not found
- Process all
.encfiles and restore them to their original format
⚠️ Security Best Practices
- Never commit your
.envfile - Ensure.envis in your.gitignore - Never commit
service_account.jsonorcredentials.json- These contain sensitive credentials - Never commit
token.json- This contains your OAuth tokens - Use secure key storage - Prefer OS-native credential storage over plain text files
- Backup your encryption key - Without it, encrypted files cannot be recovered
- Restrict service account permissions - Only share specific folders, not your entire Drive
⚠️ Important Notes
Using Both DriveSend and DropSend
If you use both nodes (DriveSend for Google Drive and DropSend for Dropbox), you only need to store your encryption key once using any of the methods above. The scripts check for multiple key names for backward compatibility:
COMFYUI_ENCRYPTION_KEY(recommended)comfyui_encryption_keyDRIVESEND_ENCRYPTION_KEY(legacy)DROPSEND_ENCRYPTION_KEY(legacy)
The same applies to Keychain/Secret Service - the scripts will find your key regardless of which name you used.
Running Both Nodes Simultaneously
If you have both DriveSend and DropSend installed and want to use them at the same time, configure them to watch different folders to avoid conflicts. For example:
- DriveSend watches:
ComfyUI/output/gdrive/ - DropSend watches:
ComfyUI/output/dropbox/
Or simply use one node at a time by setting run_process to False on the node you're not using.
🧪 Tested On
NOT Tested: This is a development version based on the working DropSend Node. Community testing welcome!
Community Testing Needed:
- macOS — Please test and report any issues or suggestions!
- Windows 10/11 — Please test and report any issues or suggestions!
- Linux (Ubuntu, Fedora, Arch) — Please test and report any issues or suggestions!
If you encounter any problems, please open an issue on GitHub with:
- Your OS version
- Python version
- Error messages (if any)
- Steps to reproduce
Contributions and pull requests are welcome!
📁 Repository Structure
ComfyUI_DriveSendNode/
├── __init__.py
├── drivesend_uploader_node.py
├── drivesend_setup_node.py
├── gdrive_upload.py
├── gdrive_auth_manager.py
├── encrypt_file.py
├── monitor_output.py
├── requirements.txt
├── README.md
├── .gitignore
└── scripts/
├── decrypt_folder.py # Cross-platform Python script (recommended)
├── decrypt_folder_mac.sh # macOS decryption script
├── encrypt_folder_mac.sh # macOS encryption script (local use only)
├── decrypt_folder_win.py # Windows decryption script
├── encrypt_folder_win.py # Windows encryption script (local use only)
├── decrypt_folder_linux.sh # Linux decryption script
└── encrypt_folder_linux.sh # Linux encryption script (local use only)
License
MIT