AI media harness for planning, generating, and editing locally
TypeScript
Keep Single Shot middle initialized from fresh noise
Bitti9bdd6560b4c5
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex 844b10f..268d4ab 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -24,7 +24,7 @@ Changes since 0.3.2.- Video cards match Shot sizing, show the opening playback frame and open scenes on click; card/popout playback shares Timeline's prepared players and continuous display.- Editing generated music creates a separate draft; cards distinguish drafts from playable songs.-- Single Shot initializes both passes from the previous clip's final latents, with a Continuation control defaulting to 30% for appearance guidance.+- Single Shot uses previous latents only as its starting anchor, fresh noise for the middle and a generated ending anchor, avoiding repeated source imagery.- Updated First/Last Frame Fast to the eight-step FastH3 Omni model and corrected Omni and First/Last Frame weight fallbacks.- Image edits preserve source images, prompts and settings; queued results get separate entries, and whole-image edits disable feathering.- Imported images now expose steps, seed and resolution; new images use generator step defaults, and renamed image roots retain their names.diff --git a/docs/scene-types.md b/docs/scene-types.mdindex 696a31b..94e4175 100644--- a/docs/scene-types.md+++ b/docs/scene-types.md@@ -9,7 +9,7 @@ For a music video, select a complete song on an empty Video and choose **CreateThe Scene panel saves a type on each scene:- **Prompt** is the default for ordinary video scenes. It supports shot descriptions, speech, Look, sound, music and references cited in prompts, without start- or last-frame selectors. Stored frame anchors and continuation links are inactive.-- **Single Shot** keeps its main prompt in the Shot panel and an optional **Ending prompt** in the Scene panel, both with reference support. It generates an ending first, then anchors the full shot to it; a blank ending prompt uses the main prompt. **Starting video** accepts any generated scene. **Continuation** (0–99%, default 30%) initializes both passes from that scene's final latents. Higher values retain more appearance but may reduce motion; zero uses fresh noise for new frames. Use standard H3 sampling, matching resolution/upscale settings, at least two seconds, and updated workers. Generate all handles dependency order.+- **Single Shot** keeps its main prompt in the Shot panel and an optional **Ending prompt** in the Scene panel, both with reference support. It generates an ending first, then anchors the full shot to it; a blank ending prompt uses the main prompt. **Starting video** accepts any generated scene. Its final latents anchor only the beginning; the middle starts from fresh noise and is guided toward the generated ending. The former Continuation strength is ignored. Use matching resolution/upscale settings, at least two seconds, and updated workers. Generate all handles dependency order.- **First & Last Frame** adds optional start- and last-frame anchors to the same controls. Older scenes without a type retain this type when they have frame selections; otherwise they use Prompt. Switching types retains saved frame selections for later use.- **Backdrop** generates the described subject and action against a selected green, blue, black or white background (green by default). The compiled prompt requests a uniform color across all shots, with no scenery, floor, horizon, texture, gradients or backdrop shadows. Prompt references guide the subject; their original settings are replaced. Stored frame anchors and continuation links are inactive. Apply Chroma Key to the generated timeline clip and select the matching backdrop or Auto to remove it. Generation still produces ordinary video: transparency is applied by the effect. Choose a color absent from the subject and describe action that fits inside the frame.- **Continue** uses another scene's saved latents. Choose the source scene, beginning or end (default: end), and overlap in frames (default: 22; increments of 17 at 24 fps). Generate the source first, or use Generate All to render dependencies in order. Scene length controls the new segment. The saved video keeps Slopfab's full joined video and audio; adjacent source and continuation clips use that shared decode in preview and export, while trims remain relative to each scene. Regenerate older Continue scenes to preserve both sides of the decoded boundary. Old Previous scene selections become Continue scenes linked to their original source; reordering scenes keeps that link.diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.mdindex 72e0fc4..3fb114b 100644--- a/docs/slopfab-compatibility.md+++ b/docs/slopfab-compatibility.md@@ -5,7 +5,7 @@Windows and Linux runtimes use SlopFab commit `bcc1d26d92433475434447f34017550f9f823fe2`from `D:\Projects\slopfab`, with CUDA and Vulkan enabled and FFmpeg disabled.This update adds source-initialized continuation and music progress fixes.-Single Shot uses source initialization and latent ending anchors. LAN protocol is 20. Restart Slopus and+Single Shot uses latent boundary anchors and fresh middle noise. LAN protocol is 21. Restart Slopus andupdate workers to load the new runtime.The Linux runtime passes C API and embedded-tokenizer checks. Slopus core and desktop@@ -37,19 +37,16 @@ final duration; Single Shot requires at least two seconds.Only the final joined output and latents enter scene history. Timeline rangesidentify each scene's own portion, retaining the shared decode at joins.Temporary endings are removed on success, failure and cancellation. Starting-scenes must use compatible resolution and latent-upscale settings. Protocol 20-prevents older workers from silently skipping source initialization.--**Continuation** controls appearance retention for Single Shot's starting video,-from 0–99%, defaulting to 30%. Both passes call-`slopfab_request_set_continuation_source_init` with noise strength-`1 - continuationStrength` (0.7 by default). New video starts from the final-packed source latent slice mixed with noise; new audio keeps its full-noise-schedule. Zero uses fresh video noise while retaining boundary anchors. Higher-values can reduce motion; this experimental mode does not extrapolate motion or-guarantee seamless output. It needs standard H3 sampling, not fixed/distilled-schedules; approximate caches are disabled. Without a starting video, the value-is inactive. It persists in scene drafts/takes and generation fingerprints.+scenes must use compatible resolution and latent-upscale settings. Protocol 21+prevents older workers from restoring their source-initialization default.++Single Shot disables `slopfab_request_set_continuation_source_init` in both+passes: repeating the final source latent slice across the new interval can+freeze the middle. Only the starting and ending contexts are fixed; new video+and audio start from fresh noise. The former Continuation strength control is+removed. Saved values remain readable in drafts/takes but do not affect new+requests; native planning and execution also ignore queued source-noise values+for Single Shot. Old generation fingerprints differ, allowing regeneration.Checks cover prompt/reference compilation, persistence, dependency ordering,queue snapshots, cancellation, temporary cleanup and native anchored planning.diff --git a/src-tauri/core/src/slopfab/continuation.rs b/src-tauri/core/src/slopfab/continuation.rsindex e0fe078..c69ebc0 100644--- a/src-tauri/core/src/slopfab/continuation.rs+++ b/src-tauri/core/src/slopfab/continuation.rs@@ -36,8 +36,10 @@ pub(super) fn validate(request: &GenerationRequest) -> Result<(), String> {}pub(super) fn source_noise(request: &GenerationRequest) -> Option<f32> {- request.continuation_source_noise.or_else(||- (request.single_shot.is_some() && (request.continuation_path.is_some() || request.continuation_relative_path.is_some())).then_some(0.7))+ // Single Shot uses boundary anchors only. Applying the source prior across+ // the entire new interval can freeze/repeat the starting scene. Ignore old+ // queued source-noise values during planning as well as generation.+ if request.single_shot.is_some() { None } else { request.continuation_source_noise }}fn integer(meta: &Value, key: &str) -> Result<usize, String> {@@ -342,7 +344,7 @@ pub(super) mod tests {}#[test]- fn source_initialization_validates_and_resolves_with_both_backends() {+ fn single_shot_ignores_old_source_initialization_during_native_planning() {use super::super::{ffi::{Api, RequestHandle}, h3::configure_request, config::Configuration,platform::ComputePlatform, planning::RequestPurpose, types::SingleShotRequest};let source = archive(124).into_temp_path();@@ -356,10 +358,24 @@ pub(super) mod tests {continuation_source_noise: Some(noise), single_shot: Some(SingleShotRequest {ending_prompt: "Walk out of view".into(), ending_path: Some(ending.to_path_buf()) }), ..Default::default() };validate(&request).unwrap();+ assert_eq!(source_noise(&request), None);let handle = RequestHandle::new(&api).unwrap();configure_request(&api, &handle, &request, &Configuration::from_settings(&BTreeMap::new()), backend,RequestPurpose::Plan, &ReferenceVideos::default()).unwrap();- assert!(api.resolve(&handle).unwrap().aligned_frames > 124);+ let plan = api.resolve(&handle).unwrap();+ assert!(plan.aligned_frames > 124);+ let mut fresh = request.clone();+ fresh.continuation_source_noise = None;+ let baseline = RequestHandle::new(&api).unwrap();+ configure_request(&api, &baseline, &fresh, &Configuration::from_settings(&BTreeMap::new()), backend,+ RequestPurpose::Plan, &ReferenceVideos::default()).unwrap();+ let baseline_plan = api.resolve(&baseline).unwrap();+ assert_eq!(plan.aligned_frames, baseline_plan.aligned_frames);+ assert_eq!(plan.num_model_evaluations, baseline_plan.num_model_evaluations);+ // Other native continuation callers may still opt into the API.+ fresh.single_shot = None;+ fresh.continuation_source_noise = Some(noise);+ assert_eq!(source_noise(&fresh), Some(noise));}}for noise in [0.0, -0.1, 1.01, f32::NAN, f32::INFINITY] {diff --git a/src-tauri/core/src/slopfab/generation.rs b/src-tauri/core/src/slopfab/generation.rsindex 734d57f..9ad2a80 100644--- a/src-tauri/core/src/slopfab/generation.rs+++ b/src-tauri/core/src/slopfab/generation.rs@@ -54,7 +54,9 @@ fn run_single_shot(for index in 0..2 {if item.cancel.load(Ordering::Acquire) { return Err("Single Shot generation cancelled.".into()); }let mut request = item.request.clone();- request.continuation_source_noise = super::continuation::source_noise(&item.request);+ // Clear legacy source initialization before removing single_shot for+ // the ending pass. Both passes use fresh noise between fixed anchors.+ request.continuation_source_noise = None;if index == 0 {request.single_shot = None;request.prompt = single.ending_prompt.clone();diff --git a/src-tauri/core/src/slopfab/generation_tests.rs b/src-tauri/core/src/slopfab/generation_tests.rsindex 4cba3c1..56ba29f 100644--- a/src-tauri/core/src/slopfab/generation_tests.rs+++ b/src-tauri/core/src/slopfab/generation_tests.rs@@ -109,7 +109,7 @@ fn single_shot_generates_ending_first_then_attaches_it_with_the_starting_source(let mut temporary_paths = Vec::new();let (metadata, _) = run_single_shot(&item, |stage| {calls += 1;- assert_eq!(stage.request.continuation_source_noise, if continued { Some(noise.unwrap_or(0.7)) } else { None });+ assert_eq!(stage.request.continuation_source_noise, None);assert_eq!(stage.request.reference_paths, item.request.reference_paths);assert_eq!(stage.request.seed, item.request.seed);if calls == 1 {diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rsindex 414d44d..6c9e5fc 100644--- a/src-tauri/core/src/worker/protocol.rs+++ b/src-tauri/core/src/worker/protocol.rs@@ -25,7 +25,8 @@ pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";// v4 added SeedVR2 export streams. v3 added inverted image masks.// v19 carries Single Shot ending-first generation; older workers would ignore it.// v20 carries source-initialized continuation; older workers would ignore it.-pub const PROTOCOL_VERSION: u32 = 20;+// v21 keeps Single Shot's middle fresh; v20 workers default to a repeated source prior.+pub const PROTOCOL_VERSION: u32 = 21;/// Streaming SeedVR2 restoration; model paths are resolved on the worker.#[derive(Debug, Clone, Serialize, Deserialize)]@@ -345,7 +346,7 @@ mod tests {let single = restored.single_shot.unwrap();assert_eq!(single.ending_prompt, "The subject waves goodbye");assert!(single.ending_path.is_none());- assert_eq!(PROTOCOL_VERSION, 20);+ assert_eq!(PROTOCOL_VERSION, 21);}#[test]diff --git a/src/components/workspace/GeneratorView.test.tsx b/src/components/workspace/GeneratorView.test.tsxindex 3303a2f..c8ee9b3 100644--- a/src/components/workspace/GeneratorView.test.tsx+++ b/src/components/workspace/GeneratorView.test.tsx@@ -118,7 +118,7 @@ it("keeps Single Shot prompts in the shot panel and the ending prompt and startiinitial.generationJobs.push(createDraftGenerationJob("A regular scene", { id: "ordinary", title: "Ordinary" }));const state = setup(initial);choose("Scene type", "Single Shot");- expect(screen.getByRole("spinbutton", { name: "Continuation" })).toBeDisabled();+ expect(screen.queryByRole("spinbutton", { name: "Continuation" })).not.toBeInTheDocument();expect(screen.queryByLabelText("Describe shot 1")).not.toBeInTheDocument();const ending = screen.getByLabelText("Ending prompt");typePrompt(ending, "Wave goodbye.");@@ -132,10 +132,8 @@ it("keeps Single Shot prompts in the shot panel and the ending prompt and startiexpect(optionNames(source)).toEqual(["None", "Second scene", "Ordinary"]);chooseOption(source, "Second scene");expect(state.latest().generationJobs[0].continuationSceneId).toBe("scene-second");- const continuation = screen.getByRole("spinbutton", { name: "Continuation" });- expect(continuation).toHaveValue(30);- fireEvent.change(continuation, { target: { value: "65" } }); fireEvent.blur(continuation);- expect(state.latest().generationJobs[0].continuationStrength).toBe(0.65);+ expect(screen.queryByRole("spinbutton", { name: "Continuation" })).not.toBeInTheDocument();+ expect(screen.getByText(/middle starts from fresh noise/)).toBeInTheDocument();fireEvent.click(screen.getByRole("button", { name: "Shot 1 of First scene" }));expect(screen.queryByRole("spinbutton", { name: "Continuation" })).not.toBeInTheDocument();expect(screen.queryByLabelText("Ending prompt")).not.toBeInTheDocument();diff --git a/src/components/workspace/SceneEditor.tsx b/src/components/workspace/SceneEditor.tsxindex 74a6d19..5cf397f 100644--- a/src/components/workspace/SceneEditor.tsx+++ b/src/components/workspace/SceneEditor.tsx@@ -378,10 +378,7 @@ export function SceneInspector({ job, shots, references, folderPath = "", scenes...scenes.filter((scene) => scene.id !== job.id).map((scene) => ({ value: scene.id, label: scene.title }))]}onChange={(value) => onChange({ continuationSceneId: value || null })} /></PropRow>- <PropRow label="Continuation" tooltip="Choose a starting video to guide new frames from its appearance. Higher values retain more of the source but may reduce motion. Zero starts new frames from fresh noise.">- <SliderNumberInput aria-label="Continuation" minimum={0} maximum={99} step={1} suffix="%" value={Math.round((job.continuationStrength ?? 0.3) * 100)} disabled={disabled || !job.continuationSceneId}- onCommit={(value) => onChange({ continuationStrength: value / 100 })} />- </PropRow>+ {job.continuationSceneId && <p className="prop-caption">The previous video's ending anchors the start. The middle starts from fresh noise and progresses toward the ending prompt.</p>}<SingleShotEndingPrompt job={job} references={references} folderPath={folderPath} disabled={disabled} onChange={onChange} /></>}{longShot && <>diff --git a/src/lib/project.singleShot.test.ts b/src/lib/project.singleShot.test.tsindex bbd2bb6..4ee6cf2 100644--- a/src/lib/project.singleShot.test.ts+++ b/src/lib/project.singleShot.test.ts@@ -6,21 +6,27 @@ import { duplicateScene, sceneInput } from "./sceneHistory";const project = () => createProjectConfig({ name: "Single", prompt: "A dancer walks", resolution: "416p", aspectRatio: "16:9", targetDurationSeconds: 10 });const shot = (id: string): GenerationJob => createDraftGenerationJob("A dancer walks", { id, sceneType: "single-shot", durationSeconds: 6 });-it("maps Single Shot Continuation to source noise, persists it in takes and invalidates snapshots", () => {+it("uses fresh middle noise with locked start/end anchors and ignores legacy Continuation values", () => {const config = project(), source = { ...shot("source"), latentRelativePath: "latents/source.safetensors" };const job = { ...shot("next"), continuationSceneId: source.id }; config.generationJobs = [source, job];const request = sceneGenerationRequest(job, config, "D:/Project", 8);- expect(request.continuationSourceNoise).toBe(0.7);+ expect(request.continuationSourceNoise).toBeUndefined();+ expect(request.continuationRelativePath).toBe("latents/source.safetensors");+ expect(request.continuationLockOverlap).toBe(true);+ expect(request.continuationOverlapFrames).toBe(22);+ expect(request.singleShot?.endingPrompt).toBeTruthy();const changed = { ...job, continuationStrength: 0.65 };const changedRequest = sceneGenerationRequest(changed, config, "D:/Project", 8);- expect(changedRequest.continuationSourceNoise).toBe(0.35);- expect(sceneGenerationSnapshot(changed, changedRequest)).not.toBe(sceneGenerationSnapshot(job, request));+ expect(changedRequest.continuationSourceNoise).toBeUndefined();+ expect(sceneGenerationSnapshot(changed, changedRequest)).toBe(sceneGenerationSnapshot(job, request));+ expect(sceneGenerationSnapshot(changed, changedRequest)).not.toBe(sceneGenerationSnapshot(changed, { ...changedRequest, continuationSourceNoise: 0.35 }));expect(sceneInput(changed).continuationStrength).toBe(0.65);config.generationJobs[1] = changed;expect(parseProjectConfig(JSON.parse(JSON.stringify(config))).generationJobs[1].continuationStrength).toBe(0.65);expect(duplicateScene(config, changed.id)?.config.generationJobs.at(-1)?.continuationStrength).toBe(0.65);- expect(sceneGenerationRequest({ ...job, continuationStrength: 0 }, config, "D:/Project", 8).continuationSourceNoise).toBe(1);- expect(sceneGenerationRequest({ ...job, continuationStrength: 0.99 }, config, "D:/Project", 8).continuationSourceNoise).toBe(0.01);+ for (const continuationStrength of [0, 0.3, 0.65, 0.99]) {+ expect(sceneGenerationRequest({ ...job, continuationStrength }, config, "D:/Project", 8).continuationSourceNoise).toBeUndefined();+ }expect(sceneGenerationRequest({ ...changed, continuationSceneId: null }, config, "D:/Project", 8).continuationSourceNoise).toBeUndefined();expect(sceneGenerationRequest({ ...changed, sceneType: "continue" }, config, "D:/Project", 8).continuationSourceNoise).toBeUndefined();config.generationJobs[1] = { ...job, continuationStrength: 1 };diff --git a/src/lib/project.ts b/src/lib/project.tsindex 00c2c2e..0d15091 100644--- a/src/lib/project.ts+++ b/src/lib/project.ts@@ -556,6 +556,7 @@ const generationJobBaseSchema = z.object({id: idSchema,sceneType: sceneTypeSchema.nullish(),endingPrompt: z.string().max(30000).nullish(),+ // Retained only to read older drafts/takes; Single Shot now uses fresh middle noise.continuationStrength: z.number().finite().min(0).max(0.99).nullish(),backdropColor: z.enum(["green", "blue", "black", "white"]).nullish(),bridgeLeftMargin: z.number().int().min(0).max(340).multipleOf(17).nullish(),@@ -1124,7 +1125,6 @@ export function sceneFrameInputs(job: GenerationJob, config: ProjectConfig) {continuationOverlapFrames: job.sceneType === "single-shot" ? 22 : job.continuationOverlapFrames ?? DEFAULT_CONTINUATION_OVERLAP,continuationFrom: job.sceneType === "single-shot" ? "end" as const : job.continuationFrom ?? "end",continuationLockOverlap: job.sceneType === "single-shot" || (job.continuationLockOverlap ?? false),- continuationSourceNoise: job.sceneType === "single-shot" ? Number((1 - (job.continuationStrength ?? 0.3)).toFixed(4)) : undefined,continuationSourceFrames: previous ? sceneOutputFrames(previous, config) : undefined };}diff --git a/src/lib/sceneGeneration.ts b/src/lib/sceneGeneration.tsindex 80c3f80..91af476 100644--- a/src/lib/sceneGeneration.ts+++ b/src/lib/sceneGeneration.ts@@ -39,7 +39,6 @@ export function sceneGenerationRequest(job: GenerationJob, config: ProjectConfig...(inputs.continuationRelativePath ? { continuationRelativePath: inputs.continuationRelativePath } : {}),...(inputs.previousSceneId ? { continuationOverlapFrames: inputs.continuationOverlapFrames,continuationLockOverlap: inputs.continuationLockOverlap,- ...(inputs.continuationSourceNoise != null ? { continuationSourceNoise: inputs.continuationSourceNoise } : {}),continuationFrom: inputs.continuationFrom, continuationSourceFrames: inputs.continuationSourceFrames } : {}),// The scene's own length, not a fixed six seconds.frames: Math.round(sceneDurationSeconds(job) * GENERATION_FRAME_RATE),