Manually add people

Is it possible yet to manually add people to a photo that wasn’t detected by Immich as this specific person? It’s just one photo of this person and I want to add their name. I saw this was a question back in 2023 so I’m wondering if the feature has been added yet.
4 Replies
Immich
Immich4d ago
:wave: Hey @itbedguy, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
schuhbacca
schuhbacca4d ago
It is not. You can only manually add people that a person has already been created for
Sergey Katsubo
If you are fine with modifying the database and running shell commands - here is a walkthrough/workaround to add a new person. I describe each step, so the list below may look daunting. Let know if you have any questions. --- 1. Open the photo containing the person in web UI. 2. Copy the asset ID from address bar: the part after /photos/ in URL like http://localhost:2283/photos/1fbb3d3b-9f73-43e4-85f3-514203306a0a 3. Set your values for person_name, asset_id, owner_email in the script below. 4. Run the script on the Immich host. You can copy-paste it into shell/terminal. The script adds a new person (as favorite for ease of access) and creates a fake face with zero dimensions.
person_name='That New Person'
asset_id='1fbb3d3b-9f73-43e4-85f3-514203306a0a'
owner_email='immichuser@example.com'
sql=$(cat <<'EOF'
with new_person as (
insert into person (name, "ownerId", "isFavorite")
values (:'person_name', (select id from "user" where email = :'owner_email'), true)
returning id
)
insert into asset_face ("assetId", "personId", "sourceType")
select :'asset_id', id, 'manual'
from new_person;
EOF
)
docker exec -i immich_postgres psql -U postgres -d immich -v person_name="$person_name" -v asset_id="$asset_id" -v owner_email="$owner_email" <<<"$sql"
person_name='That New Person'
asset_id='1fbb3d3b-9f73-43e4-85f3-514203306a0a'
owner_email='immichuser@example.com'
sql=$(cat <<'EOF'
with new_person as (
insert into person (name, "ownerId", "isFavorite")
values (:'person_name', (select id from "user" where email = :'owner_email'), true)
returning id
)
insert into asset_face ("assetId", "personId", "sourceType")
select :'asset_id', id, 'manual'
from new_person;
EOF
)
docker exec -i immich_postgres psql -U postgres -d immich -v person_name="$person_name" -v asset_id="$asset_id" -v owner_email="$owner_email" <<<"$sql"
(The last line assumes default Postgres container/user/dbname from Immich compose) Expected output: INSERT 0 1. 5. Refresh the photo view page. New person should appear in the People section with a broken thumbnail. 6. Use "+" sign (Tag people) as usual to add the real face. New person name should appear in the dropdown list. 7. After that, when you click Edit people/faces, there will be 2 faces: the fake one and the real one. You can remove the fake face; it did its job and is not needed anymore. 8. Now, to fix the person thumbnail go to Administration -> Jobs and trigger Generate thumbnail -> Missing. 9. Upon job completion refresh the photo view page. Now the person thumbnail should look fine.
Sergey Katsubo
As the low level modification through the database is generally not recommended and is not officially supported, I also added a quick API-based script, see this gist: https://gist.github.com/skatsubo/3beda82b175277aa50fdbddf5ed1fefa
Gist
How to manually add people in Immich using API or through the database
How to manually add people in Immich using API or through the database - How to manually add people in Immich.md

Did you find this page helpful?