Management command and API endpoint for face deduplication
Author: derneuereCreated Sep 16, 2026Updated Sep 16, 2026
Labelsenhancementbackend
Summary
Provide a management command and an API endpoint for face deduplication, so it can be run without the Django admin.
Follow-up from #2020 (fixes #1918). That PR makes the admin "Deduplicate faces" action work on large libraries by enqueueing chunks of photo ids. It is still the only entry point, and it requires staff access to the Django admin, which most Docker deployments do not expose.
Proposed change
python manage.py deduplicate_faces [--user <username>] [--chunk-size N]that reusesdeduplicate_faces_functionfromapps/backend/api/admin.py(move the helper next to the other face code so admin and command share it).- An admin-only API endpoint that enqueues the same job as a
LongRunningJob, so progress shows in the existing jobs UI and it can be triggered from the frontend admin area next to the other maintenance actions. - Make the chunk size (
DEDUPLICATE_FACES_CHUNK_SIZE, currently 500) a setting or environment variable.
Source: LibrePhotos/librephotos