Google Photos Images Loader π·
Search your entire Google Photos library, not just albums
- positive_custom_filters
- negative_custom_filters
- IMAGE
The Album Loader is for when you know where your photos live. This one is for when you don't - it searches your entire Google Photos library and pulls matching images straight into the graph. It's the flagship node of the pack, and the one with the most knobs. If you've ever wanted to feed a model "my screenshots from 2023" or "every pet photo, but none of the food photos," this is the node.
How it works
Same machinery as the Album Loader - authenticated mediaItems:search against the Photos Library API, PHOTO media type only, concurrent downloads, caching, Pillow β tensor conversion - but without an album ID restricting the scope. Instead of scoping by album, it builds a filter object from whatever you've connected, and Google's server-side search does the work.
The two filter sources are the interesting part. You can wire a ContentFilter node into positive_custom_filters (only photos matching these categories) or negative_custom_filters (drop photos matching these). And the date fields let you pin down a specific year, month, or day - a value of 0 means "no filter," so year-only or year+month are valid partial dates.
Inputs that matter
max_images(INT, 1β5000, default 10) - batch size. Keep it modest for a first run; each image is a download.start_from(INT, 0β10000, default 0) - the offset into your library, newest-first. This is your pagination: run withstart_from0, then 10, then 20 to walk through results in batches.size_option/target_size- same resize/crop/fill choices as the Album Loader; "Crop to Size" is the one that gives uniform square batches.cache_images(BOOLEAN, defaulttrue) - keep it on.remove_cache(BOOLEAN, defaultfalse) - a one-shot nuke of the whole cache before loading. Handy when you've changed size options and don't want stale tensors.advanced_logs(BOOLEAN, defaultfalse) - dumps the full API request/response to the console. The README's troubleshooting points you here when something's misbehaving; it's loud, but it's the best way to see exactly what Google was asked.client_secrets_file(optional) - defaults to the pack folder; leave it alone.positive_custom_filters/negative_custom_filters(optional CONTENT_FILTER) andspecific_year/specific_month/specific_day(optional INTs) - the search filters.
Output is IMAGE as a list.
The gotcha that will confuse you once
Here's the trap: when the search returns nothing, this node does not error out. It returns a single black placeholder tensor (torch.zeros) sized target_size. Your workflow runs, your img2img produces something, and it's black. If you're getting suspiciously clean black outputs, your filters are excluding everything - check the ContentFilter wiring and the date fields before debugging anything else. Zero results is a warning in the console, not an exception.
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 β search "Google Photos Loader" (by PabloGFX) β Install β restart. No model downloads; the heavy prerequisite is the one-time Google OAuth setup (Library API enabled, OAuth desktop client saved as client_secrets.json in the pack folder, logged in once via the Login/Logout node).
Troubleshooting
- Black output β empty search results; loosen the filters.
- Auth errors β
client_secrets.jsonmisnamed (must have the "s") or the token is stale - reset it with the Login/Logout node. - Slow first run β that's just downloading your photos; the cache makes run two fast.
- Search results feel random β results come back newest-first by default, and Google's content categories are auto-classified (see the ContentFilter article for how fuzzy those can be).
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| max_images | INT | 101β5000 | β |
| start_from | INT | 00β10000 | β |
| size_option | COMBO | 4 options: Original Size, Scale to Size, Crop to Size, Fill to Size | |
| target_size | INT | 51264β2048 | β |
| cache_images | BOOLEAN | true | β |
| remove_cache | BOOLEAN | false | β |
| advanced_logs | BOOLEAN | false | β |
| client_secrets_fileopt | STRING | /tmp/ComfyUI/custom_nodes/comfyui-google-photos-loader/client_secrets.json | β |
| positive_custom_filtersopt | CONTENT_FILTER | β | |
| negative_custom_filtersopt | CONTENT_FILTER | β | |
| specific_yearopt | INT | 00β9999 | β |
| specific_monthopt | INT | 00β12 | β |
| specific_dayopt | INT | 00β31 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |