Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Match empty shot cards to video dimensions

Bitti4031c18489ec
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 16b57cf..14e8818 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -34,6 +34,7 @@ Changes since 0.3.2.
## Fixes and improvements
+- Empty shot cards use their Video's resolution and aspect ratio while waiting for a preview or generated video.
- Non-primary scene takes can be removed during generation without interrupting the running job.
- Videos can override project Look, aspect ratio and resolution; scenes inherit their Video's settings.
- First & Last Frame prompts follow MiniMax's I2VA, L2VA and FL2VA formats, with ending anchors timed to the final shot.
diff --git a/src/components/workspace/GeneratorView.tsx b/src/components/workspace/GeneratorView.tsx
index 22a0437..a69ef75 100644
--- a/src/components/workspace/GeneratorView.tsx
+++ b/src/components/workspace/GeneratorView.tsx
@@ -32,6 +32,7 @@ import { templateWithSceneLoras, defaultGeneratorTemplate, generationStepsForTem
import { refreshDownloadedWeights } from "../../lib/weightDownloads";
import { DebugPromptDialog } from "./DebugPromptDialog";
import { sceneVideoSettings, videoGuidedScene } from "../../lib/videoLibrary";
+import { generationDimensions } from "../../lib/export";
interface GeneratorViewProps {
toolbarStart?: ReactNode;
@@ -567,6 +568,11 @@ export function GeneratorView({ config, sceneIds, toolbarStart, folderPath, runt
<div className="generator-board-viewport"><div className="generator-board">
{jobs.length > 0
? <SceneBoard
+ frameAspectRatio={job => {
+ const settings = sceneVideoSettings(job, config);
+ const { width, height } = generationDimensions(settings.resolution, settings.aspectRatio);
+ return `${width} / ${height}`;
+ }}
assets={config.assets}
jobs={jobs}
folderPath={folderPath}
diff --git a/src/components/workspace/SceneBoard.tsx b/src/components/workspace/SceneBoard.tsx
index 3ce3381..4dc7542 100644
--- a/src/components/workspace/SceneBoard.tsx
+++ b/src/components/workspace/SceneBoard.tsx
@@ -3,7 +3,7 @@ import { GenerationPreviewSource } from "./GenerationPreviewSource";
import { SceneHistoryBar } from "./SceneHistoryBar";
import { scenePreviewJob, scenePreviewAsset } from "../../lib/sceneHistory";
import { Copy16, Add16, ArrowDown16, ArrowUp16, ChevronDown12, ChevronRight12, Delete16, Grip16, MoveTo16, OpenExternal16, Rename16, Stop14, Stop16, Wand16 } from "../ui/icons";
-import { useState, type DragEvent, type KeyboardEvent, type ReactNode } from "react";
+import { useState, type CSSProperties, type DragEvent, type KeyboardEvent, type ReactNode } from "react";
import {
SCENE_MAX_SECONDS,
SCENE_MIN_SECONDS,
@@ -69,6 +69,7 @@ export const isMenuKey = (event: KeyboardEvent): boolean =>
* targets, and both carry a right-click menu. */
export function SceneBoard({
jobs,
+ frameAspectRatio,
assets = [],
folderPath,
generationCompletionTimes,
@@ -90,6 +91,7 @@ export function SceneBoard({
onRemoveShot, onHistorySelect, onMakePrimary, onRemoveGeneration, onRemoveDraft, onDuplicate,
}: {
jobs: GenerationJob[];
+ frameAspectRatio: (job: GenerationJob) => string;
assets?: ProjectAsset[];
folderPath: string;
generationPreviews?: Readonly<Record<string, GenerationPreview>>;
@@ -294,6 +296,7 @@ export function SceneBoard({
sceneDrop === null && jobIndex === jobs.length - 1 ? "scene-section--drop-after" : "",
].filter(Boolean).join(" ")}
aria-label={job.title}
+ style={{ "--shot-frame-aspect": frameAspectRatio(job) } as CSSProperties}
onDragOver={(event) => {
if (!hasDragType(event.dataTransfer.types, SCENE_DRAG_TYPE)) return;
const before = sceneBeforeFromEvent(event);
diff --git a/src/styles/generator.css b/src/styles/generator.css
index bfeaea6..ca794d6 100644
--- a/src/styles/generator.css
+++ b/src/styles/generator.css
@@ -552,15 +552,15 @@
/* --- The frame a tile shows ---------------------------------------------------
A real frame of the shot once the scene has been rendered, in that frame's
- own shape (ShotThumbnail sets aspect-ratio from the poster; 16:9 until
- then), and nothing
+ own shape (ShotThumbnail sets aspect-ratio from the poster; the Video's
+ configured dimensions until then), and nothing
invented before that: the placeholder says which state the scene is in
instead. Same rule as the media thumb and the reference card.
========================================================================== */
.shot-thumb {
position: relative;
- aspect-ratio: 16 / 9;
+ aspect-ratio: var(--shot-frame-aspect, 16 / 9);
width: 100%;
display: flex;
flex-direction: column;
@@ -576,7 +576,7 @@
.shot-thumb-frame {
position: relative;
width: 100%;
- aspect-ratio: 16 / 9;
+ aspect-ratio: var(--shot-frame-aspect, 16 / 9);
}
.shot-thumb-frame > .shot-thumb { height: 100%; }