Nodes/DriveSend Node/πŸš™βš™οΈ DriveSend - Setup Node
ComfyUI Node

πŸš™βš™οΈ DriveSend - Setup Node

The 10-minute Google OAuth dance, done once

By machinepaintingΒ·Created 7 months agoΒ·Updated 4 months agoΒ· 2
πŸš™βš™οΈ DriveSend - Setup Node
    • status
    β—„auth_methodoauthβ–Ί
    β—„folder_idβ–Ί
    β—„storage_methoddisplay_onlyβ–Ί
    β—„encryption_key_methodoffβ–Ί
    β—„reconnectfalseβ–Ί

    DriveSend's AutoUploader is the node that moves your files, but it's dead weight until DriveSendSetup runs first. This is the chore node: it logs you into Google, grabs the credentials the uploader needs, and gets them where they need to be - a .env file on your local machine, or a browser panel you copy into RunPod Secrets on the cloud. You run it once per machine and it stays out of your life after that.

    Honest framing: OAuth to Google Drive is a fiddly ritual no matter what. Create a project in Cloud Console, enable the Drive API, configure a consent screen, create a "Desktop app" OAuth client, copy the Client ID and Client Secret, make a Drive folder and grab its ID from the URL. None of that is the node's fault - that's just Google. What the node does is make the OAuth exchange itself painless and, unusually for this corner of the ecosystem, genuinely careful with your credentials.

    How it works

    Run it once. It delivers an OAuth authorization URL three ways so one of them always works: a browser popup, a banner printed to the ComfyUI terminal, and a text string on the node's status output that you can wire into a Show Text node to click. You authorize at Google, paste the returned auth code, queue again, and the node exchanges everything for a long-lived refresh token.

    Here's the clever (and unusual) part: the secrets are not node inputs. Client ID, client secret, and auth code live in a browser-only modal behind a "Set credentials..." button, POSTed to a same-origin endpoint and consumed once. They never end up in your workflow JSON, PNG metadata, or ComfyUI's unauthenticated /history endpoint - which is exactly where most setup nodes quietly leak credentials. This pack was hardened for the threat model of a network-reachable ComfyUI, and it shows.

    The inputs that matter

    • auth_method - oauth for normal Google accounts, service_account if you have Google Workspace. Service accounts do not work with personal Gmail; on free Gmail, use OAuth.
    • folder_id - the part of your Drive folder URL after /folders/. The one thing you'll actually type.
    • storage_method - display_only for cloud (credentials shown in a browser panel, never written to the pod - close it without copying and they're gone, so rerun to regenerate), or env_file for local installs (writes .env in the plugin directory with 0600 permissions).
    • encryption_key_method - off, display_only, or save_to_env. Pick off if you don't want encryption.
    • reconnect (optional) - clear stale OAuth state and start over. Your first move when authorization goes sideways.

    Output is a single STRING status - the OAuth URL on the first run, a confirmation on the second.

    The gate that trips everyone up

    The Setup node refuses to run unless this env var is visible to the ComfyUI process:

    export COMFYUI_DRIVESEND_ALLOW_SETUP=1    # macOS/Linux
    set COMFYUI_DRIVESEND_ALLOW_SETUP=1       # Windows cmd
    $env:COMFYUI_DRIVESEND_ALLOW_SETUP = "1"  # PowerShell
    

    On RunPod it's an Environment Variable in the pod template. The point is that a remote workflow can't hijack or wipe your credentials - only a human with host access can opt in. But it bites constantly: launch ComfyUI via Pinokio, ComfyUI Desktop, or a launcher script and the variable you set in your terminal isn't visible to the process. Set it, verify with echo $COMFYUI_DRIVESEND_ALLOW_SETUP, and launch from that same shell.

    Install

    One pack, two nodes - ComfyUI Manager, search DriveSend Node, or:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/machinepainting/ComfyUI_DriveSendNode.git
    pip install -r ComfyUI_DriveSendNode/requirements.txt
    

    Restart ComfyUI. Requires the Google Cloud project from the README (enable Drive API, create an OAuth Desktop client). No model files, no heavy downloads.

    Troubleshooting

    • "Setup is disabled" - the env var isn't visible to the running ComfyUI. Same-shell problem as above.
    • "Browser delivery refused" - you submitted the workflow via curl or an SDK without a client ID. Submit from the web UI, or switch storage_method to env_file.
    • No browser panel in display_only - check your popup blocker, then rerun. Credentials aren't stored on the pod, so every run regenerates the panel.
    • Authorization failed - rerun with reconnect=True; if Google stops showing a consent screen, revoke access at myaccount.google.com/permissions and try again.
    • "Storage quota exceeded" on a service account - that's the personal-Gmail wall again. Switch to OAuth.

    Once it's done, drop the gate variable and let the AutoUploader take over. Setup's job is over - it's not part of your real workflow, just the toll booth on the way in.

    CategoryDriveSend

    Inputs (5)

    NameTypeDefaultDescription
    auth_methodCOMBOoauth2 options: oauth, service_account
    folder_idSTRINGGoogle Drive folder ID from URL (the part after /folders/)
    storage_methodCOMBOdisplay_only2 options: display_only, env_file
    encryption_key_methodCOMBOoff3 options: off, display_only, save_to_env
    reconnectoptBOOLEANfalseβ€”

    Outputs (1)

    NameTypeDescription
    statusSTRINGβ€”