Google Photos Login/Logout π
Open it once, close it when you're done
Every other node in the Google Photos Loader pack depends on one thing: a logged-in Google account. This node is how you log in, how you log out, and - most usefully - how you fix it when auth breaks. The README's own troubleshooting points here first: "If you encounter authentication issues, use the Login/Logout node to reset your authentication." If you install this pack, remember this node exists, because you will need it.
How it works
Google's OAuth 2.0, in the desktop-app flavor. Set the action to LOGIN and run; the pack reads your client_secrets.json, opens a browser window to Google's consent screen, and asks for photoslibrary.readonly scope. Note that scope: this pack can read your photos, and only read them. No uploads, no deletes, no album edits - the authorization literally won't permit it.
The token you get back is stored in the pack's folder as token.pickle, encrypted with a Fernet key kept in encryption_key.key. Every loader then loads that token, and when it expires, refreshes it automatically with Google. Set action to LOGOUT and run, and it deletes token.pickle - which is effectively "log out of the pack."
The inputs
action(enum: NONE / LOGIN / LOGOUT, default NONE) - nothing happens until you pick one. NONE is the "leave me alone" setting, useful when the node is just sitting in a shared workflow.client_secrets_file(STRING) - path to your OAuth credentials, defaulting toclient_secrets.jsonin the pack's own folder.
No outputs; it's an output node you trigger and forget.
Getting the credentials (the one-time setup)
This is the part nobody enjoys, but it's a one-off. In the Google Cloud Console:
- Create a project (or pick one).
- Enable the Google Photos Library API.
- Create credentials β OAuth 2.0 Client ID β application type Desktop app.
- Download the client config and save it as
client_secrets.jsoninside the pack's folder (ComfyUI/custom_nodes/comfyui-google-photos-loader/).
Then run this node with LOGIN, approve in the browser, and you're set for months. The author has a video tutorial walking the whole thing.
How to install it
cd ComfyUI/custom_nodes
git clone https://github.com/lazniak/comfyui-google-photos-loader.git
pip install -r requirements.txt
# restart ComfyUI
Or ComfyUI Manager β "Google Photos Loader" (by PabloGFX) β Install β restart. No model downloads. Worth flagging: the code uses cryptography (for the token encryption), which isn't in requirements.txt - it usually arrives transitively via Google's auth stack, but if the import errors on a bare environment, pip install cryptography fixes it.
Troubleshooting
- No browser pops up on LOGIN β the classic causes:
client_secrets.jsonis misnamed (it must have the "s" - the README is emphatic; Google's downloaded file may beclient_secret.json), or it's not in the pack's folder, or it's the wrong client type (it must be "Desktop app", not "Web"). - Headless machine (Colab, remote server) β
LOGINstarts a local server and opens a browser on the same machine. On a box with no browser you'll need port forwarding or an SSH tunnel to complete the callback. - Logout doesn't fully log you out β it only deletes the local token file; the OAuth grant stays valid at Google until it expires. To sever access entirely, revoke the app in your Google account settings.
- Auth errors in loaders β run
LOGOUT, thenLOGINagain. That "reset" cycle is the pack's intended fix and clears most stale-token situations.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| action | COMBO | 3 options: NONE, LOGIN, LOGOUT | |
| client_secrets_file | STRING | /tmp/ComfyUI/custom_nodes/comfyui-google-photos-loader/client_secrets.json | β |
Outputs (0)
No outputs