Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

Feature(backend): Add a command-line utility for running gallery maintenance (#8827)

Lincoln Stein848cc12d63da
diff --git a/invokeai/backend/util/db_maintenance.py b/invokeai/backend/util/gallery_maintenance.py
similarity index 100%
rename from invokeai/backend/util/db_maintenance.py
rename to invokeai/backend/util/gallery_maintenance.py
diff --git a/scripts/gallery_maintenance.py b/scripts/gallery_maintenance.py
new file mode 100755
index 0000000000..71aed88c92
--- /dev/null
+++ b/scripts/gallery_maintenance.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+"""
+gallery_maintenance.py
+
+Remove orphan images from the gallery directory.
+Remove orphan database entries for images that no longer exist in the gallery directory.
+Regenerate missing thumbnail images.
+"""
+
+from invokeai.backend.util.gallery_maintenance import main
+
+main()