Nodes/Google Photos Loader - by PabloGFX/Google Photos Images Loader πŸ“·
ComfyUI Node

Google Photos Images Loader πŸ“·

Search your entire Google Photos library, not just albums

By lazniakΒ·Created 2 years agoΒ·Updated about a year agoΒ· 3
Google Photos Images Loader πŸ“·
  • positive_custom_filters
  • negative_custom_filters
  • IMAGE
β—„max_images10β–Ί
β—„start_from0β–Ί
β—„size_optionβ–Ύβ–Ί
β—„target_size512β–Ί
β—„cache_imagestrueβ–Ί
β—„remove_cachefalseβ–Ί
β—„advanced_logsfalseβ–Ί
β—„client_secrets_file/tmp/ComfyUI/custom_nodes/comfyui-google-photos-loader/client_secrets.jsonβ–Ί
β—„specific_year0β–Ί
β—„specific_month0β–Ί
β—„specific_day0β–Ί

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 with start_from 0, 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, default true) - keep it on.
  • remove_cache (BOOLEAN, default false) - 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, default false) - 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) and specific_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.json misnamed (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).
Categoryloaders

Inputs (13)

NameTypeDefaultDescription
max_imagesINT101–5000β€”
start_fromINT00–10000β€”
size_optionCOMBO4 options: Original Size, Scale to Size, Crop to Size, Fill to Size
target_sizeINT51264–2048β€”
cache_imagesBOOLEANtrueβ€”
remove_cacheBOOLEANfalseβ€”
advanced_logsBOOLEANfalseβ€”
client_secrets_fileoptSTRING/tmp/ComfyUI/custom_nodes/comfyui-google-photos-loader/client_secrets.jsonβ€”
positive_custom_filtersoptCONTENT_FILTERβ€”
negative_custom_filtersoptCONTENT_FILTERβ€”
specific_yearoptINT00–9999β€”
specific_monthoptINT00–12β€”
specific_dayoptINT00–31β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”