Surface skipped board images after indexing#337
Merged
Conversation
When an InvokeAI board album indexes fewer images than the board reports (commonly because some names listed in InvokeAI's DB have no file on disk), the discrepancy was invisible: _resolve_board_album_files logged a server-side warning, but nothing reached the UI, so the album silently showed e.g. 240 of 242 images. Surface it as a non-fatal completion notice: - ProgressInfo gains a warning_message, set via a pending-warning channel (set_completion_warning) that survives the per-phase start_operation resets and is folded into the COMPLETED status atomically by complete_operation. Exposed through ProgressResponse. - _resolve_board_album_files now returns the missing count; the background task records "N of M image(s) listed by InvokeAI were not found on disk and were skipped" (and clears it on a clean re-run). - The frontend shows the notice on completion (orange) and persists it under the card's index-status line via a per-album indexWarnings map. Also close a related blind spot: get_image_files' explicit-list branch (used by board albums) now counts and logs sub-threshold/unreadable images, mirroring the directory-scan path instead of dropping them silently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
A user pointed an InvokeAI board album at a board the InvokeAI gallery reports as 242 images, but the album indexed only 240. The cause: 2 image names listed in InvokeAI's database have no corresponding file on disk under
<root>/outputs/images/._resolve_board_album_filesalready skipped them and logged a server-side warning — but nothing reached the UI, so the discrepancy was invisible. (The underlying missing-file situation is an InvokeAI-side data issue the user is handling separately; this PR makes PhotoMap explain the gap.)What this does
Surfaces the skip as a non-fatal completion notice, end to end:
progress.py—ProgressInfogainswarning_message. Because the per-phasestart_operationcalls recreateProgressInfomid-run, the notice is recorded ahead of time via a separateset_completion_warning(...)channel and folded into theCOMPLETEDstatus atomically insidecomplete_operation(so any poll that seescompletedalso sees the warning — no race). Consumed on completion and cleared onremove_progress, so a clean re-run never inherits a stale notice.index.py—_resolve_board_album_filesnow returns(existing, missing). The background task records"N of M image(s) listed by InvokeAI were not found on disk and were skipped."whenmissing > 0, and clears it otherwise.ProgressResponseexposeswarning_message.album-manager.js— the completion status shows the notice in orange, and it persists under the card's index-status line (via a per-albumindexWarningsmap) after the transient progress UI is gone.Bonus: a related blind spot
get_image_files' explicit-file-list branch (used by board albums) silently dropped sub-threshold/unreadable images, while the directory-scan path logs"Skipped N image(s) under …px". The list branch now counts and logs them too, so future indexed-vs-source mismatches aren't a mystery.Testing
441 passed): newtest_progress.pycases for the warning folding in / surviving phase restarts / clearing on reuse; newtest_invokeai_board_index.pycases asserting a ghost board entry produces"1 of 5 … not found on disk"on the completed run (and that a complete board carries no warning).383 passed): new cases for the completed-status warning rendering and the persistent card note.ruff,eslint, andprettier --checkall clean.🤖 Generated with Claude Code