Index InvokeAI board videos alongside board images - #369
Open
lstein wants to merge 2 commits into
Open
Conversation
An InvokeAI board holds videos next to its images and its gallery shows both, so a board-backed album now indexes both. * ``fetch_board_video_names`` lists a board's videos. Videos are a separate resource over there: their own router, the board passed as a query parameter rather than a path segment, and a ``VideoNamesResult`` object instead of a bare array. A backend predating the video API 404s the whole router, which reads as "no videos here" so those albums keep indexing their images. * ``delete_video`` routes video deletions to the video endpoint. It also checks ``failed_videos``, because that endpoint can report a failure inside a 200 — accepting it would drop the local index row while the video stayed on the board. * Board albums derive both output directories now. ``image_paths`` is what gates file access and relative-path resolution, so a board video would otherwise index but be refused at playback. The paths are recomputed on every construction, which is how albums written before this pick up the videos directory with no migration. * The indexing pipeline itself learned videos: a video is loaded as the still frame ffmpeg extracts near its start and then flows through the encoder exactly like a photo, with the probe facts riding along in the per-image metadata. The scan gate skips the pixel probe for videos, which has no header to read and would otherwise reject every clip small enough to reach it. Collecting videos is opt-in per album (``Embeddings.index_videos``) and only board albums set it: turning it on for a directory album re-scans it for a whole new media type and makes indexing depend on ffmpeg, which is a separate call to make. Verified end-to-end against a live InvokeAI: 48 videos + 2 images resolved off a real board, with frame extraction and probe facts intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Master grew its own video support while this branch was open (#358–#362: badge, modal player, guards, indexing, semantic-map filter). Conflict resolution: * ``embeddings.py`` — took master's wholesale. Its video indexing is a superset of this branch's: same still-frame-as-the-image approach, plus priming the per-album frame cache at index time, invalidating scan-reject entries written while videos still went through the pixel gate, and pruning stale stills. ``Embeddings.index_videos`` and ``scan_extensions`` are gone with it — master collects videos for every album, so there is nothing left to opt into. * ``_resolve_board_album_files`` — kept this branch's. Master had added a filter that skipped board videos explicitly, because board deletion routed through ``delete_image`` and had not been verified against them. That is precisely what this branch fixes: videos are deleted through ``delete_video``, verified against a live InvokeAI. * Both ``Embeddings(...)`` call sites take master's ``album_key=``. Also dropped the docs note claiming videos were board-album-only, which master's directory-album indexing makes false.
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.
An InvokeAI board holds videos next to its images and its gallery shows both, so a board-backed album now indexes both. This removes the board-video restriction added in #361, which skipped them explicitly pending a verified delete path.
What changed
InvokeAI client
fetch_board_video_names()lists a board's videos. Videos are a separate resource over there: their own router, the board passed as a query parameter rather than a path segment, and aVideoNamesResultobject instead of the bare array the images endpoint returns. The sameis_intermediate=false+categories=general,userfiltering as images applies, and it matters — a Wan pipeline writes its intermediate clips to the board too (a real board listed 52 unfiltered vs 48 filtered).delete_video()routes deletions to the video endpoint. It also checksfailed_videos, because that endpoint can report a failure inside a 200 — accepting it would drop the local index row while the video stayed on the board, and the video would reappear on the next re-index.Board albums
outputs/imagesandoutputs/videos).image_pathsis what gates file access and relative-path resolution, so a board video would otherwise index but be refused at playback. The paths are recomputed on every construction, which is how albums written before this pick up the videos directory with no migration step.Verification
Backend 679 passed, frontend 578 passed, ruff clean.
Verified end-to-end against a live InvokeAI: 48 videos + 2 images resolved off a real board, through the auth fallback, with frame extraction and probe facts intact.
Note on the merge commit
Master's video work (#358–#362) landed while this was open.
embeddings.pytook master's side wholesale — its video indexing is a superset of what this branch had grown independently — and_resolve_board_album_fileskept this branch's. Details are in the merge commit message. Since PRs here are squash-merged, the merge commit disappears on landing.🤖 Generated with Claude Code