Keyframes: import and generate (#45) #96
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!96
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-45-keyframes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #45.
A filmmaker can pin how a Shot opens, closes or looks at a given time (User Story 91). Keyframes taken from another Take's frame come in #60.
What changed
keyframetable holds the anchor (start,end, oratwith a time in ms), the origin (importedorgenerated), the image blob, and the prompt and seed of a generated one. A Shot has at most one Keyframe per anchor. The job table is rebuilt so a job can target an anchor of a Shot.import_keyframestores the image with its pixels as they came. Putting a Keyframe at a taken anchor replaces it as one undoable edit.remove_keyframeis undoable. Shot and Setup deletes take their Keyframes with them, and undo brings them back.generate_keyframequeuesimage.t2iat the Shot's exact final W×H: a 1120 px short side, with the long side following the effective ratio, both rounded to ×32 (16:9 gives 1984×1120). The image lands at its anchor as an undoable "Generate keyframe" edit.off_ratioflags a Keyframe whose image is more than 1% away from the Shot's effective ratio. The Board view shows the flag as a badge.1A · Start keyframeor1A · Keyframe at 1.5 s.JobDtogainskeyframeAnchor, andshotIdis set for keyframe jobs.Decisions worth a look
off_ratiowhen it builds the job.require_queueable_lengthalready works the same way.FINAL_SHORT_SIDE = 1120is the Generation profile's default. #50 should replace it with the Project's profile value.at_seconds?. I storedat_ms, which matches Shot lengths everywhere else.Tests
crates/studio-core/tests/keyframes.rshas 17 tests:off_ratiounder Project and Shot ratio changesimage.t2igraph at the exact final sizesrc/lib/board/keyframes.test.tscovers slot layout, labels and badges.cargo test --workspace --all-features(487 passed),bun test src(99 passed) andbun run checkpass. Clippy adds no new warnings.