Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Add Video generation setting overrides

Bitti4d3076c59327
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 523fd2b..14e53c6 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -22,6 +22,7 @@ Changes since 0.3.2.
## Fixes and improvements
+- Videos can override project Look, aspect ratio and resolution; scenes inherit their Video's settings.
- Empty Sound prompts now produce `overall_soundscape: N/A`; supplied prompts are used directly.
- First & Last Frame prompts follow MiniMax's I2VA, L2VA and FL2VA formats, with ending anchors timed to the final shot.
- Fixed AppImage launcher permissions for users other than the package builder.
diff --git a/docs/scene-types.md b/docs/scene-types.md
index 9e7a78c..24b42cf 100644
--- a/docs/scene-types.md
+++ b/docs/scene-types.md
@@ -2,7 +2,9 @@
Videos contain ordered Scenes, which contain Shots. The Video library supports folders, grid/list views and sequential card or popout playback. Click a Video to select its settings; double-click or choose **Edit Scenes** in the right panel or context menu to edit its scenes. Each scene remains separate in Timeline. Existing projects open with their scenes grouped in a default Video.
-Video settings provide a shared prompt with reference chips, background music and a reference video. Each scene receives the reference range at its cumulative start time: a 10-second first scene uses 0–10 seconds, and the next starts at 10 seconds. Imported/generated media uses the complete asset; reference entries use their saved trim range. Reordering or resizing scenes updates these ranges for the next generation. A source that ends too early blocks generation.
+Video settings provide Look, aspect ratio and resolution overrides, each defaulting to the project setting. Scenes inherit their Video's settings; an explicit scene Look takes precedence. Choosing **Project default** restores inheritance for that Video setting.
+
+Videos also provide a shared prompt with reference chips, background music and a reference video. Each scene receives the reference range at its cumulative start time: a 10-second first scene uses 0–10 seconds, and the next starts at 10 seconds. Imported/generated media uses the complete asset; reference entries use their saved trim range. Reordering or resizing scenes updates these ranges for the next generation. A source that ends too early blocks generation.
For a music video, select a complete song on an empty Video and choose **Create scenes for song** to divide its full duration into roughly 10-second scenes. Add visual direction and an image reference to the shared prompt, or select a reference video: SlopFab sound references need visual conditioning and References/Singularity weights. Music guides generated audio; add the original song to Timeline when you want its exact soundtrack. Shared media references support Prompt, Single Shot, Continue, First & Last Frame, Backdrop and Pose scenes; each scene must last at least two seconds.
diff --git a/src-tauri/src/project/validation/mod.rs b/src-tauri/src/project/validation/mod.rs
index 06f02b7..cf7740c 100644
--- a/src-tauri/src/project/validation/mod.rs
+++ b/src-tauri/src/project/validation/mod.rs
@@ -1,5 +1,6 @@
//! The order is part of the persisted document compatibility contract.
mod values;
+pub(crate) use values::{is_shot_tag_id, is_supported_aspect_ratio, is_supported_resolution};
#[cfg(test)]
pub(crate) use values::is_iso_datetime;
mod assets;
diff --git a/src-tauri/src/project/video.rs b/src-tauri/src/project/video.rs
index 74c5ef3..172df30 100644
--- a/src-tauri/src/project/video.rs
+++ b/src-tauri/src/project/video.rs
@@ -18,6 +18,12 @@ pub(crate) struct ProjectVideo {
pub music_source: Option<VideoSource>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub video_source: Option<VideoSource>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub default_look: Option<String>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub aspect_ratio: Option<String>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub resolution: Option<String>,
pub created_at: String,
}
@@ -42,6 +48,11 @@ pub(crate) fn validate(config: &mut super::ProjectConfig) -> Result<(), String>
if video.id.is_empty() || !ids.insert(video.id.as_str()) || video.title.trim().is_empty() || video.title.chars().count() > 200
|| video.prompt.chars().count() > 30000 { return Err("Invalid Video settings.".into()); }
if video.folder_id.as_deref().is_some_and(|id| !folders.contains_key(id)) { return Err("Video folder is missing.".into()); }
+ if video.default_look.as_deref().is_some_and(|value| !super::validation::is_shot_tag_id(value))
+ || video.aspect_ratio.as_deref().is_some_and(|value| !super::validation::is_supported_aspect_ratio(value))
+ || video.resolution.as_deref().is_some_and(|value| !super::validation::is_supported_resolution(value)) {
+ return Err("Invalid Video generation settings.".into());
+ }
for source in [&video.music_source, &video.video_source].into_iter().flatten() {
if source.id.is_empty() || !matches!(source.kind.as_str(), "asset" | "reference") { return Err("Invalid Video reference source.".into()); }
}
@@ -67,12 +78,21 @@ mod tests {
let timeline = serde_json::to_value(&config.timeline).unwrap();
config.videos = vec![ProjectVideo { id: "film".into(), title: "Film".into(), folder_id: None,
scene_ids: vec![scene_id.clone(), "removed-scene".into()], prompt: "Neon".into(),
- music_source: Some(VideoSource { kind: "asset".into(), id: "song".into() }), video_source: None, created_at: config.created_at.clone() }];
+ music_source: Some(VideoSource { kind: "asset".into(), id: "song".into() }), video_source: None,
+ default_look: Some("watercolor".into()), aspect_ratio: Some("9:16".into()), resolution: Some("544p".into()), created_at: config.created_at.clone() }];
validate(&mut config).unwrap();
assert_eq!(config.videos[0].scene_ids, [scene_id]);
let restored: super::super::ProjectConfig = serde_json::from_value(serde_json::to_value(&config).unwrap()).unwrap();
assert_eq!(restored.videos, config.videos);
assert_eq!(serde_json::to_value(&restored.timeline).unwrap(), timeline);
+ let saved = config.videos[0].clone();
+ for field in ["defaultLook", "aspectRatio", "resolution"] {
+ let mut value = serde_json::to_value(&saved).unwrap();
+ value[field] = "bad value".into();
+ config.videos[0] = serde_json::from_value(value).unwrap();
+ assert!(validate(&mut config).unwrap_err().contains("generation settings"));
+ }
+ config.videos[0] = saved;
config.videos.push(ProjectVideo { id: "other".into(), ..config.videos[0].clone() });
assert!(validate(&mut config).unwrap_err().contains("only one Video"));
}
diff --git a/src/components/workspace/GeneratorView.test.tsx b/src/components/workspace/GeneratorView.test.tsx
index 5e58ddf..c6a38e4 100644
--- a/src/components/workspace/GeneratorView.test.tsx
+++ b/src/components/workspace/GeneratorView.test.tsx
@@ -574,6 +574,23 @@ async function finishFirst(state: ReturnType<typeof setup>) {
}
describe("Generator scene controls", () => {
+ it("uses Video defaults in the inspector, debug prompt and generation request", async () => {
+ const initial = project();
+ initial.settings.defaultLook = "claymation";
+ initial.videos = [{ id: "film", title: "Film", sceneIds: initial.generationJobs.map((job) => job.id), prompt: "", createdAt: initial.createdAt,
+ defaultLook: "watercolor", aspectRatio: "9:16", resolution: "544p" }];
+ const state = setup(initial);
+ expect(screen.getByText("Using Video Look: Watercolor.")).toBeInTheDocument();
+ expect(screen.getByRole("combobox", { name: "The look of this scene" })).toHaveTextContent("Video default");
+ act(() => saveDebugOptionsEnabled(true));
+ fireEvent.click(screen.getByRole("button", { name: "Debug prompt" }));
+ expect(screen.getByRole("dialog", { name: "Debug prompt" })).toHaveTextContent("Watercolor");
+ fireEvent.keyDown(screen.getByRole("dialog", { name: "Debug prompt" }), { key: "Escape" });
+ fireEvent.click(within(screen.getByRole("region", { name: "First scene" })).getByRole("button", { name: "Generate" }));
+ await waitFor(() => expect(state.latest().generationJobs[0].generationSnapshot).toEqual(expect.any(String)));
+ expect(JSON.parse(state.latest().generationJobs[0].generationSnapshot!)).toMatchObject({ canvasWidth: 544, canvasHeight: 960, prompt: expect.stringContaining("Watercolor") });
+ expect(state.latest().settings).toEqual(initial.settings);
+ });
it.each([["", "Watercolor"], ["claymation", "Claymation"]])("compiles scene Look %s with the project's default", async (sceneLook, expected) => {
const initial = project();
initial.settings.defaultLook = "watercolor";
@@ -650,7 +667,7 @@ describe("Generator scene controls", () => {
await waitFor(() => expect(state.latest().generationJobs[0].generationSnapshot).toEqual(expect.any(String)));
const snapshot = JSON.parse(state.latest().generationJobs[0].generationSnapshot!);
expect(snapshot.referencePaths).toEqual(["C:\\\\project\\references\\opening.jpg"]);
- expect(snapshot.prompt).toContain("<Picture 1> is the first frame of the video.");
+ expect(snapshot.prompt).toContain("<Picture 1> (from [Shot 1]) is fully referenced.");
});
it("sends a last-frame image and clears it independently of the start frame", () => {
@@ -662,7 +679,7 @@ describe("Generator scene controls", () => {
expect(state.latest().generationJobs[0].endFrameReferenceId).toBe("closing");
fireEvent.click(within(screen.getByRole("region", { name: "First scene" })).getByRole("button", { name: "Generate" }));
const snapshot = JSON.parse(state.latest().generationJobs[0].generationSnapshot!);
- expect(snapshot.prompt).toContain("<Picture 1> is the last frame of the video.");
+ expect(snapshot.prompt).toContain("<Picture 1> (from [Shot 2]) aligns with the 6.58-second mark of the target video.");
expect(snapshot.referencePaths[0]).toContain("closing.png");
chooseReference("Last frame for this scene", "None");
expect(state.latest().generationJobs[0].endFrameReferenceId).toBeUndefined();
diff --git a/src/components/workspace/GeneratorView.tsx b/src/components/workspace/GeneratorView.tsx
index 56d8c5c..d64112e 100644
--- a/src/components/workspace/GeneratorView.tsx
+++ b/src/components/workspace/GeneratorView.tsx
@@ -27,7 +27,7 @@ import { purgeTimelineThumbnails } from "../../lib/timelineThumbnails";
import { defaultGeneratorTemplate, generationStepsForTemplate, loadDebugOptionsEnabled, loadGeneratorTemplateSettings, saveGeneratorTemplateSettings, subscribeDebugOptions, subscribeGeneratorTemplates, templateSupportsVideo, templateUsable } from "../../lib/settings";
import { refreshDownloadedWeights } from "../../lib/weightDownloads";
import { DebugPromptDialog } from "./DebugPromptDialog";
-import { videoGuidedScene } from "../../lib/videoLibrary";
+import { sceneVideoSettings, videoGuidedScene } from "../../lib/videoLibrary";
interface GeneratorViewProps {
toolbarStart?: ReactNode;
@@ -154,6 +154,8 @@ export function GeneratorView({ config, sceneIds, toolbarStart, folderPath, runt
/* A scene can be deleted, and a shot can be removed, from under the panel.
Falling back to the first scene beats a panel pointing at nothing. */
const selected = jobs.find((job) => job.id === selection.jobId) ?? jobs[0];
+ const inheritedSettings = selected ? sceneVideoSettings(selected, config) : config.settings;
+ const parentVideo = selected && config.videos?.find((video) => video.sceneIds.includes(selected.id));
const animate = selected ? sceneTypeFor(selected) === "animate" : false;
const selectedShots = useMemo(() => (selected ? sceneShots(selected) : []), [selected]);
const shotIndex = selectedShots.findIndex((shot) => shot.id === selection.shotId);
@@ -684,7 +686,8 @@ export function GeneratorView({ config, sceneIds, toolbarStart, folderPath, runt
template={selectedTemplate}
defaultSteps={defaultGenerationSteps}
effectiveSteps={generationStepsForTemplate(sceneGenerationSteps(selected, defaultGenerationSteps), selectedTemplate)}
- defaultLook={config.settings.defaultLook}
+ defaultLook={inheritedSettings.defaultLook}
+ defaultLookSource={parentVideo ? "Video" : "project"}
disabled={false}
references={config.references}
folderPath={folderPath}
@@ -723,7 +726,7 @@ export function GeneratorView({ config, sceneIds, toolbarStart, folderPath, runt
{debugEnabled && showDebugPrompt && selected && !openShot && <DebugPromptDialog
sceneTitle={selected.title}
- segments={compileGenerationJobSegments(frameInputs?.job ?? selected, boundRefs, config.settings.defaultLook)}
+ segments={compileGenerationJobSegments(frameInputs?.job ?? selected, boundRefs, inheritedSettings.defaultLook)}
onClose={() => setShowDebugPrompt(false)}
/>}
</div>;
diff --git a/src/components/workspace/SceneEditor.tsx b/src/components/workspace/SceneEditor.tsx
index 09363af..dd3433a 100644
--- a/src/components/workspace/SceneEditor.tsx
+++ b/src/components/workspace/SceneEditor.tsx
@@ -314,9 +314,10 @@ const SCENE_TYPE_DESCRIPTIONS: Record<SceneType, string> = {
* §4.1), and the two sound fields defined per prompt (§4.6, §4.7). Length
* lives in the scene header where it stays visible. Simple label + control
* pairs are inspector rows; the free-text fields stay full width. */
-export function SceneInspector({ job, shots, references, folderPath = "", scenes = [], neighborScenes = scenes, defaultSteps, effectiveSteps, template, defaultLook, disabled, importAvailable, importError, onAddStartFrame, onAddEndFrame, onChange, onShots, sceneType = sceneTypeFor(job) }: {
+export function SceneInspector({ job, shots, references, folderPath = "", scenes = [], neighborScenes = scenes, defaultSteps, effectiveSteps, template, defaultLook, defaultLookSource = "project", disabled, importAvailable, importError, onAddStartFrame, onAddEndFrame, onChange, onShots, sceneType = sceneTypeFor(job) }: {
sceneType?: SceneType;
defaultLook?: string | null;
+ defaultLookSource?: "project" | "Video";
job: GenerationJob;
shots: SceneShot[];
references: ProjectReference[];
@@ -472,7 +473,7 @@ export function SceneInspector({ job, shots, references, folderPath = "", scenes
value={chosen}
disabled={disabled}
aria-label="The look of this scene"
- options={[{ value: "", label: "None" }, ...look.options.map((option) => ({ value: option.id, label: option.label }))]}
+ options={[{ value: "", label: defaultLookSource === "Video" ? "Video default" : "None" }, ...look.options.map((option) => ({ value: option.id, label: option.label }))]}
onChange={(value) => {
onShots(shots.map((shot, index) => {
const settings = { ...(shot.settings ?? {}) };
@@ -483,7 +484,7 @@ export function SceneInspector({ job, shots, references, folderPath = "", scenes
}}
/>
</PropRow>}
- {!animate && !chosen && defaultLook && <p className="prop-caption">Using project Look: {look.options.find((option) => option.id === defaultLook)?.label ?? defaultLook}.</p>}
+ {!animate && !chosen && defaultLook && <p className="prop-caption">Using {defaultLookSource} Look: {look.options.find((option) => option.id === defaultLook)?.label ?? defaultLook}.</p>}
{(sceneType === "first-last-frame" || animate) && <>
<PropRow label={animate ? "Repainted frame" : "Start frame"} htmlFor={`${id}-start`} tooltip={animate ? "A frame of the driving video with the character repainted. Keep its pose, framing, background and lighting." : undefined}>
<ReferenceSelector
diff --git a/src/components/workspace/VideoLibraryView.test.tsx b/src/components/workspace/VideoLibraryView.test.tsx
index 1764711..faf43a7 100644
--- a/src/components/workspace/VideoLibraryView.test.tsx
+++ b/src/components/workspace/VideoLibraryView.test.tsx
@@ -192,3 +192,18 @@ it.each(["Grid", "List"])("selects video settings and opens scenes from the cont
fireEvent.click(screen.getByRole("menuitem", { name: "Edit Scenes" }));
expect(screen.getByLabelText("Scenes editor")).toHaveTextContent("a");
});
+
+it("edits Video overrides and restores project defaults without changing the project", () => {
+ const config = project(); config.settings.defaultLook = "watercolor";
+ config.videos = [{ ...newVideo(null), title: "First" }, { ...newVideo(null), title: "Second" }];
+ const view = mount(config);
+ expect(screen.getByRole("combobox", { name: "Video Look" })).toHaveTextContent("Project default (Watercolor)");
+ choose("Video Look", "Claymation"); choose("Video aspect ratio", "9:16"); choose("Video resolution", "544 × 960");
+ expect(view.config().videos![0]).toMatchObject({ defaultLook: "claymation", aspectRatio: "9:16", resolution: "544p" });
+ expect(view.config().settings).toEqual(config.settings);
+ fireEvent.click(screen.getByRole("button", { name: "Select Second" }));
+ expect(screen.getByRole("combobox", { name: "Video aspect ratio" })).toHaveTextContent("Project default (16:9)");
+ fireEvent.click(screen.getByRole("button", { name: "Select First" }));
+ choose("Video Look", /Project default/); choose("Video aspect ratio", /Project default/); choose("Video resolution", /Project default/);
+ expect(view.config().videos![0]).toMatchObject({ defaultLook: null, aspectRatio: null, resolution: null });
+});
diff --git a/src/components/workspace/VideoLibraryView.tsx b/src/components/workspace/VideoLibraryView.tsx
index e70753d..947c3f8 100644
--- a/src/components/workspace/VideoLibraryView.tsx
+++ b/src/components/workspace/VideoLibraryView.tsx
@@ -1,8 +1,10 @@
import { useEffect, useRef, useState, type ComponentProps, type CSSProperties, type DragEvent } from "react";
-import { referenceTypeLabel, sceneDurationSeconds, sceneGenerationPending, type ProjectConfig, type ProjectVideo, type VideoSource } from "../../lib/project";
+import { PROJECT_RESOLUTIONS, referenceTypeLabel, sceneDurationSeconds, sceneGenerationPending, type AspectRatio, type Resolution, type ProjectConfig, type ProjectVideo, type VideoSource } from "../../lib/project";
+import { outputDimensions } from "../../lib/export";
+import { SHOT_TAG_GROUPS } from "../../lib/shot-tags";
import { citableReferences } from "./SceneEditor";
import { referenceMediaTypes } from "../../lib/referenceSelection";
-import { mergeVideoScenes, newVideo, resolveVideoSource, songScenes, videoLibrary, videoScenes } from "../../lib/videoLibrary";
+import { mergeVideoScenes, newVideo, resolveVideoSource, songScenes, videoLibrary, videoScenes, videoSettings } from "../../lib/videoLibrary";
import { newMusicFolder } from "../../lib/music";
import { askNative } from "../../lib/nativeShell";
import { CommandBarButton, ComboBox, ProgressRing, PropRow, PropSection, Splitter, useContextMenu, usePaneSize, type MenuEntry } from "../ui";
@@ -14,6 +16,7 @@ import { PromptTextField } from "./PromptTextField";
import { useBackNavigation, type BackNavigationChange } from "./useBackNavigation";
const VIDEO_DRAG = "application/x-slopus-video";
+const LOOKS = SHOT_TAG_GROUPS.find((group) => group.id === "visualStyle")!.options;
const sourceValue = (source: VideoSource | null | undefined) => source ? `${source.kind}:${source.id}` : "";
const parseSource = (value: string): VideoSource | null => value ? { kind: value.startsWith("asset:") ? "asset" : "reference", id: value.slice(value.indexOf(":") + 1) } : null;
@@ -32,6 +35,8 @@ export function VideoLibraryView(props: ComponentProps<typeof GeneratorView> & {
const currentFolder = folders.find((folder) => folder.id === folderId), currentFolderId = currentFolder?.id ?? null;
const visible = videos.filter((video) => (video.folderId ?? null) === currentFolderId);
const selected = visible.find((video) => video.id === selectedId) ?? visible[0];
+ const selectedSettings = videoSettings(selected, config);
+ const resolutionLabel = (resolution: Resolution) => { const size = outputDimensions(resolution, selectedSettings.aspectRatio); return `${size.width} × ${size.height}`; };
const open = videos.find((video) => video.id === openId);
useBackNavigation(props.onBackNavigationChange, open ? "Back to Video" : null, () => setOpenId(undefined));
useEffect(() => { props.onOpenVideoChange?.(open?.id); }, [open?.id, props.onOpenVideoChange]);
@@ -115,7 +120,7 @@ export function VideoLibraryView(props: ComponentProps<typeof GeneratorView> & {
</div>)}
{visible.map((video) => {
const scenes = videoScenes(video, config), playlist = videoPlaylist(video, config), playable = playlist.length, first = playlist[0];
- const [width, height] = config.settings.aspectRatio.split(":").map(Number);
+ const [width, height] = videoSettings(video, config).aspectRatio.split(":").map(Number);
const aspect = first?.asset.width && first.asset.height ? first.asset.width / first.asset.height : width / height;
const pending = scenes.filter(sceneGenerationPending), running = pending.filter((scene) => scene.status !== "queued");
const busy = pending.length > 0;
@@ -142,6 +147,20 @@ export function VideoLibraryView(props: ComponentProps<typeof GeneratorView> & {
<PropSection title="Video"><PropRow label="Title"><input className="text-field" aria-label="Video title" maxLength={200} value={selected.title} onChange={(event) => edit({ title: event.target.value || "New video" })} /></PropRow>
<div className="music-prompt"><span>Shared prompt</span><PromptTextField aria-label="Video prompt" rows={5} value={selected.prompt} references={citableReferences(config.references).map((reference) => ({ id: reference.id, name: reference.name, mediaTypes: referenceMediaTypes(reference), detail: referenceTypeLabel(reference) }))} placeholder="Visual style and references for every scene…" onChange={(prompt) => edit({ prompt: prompt.slice(0, 30000) })} /></div>
</PropSection>
+ <PropSection title="Settings">
+ <PropRow label="Look"><ComboBox aria-label="Video Look" value={selected.defaultLook ?? ""} options={[
+ { value: "", label: `Project default (${LOOKS.find((look) => look.id === config.settings.defaultLook)?.label ?? config.settings.defaultLook ?? "None"})` },
+ ...LOOKS.map((look) => ({ value: look.id, label: look.label })),
+ ]} onChange={(value) => edit({ defaultLook: value || null })} /></PropRow>
+ <PropRow label="Aspect ratio"><ComboBox aria-label="Video aspect ratio" value={selected.aspectRatio ?? ""} options={[
+ { value: "", label: `Project default (${config.settings.aspectRatio})` },
+ ...(["16:9", "9:16", "1:1", "4:5"] as const).map((value) => ({ value, label: value })),
+ ]} onChange={(value) => edit({ aspectRatio: value ? value as AspectRatio : null })} /></PropRow>
+ <PropRow label="Resolution"><ComboBox aria-label="Video resolution" value={selected.resolution ?? ""} options={[
+ { value: "", label: `Project default (${resolutionLabel(config.settings.resolution)})` },
+ ...[...new Set([...PROJECT_RESOLUTIONS, selectedSettings.resolution])].map((value) => ({ value, label: resolutionLabel(value) })),
+ ]} onChange={(value) => edit({ resolution: value ? value as Resolution : null })} /></PropRow>
+ </PropSection>
<PropSection title="References">
<PropRow label="Music"><ComboBox aria-label="Background music" value={sourceValue(selected.musicSource)} options={sourceOptions("audio")} placeholder="Reference unavailable" onChange={(value) => edit({ musicSource: parseSource(value) })} /></PropRow>
<PropRow label="Video"><ComboBox aria-label="Reference video" value={sourceValue(selected.videoSource)} options={sourceOptions("video")} placeholder="Reference unavailable" onChange={(value) => edit({ videoSource: parseSource(value) })} /></PropRow>
diff --git a/src/lib/project.ts b/src/lib/project.ts
index b1a5ea5..7106b2e 100644
--- a/src/lib/project.ts
+++ b/src/lib/project.ts
@@ -699,6 +699,8 @@ export const projectVideoSchema = z.object({
id: idSchema, title: z.string().min(1).max(200), folderId: idSchema.nullish(),
sceneIds: z.array(idSchema).default([]), prompt: z.string().max(30000).default(""),
musicSource: videoSourceSchema.nullish(), videoSource: videoSourceSchema.nullish(),
+ defaultLook: z.string().regex(SHOT_TAG_ID_PATTERN).nullish(),
+ aspectRatio: aspectRatioSchema.nullish(), resolution: resolutionSchema.nullish(),
createdAt: isoDateSchema,
});
export type ProjectVideo = z.infer<typeof projectVideoSchema>;
diff --git a/src/lib/sceneGeneration.ts b/src/lib/sceneGeneration.ts
index 91af476..08f79f4 100644
--- a/src/lib/sceneGeneration.ts
+++ b/src/lib/sceneGeneration.ts
@@ -9,7 +9,7 @@ import {
usableReferenceImages, compileScenePromptSegments, type GenerationJob, type ProjectConfig, type ProjectReference, type SceneType,
} from "./project";
import type { SlopfabGenerationRequest } from "./runtime";
-import { videoGuidedScene } from "./videoLibrary";
+import { sceneVideoSettings, videoGuidedScene } from "./videoLibrary";
import { generationSigmaShifts, templateSupportsVideo, type GeneratorTemplate } from "./settings";
export function sceneGenerationRequest(job: GenerationJob, config: ProjectConfig, folderPath: string, defaultGenerationSteps: number, template?: GeneratorTemplate): SlopfabGenerationRequest {
@@ -21,20 +21,21 @@ export function sceneGenerationRequest(job: GenerationJob, config: ProjectConfig
// array index 0 must be the asset the prompt calls <Picture 1>.
const inputs = { ...sceneFrameInputs(job, config), ...longShotContinuationInputs(job, config)?.request };
const bound = inputs.references;
- const canvas = generationDimensions(config.settings.resolution, config.settings.aspectRatio);
+ const settings = sceneVideoSettings(job, config);
+ const canvas = generationDimensions(settings.resolution, settings.aspectRatio);
const longShot = longShotInputs(job, config);
return {
jobId: job.id,
...(job.sceneType === "single-shot" ? { singleShot: { endingPrompt: job.endingPrompt?.trim()
- ? compileScenePromptSegments({ shots: [{ id: `${job.id}-ending`, startSeconds: 0, action: job.endingPrompt }], soundscape: job.soundscape, music: job.music }, bound, config.settings.defaultLook).map((segment) => segment.value).join("")
- : compileGenerationJobPrompt(inputs.job, bound, config.settings.defaultLook) } } : {}),
+ ? compileScenePromptSegments({ shots: [{ id: `${job.id}-ending`, startSeconds: 0, action: job.endingPrompt }], soundscape: job.soundscape, music: job.music }, bound, settings.defaultLook).map((segment) => segment.value).join("")
+ : compileGenerationJobPrompt(inputs.job, bound, settings.defaultLook) } } : {}),
...(longShot ? { latentBridge: longShot.bridge } : {}),
...(job.sceneType === "extend" || job.sceneType === "bridge" ? { videoTransition: job.sceneType } : {}),
// Recompiled from current state so edits to a bound reference or a
// retimed shot reach the engine, rather than sending a prompt frozen at
// draft-creation time. This is the main prompt shown in the compiled-prompt
// panel; Single Shot captures its separate ending prompt above.
- prompt: job.sceneType === "animate" ? "" : compileGenerationJobPrompt(inputs.job, bound, config.settings.defaultLook),
+ prompt: job.sceneType === "animate" ? "" : compileGenerationJobPrompt(inputs.job, bound, settings.defaultLook),
...(inputs.previousSceneId ? { previousSceneId: inputs.previousSceneId } : {}),
...(inputs.continuationRelativePath ? { continuationRelativePath: inputs.continuationRelativePath } : {}),
...(inputs.previousSceneId ? { continuationOverlapFrames: inputs.continuationOverlapFrames,
diff --git a/src/lib/videoLibrary.test.ts b/src/lib/videoLibrary.test.ts
index 311f717..28b7bd1 100644
--- a/src/lib/videoLibrary.test.ts
+++ b/src/lib/videoLibrary.test.ts
@@ -1,6 +1,6 @@
import { expect, it } from "vitest";
import { createDraftGenerationJob, createProjectConfig, generationAssetId, parseProjectConfig, sceneDurationSeconds, type ProjectAsset } from "./project";
-import { mergeVideoScenes, newVideo, resolveVideoSource, songScenes, videoGuidedScene, videoLibrary, videoSceneOffset } from "./videoLibrary";
+import { mergeVideoScenes, newVideo, resolveVideoSource, songScenes, videoGuidedScene, videoLibrary, videoSceneOffset, sceneVideoSettings } from "./videoLibrary";
import { sceneGenerationRequest, sendBlocker } from "./sceneGeneration";
import { videoPlaylist } from "../components/workspace/VideoPlayback";
import { longShotBlocker, longShotInputs } from "./longShot";
@@ -12,6 +12,37 @@ const project = () => createProjectConfig({ name: "Videos", prompt: "", resoluti
const scene = (id: string, seconds = 10) => createDraftGenerationJob("A dancer moves", { id, sceneType: "prompt", durationSeconds: seconds });
const asset = (id: string, kind: ProjectAsset["kind"] = "audio", durationMs = 30000): ProjectAsset => ({ id, kind, name: id, relativePath: `media/${id}.${kind === "audio" ? "wav" : "mp4"}`, mimeType: kind === "audio" ? "audio/wav" : "video/mp4", durationMs, createdAt: "2026-10-27T00:00:00.000Z" });
+it("inherits project settings dynamically and applies Video overrides without changing other Videos", () => {
+ const config = project(), first = scene("first"), second = scene("second");
+ config.generationJobs = [first, second];
+ config.settings.defaultLook = "watercolor";
+ config.videos = [{ ...newVideo(null), sceneIds: [first.id] }, { ...newVideo(null), sceneIds: [second.id] }];
+ expect(sceneVideoSettings(first, config)).toEqual(config.settings);
+ config.settings.resolution = "544p";
+ expect(sceneVideoSettings(first, config).resolution).toBe("544p");
+ Object.assign(config.videos[0], { defaultLook: "claymation", aspectRatio: "9:16", resolution: "768p" });
+ const restored = parseProjectConfig(JSON.parse(JSON.stringify(config))), before = structuredClone(restored);
+ const request = sceneGenerationRequest(first, restored, "D:/Project", 8);
+ expect(request).toMatchObject({ canvasWidth: 768, canvasHeight: 1376 });
+ expect(request.prompt).toContain("Claymation");
+ const other = sceneGenerationRequest(second, restored, "D:/Project", 8);
+ expect(other).toMatchObject({ canvasWidth: 960, canvasHeight: 544 });
+ expect(other.prompt).toContain("Watercolor");
+ expect(videoPlaybackConfig(restored.videos![0], restored).settings).toMatchObject({ aspectRatio: "9:16", resolution: "768p" });
+ expect(restored).toEqual(before);
+ Object.assign(restored.videos![0], { defaultLook: null, aspectRatio: null, resolution: null });
+ expect(sceneVideoSettings(first, restored)).toEqual(restored.settings);
+});
+
+it("preserves scene Look overrides and uses the Video Look for Single Shot ending generation", () => {
+ const config = project(), job = { ...scene("first"), sceneType: "single-shot" as const, endingPrompt: "The dancer bows." };
+ config.generationJobs = [job];
+ config.videos = [{ ...newVideo(null), sceneIds: [job.id], defaultLook: "watercolor" }];
+ expect(sceneGenerationRequest(job, config, "D:/Project", 8).singleShot?.endingPrompt).toContain("Watercolor");
+ job.shots = [{ id: "one", startSeconds: 0, action: "A dancer moves", settings: { visualStyle: ["claymation"] } }];
+ expect(sceneGenerationRequest(job, config, "D:/Project", 8).prompt).toContain("Claymation");
+});
+
it("keeps Long Shot neighbors within their Video but permits explicit continuation across Videos", () => {
const config = project(); config.generationJobs = ["a", "other", "b", "c"].map((id) => ({ ...scene(id), sceneType: "long-shot" as const, latentRelativePath: `latents/${id}.safetensors` }));
config.videos = [{ ...newVideo(null), sceneIds: ["a", "b", "c"] }, { ...newVideo(null), sceneIds: ["other"] }];
diff --git a/src/lib/videoLibrary.ts b/src/lib/videoLibrary.ts
index d9692e7..264ac39 100644
--- a/src/lib/videoLibrary.ts
+++ b/src/lib/videoLibrary.ts
@@ -17,6 +17,16 @@ export function videoScenes(video: ProjectVideo, config: ProjectConfig): Generat
export function newVideo(folderId: string | null): ProjectVideo {
return { id: `video-${crypto.randomUUID()}`, title: "New video", folderId, sceneIds: [], prompt: "", createdAt: new Date().toISOString() };
}
+/** Missing overrides stay linked to project settings, including older Videos. */
+export function videoSettings(video: ProjectVideo | undefined, config: ProjectConfig): ProjectConfig["settings"] {
+ return { ...config.settings,
+ defaultLook: video?.defaultLook ?? config.settings.defaultLook,
+ aspectRatio: video?.aspectRatio ?? config.settings.aspectRatio,
+ resolution: video?.resolution ?? config.settings.resolution };
+}
+export function sceneVideoSettings(job: GenerationJob, config: ProjectConfig): ProjectConfig["settings"] {
+ return videoSettings(videoLibrary(config).find((video) => video.sceneIds.includes(job.id)), config);
+}
export function resolveVideoSource(source: VideoSource | null | undefined, config: ProjectConfig, kind: "audio" | "video") {
if (!source) return undefined;
if (source.kind === "asset") {
diff --git a/src/lib/videoPlayback.ts b/src/lib/videoPlayback.ts
index 2fbd5db..518f09b 100644
--- a/src/lib/videoPlayback.ts
+++ b/src/lib/videoPlayback.ts
@@ -1,7 +1,7 @@
import { generationAssetId, sceneDurationSeconds, type ProjectConfig, type ProjectVideo, type TimelineClip } from "./project";
import { scenePreviewAsset, scenePreviewJob } from "./sceneHistory";
import { continuationPlaybackTracks, sceneMediaDurationMs } from "./continuationMedia";
-import { videoScenes } from "./videoLibrary";
+import { videoScenes, videoSettings } from "./videoLibrary";
/** A temporary timeline for the Video library. Never edits the project's timeline. */
export function videoPlaybackConfig(video: ProjectVideo, config: ProjectConfig): ProjectConfig {
@@ -23,7 +23,7 @@ export function videoPlaybackConfig(video: ProjectVideo, config: ProjectConfig):
startMs += durationMs;
}
const memberIds = new Set(video.sceneIds);
- return { ...config, assets: [...assets.values()],
+ return { ...config, settings: videoSettings(video, config), assets: [...assets.values()],
generationJobs: config.generationJobs.map((scene) => memberIds.has(scene.id) ? scenePreviewJob(scene, config.assets) : scene),
timeline: { tracks: [{ id: "video-preview", kind: "video", name: video.title, locked: false, muted: false, clips }] } };
}