Content Filter π
Checkboxes that become Google's content filters
- CONTENT_FILTER
The Google Photos Images Loader can search your whole library, but on its own it's dumb about content - "give me photos" is all it can do. This node is the part that makes the search smart. It's a panel of 26 checkboxes, one per Google Photos content category, and it produces a little CONTENT_FILTER object you plug into the loader.
How it works
Every toggle maps to one of the content categories the Google Photos Library API recognizes: LANDSCAPES, RECEIPTS, CITYSCAPES, LANDMARKS, SELFIES, PEOPLE, PETS, WEDDINGS, BIRTHDAYS, DOCUMENTS, TRAVEL, ANIMALS, FOOD, SPORT, NIGHT, PERFORMANCES, WHITEBOARDS, SCREENSHOTS, UTILITY, ARTS, CRAFTS, FASHION, HOUSES, GARDENS, FLOWERS, HOLIDAYS. Check a few, and the node emits a dict listing the ones you selected. The Images Loader then converts that into Google's includedContentCategories (wire into positive_custom_filters) or excludedContentCategories (wire into negative_custom_filters) - include means "only these," exclude means "drop these."
There are no other inputs. Just the checkboxes.
Where to use it
The natural setup is two of these: one positive ("I want ANIMALS and TRAVEL") and one negative ("but never SCREENSHOTS or DOCUMENTS"), wired into the Images Loader's two filter inputs. That combo covers most "find me the good photos" use cases - vacation shots for a style transfer run, pet photos for a training set, receipts when you want exactly the opposite of a vacation.
One honest caveat: these categories are Google's auto-classification, computed when your photos were uploaded. It's genuinely good at unambiguous things - screenshots, whiteboards, receipts - and genuinely fuzzy at overlap-y ones (a birthday photo of a person at a wedding could hit PEOPLE, WEDDINGS, and BIRTHDAYS all at once, or none of them). Treat it as a coarse filter that slashes your search space, not a precise query. "Screenshots, but not documents" works great; "people, but only good portraits" is going to let a lot through.
Two edge behaviors worth knowing. First, an all-unchecked filter emits an empty category list, and the loader treats it as "no filter" - so a ContentFilter you forgot to configure is a no-op, not an error. Second, if a positive filter excludes everything, the loader returns a black placeholder image instead of failing (that's the Images Loader's behavior, detailed in its article).
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. It's a pure utility node - you still need the pack's Google Cloud auth set up for the loader on the other end of the wire to actually return anything.
Troubleshooting
- Filter seems to do nothing β either the checkboxes are all off (no-op) or the filter isn't wired into
positive_custom_filters/negative_custom_filterson the Images Loader. - Too many/too few results β category overlap is normal; add a negative filter or narrow the date fields on the loader.
- Black output β positive filter is too restrictive; loosen it.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| landscapes | BOOLEAN | false | β |
| receipts | BOOLEAN | false | β |
| cityscapes | BOOLEAN | false | β |
| landmarks | BOOLEAN | false | β |
| selfies | BOOLEAN | false | β |
| people | BOOLEAN | false | β |
| pets | BOOLEAN | false | β |
| weddings | BOOLEAN | false | β |
| birthdays | BOOLEAN | false | β |
| documents | BOOLEAN | false | β |
| travel | BOOLEAN | false | β |
| animals | BOOLEAN | false | β |
| food | BOOLEAN | false | β |
| sport | BOOLEAN | false | β |
| night | BOOLEAN | false | β |
| performances | BOOLEAN | false | β |
| whiteboards | BOOLEAN | false | β |
| screenshots | BOOLEAN | false | β |
| utility | BOOLEAN | false | β |
| arts | BOOLEAN | false | β |
| crafts | BOOLEAN | false | β |
| fashion | BOOLEAN | false | β |
| houses | BOOLEAN | false | β |
| gardens | BOOLEAN | false | β |
| flowers | BOOLEAN | false | β |
| holidays | BOOLEAN | false | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONTENT_FILTER | CONTENT_FILTER | β |