Immich automatic Person -> Album
Automatically add people (faces) to an album and keep that album up-to-date. You can then share that automatic person-album with another user (for example, a shared album of your children).
You can arbitrarily add any face/person to any album. So you could make a "Family" album which contains all your family members and is automatically updated.
You can use API keys from any number of Immich users, so the one Docker container can handle doing automatic albums for all your users.
Setup
Docker-compose configuration
Take a copy of the docker-compose.yml file.
There are two methods for specifying the config options:
config.json file
- In the folder which contains your
docker-compose.ymlfile, create a/data/folder. - Inside the
datafolder, put a copy of config.json. - Edit the
config.jsonfile as required.
Inline configuration
Alternatively, you can add the configuration inline in your docker-compose.yml file like this:
services:
immich-person-to-album:
image: alangrainger/immich-person-to-album:latest
container_name: immich-person-to-album
restart: always
volumes:
- ./data:/data
environment:
CONFIG: |
{
"immichServer": "http://192.168.0.20:2283",
"schedule": "*/30 * * * *",
"users": [
{
"apiKey": "",
"personLinks": [
{
"description": "Photos of Joe",
"personId": "Joe's person ID",
"albumId": "Shared album ID"
}
]
}
]
}
Create an API key
- Open Immich on desktop
- Click on your profile picture
- Click Account Settings
- Go to API Keys
- Click New API Key
- Give it a name
- Add the permissions of
asset.readandalbumAsset.create - Click Create
- Copy the new API key and put it in your config file
Get your person and album IDs
Person IDs:
- Immich → Explore → People → Click person → Copy ID from URL
- Example URL: http://your-server/people/f3437c84-83f9-4e84-9640-0dcd12efd08e
- Person ID: f3437c84-83f9-4e84-9640-0dcd12efd08e
Album IDs:
- Immich → Albums → Click album → Copy ID from URL
- Example URL: http://your-server/albums/ff85e8c5-32e6-49e0-a0ad-e4dd7ef66bce
- Album ID: ff85e8c5-32e6-49e0-a0ad-e4dd7ef66bce
Troubleshooting
Make sure you can access your Immich API from inside the immich-person-to-album container. Run this command from outside the container, making sure to replace the address with your Immich server address:
docker exec immich-person-to-album sh -c "wget -qO- http://192.168.0.20:2283/api/server/ping"
It will return {"res":"pong"} if Immich is accessible to the immich-person-to-album container.
Acknowledgements
Thanks to https://github.com/ajb3932/immich-partner-sharing for the idea and for some of the readme text.