AI media harness for planning, generating, and editing locally
TypeScript
Match Single Shot to anchored test
Bitti141ae1031be9
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex f81c59a..b49bbd3 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -21,6 +21,7 @@ Changes since 0.3.2.## Fixes and improvements+- Single Shot with Context video now matches the two-minute Keystone/Capstone test's fully locked 22-frame overlap, preserving earlier video and audio instead of regenerating their tail. Update LAN workers alongside the app.- Corrected Motion thumbnail sizing and title/duration alignment in the Timeline's list and grid layouts.- Send additional agent messages while it is working; queued messages join its context when the current call or generation finishes.- Limited generation progress updates to keep music playback controls responsive during song generation.diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.mdindex e2b5440..51555f1 100644--- a/docs/slopfab-compatibility.md+++ b/docs/slopfab-compatibility.md@@ -7,15 +7,15 @@ from `D:\Projects\slopfab`, with CUDA and Vulkan enabled and FFmpeg disabled.This update keeps Keystone and delayed Capstone context inside sampling: theoriginal front latent is restored before output, and Capstone adds one cleanvideo latent only during model calls. It does not replace generated end frames-or add hidden tail frames. Single Shot with Context video now replaces a-39-frame overlap: it holds the earlier 22 frames, regenerates the trailing 17,-and splices the complete sampled window into the joined video and audio.+or add hidden tail frames. Single Shot with Context video uses the two-minute+anchored experiment's fully locked 22-frame overlap. The complete previous+video/audio archive is retained; no previously generated tail is replaced.TAEH3 now also decodes single-frame MiniMax image previews on CUDA and Vulkan.Video previews autoplay and loop inside the existing shot card player; imagepreviews update the image canvas and thumbnail. Both use the generation previewssetting and require the optional TAEH3 weights. Saved-latent upscaling remains supported.-LAN protocol is 30 so workers support portable LCS Drift calibration and use the same Keystone conditioning, image crop+LAN protocol is 31 so workers use the same fully locked overlap, portable LCS Drift calibration, Keystone conditioning, image cropmerging, Single Shot Tone and overlap behavior. Single Shot automatically shortens its preferred four-updateCapstone delay when the resolved video schedule is shorter, without changing theLoRA recipe. Restart Slopus and update workers to load the new runtime.@@ -46,15 +46,54 @@ and retained/file parity; they are not a visual quality benchmark.With Context video selected, Single Shot continues from Previous video's savedlatents while using the sequence's first video as its persistent Keystone and-Capstone source. It runs one generation pass. The last 39 frames of Previous-video form the overlap; the first 22 remain locked and the last 17 are generated-again. Native joining replaces that overlap in both video and audio, preserving-the source archive and restoring the real front latent after Keystone sampling.-The released tail is also excluded from the continuation guide. Previous video-must contain at least 39 frames and both sources need matching latent geometry.+Capstone source. It runs one generation pass. The last 22 frames of Previous+video form the overlap and all remain locked. Native joining discards the+sampled overlap and appends only newly generated frames, preserving the complete+previous video/audio prefix and restoring the real front latent after Keystone+sampling. Previous video must contain at least 22 frames and both sources need+matching latent geometry.Scene duration continues to mean newly added timeline frames; the sampling window-includes the 39-frame overlap. Cumulative audio boundaries avoid rounding drift.-This change does not select ER-SDE, beta scheduling or the example's LoRAs.+includes the 22-frame overlap. Cumulative audio boundaries avoid rounding drift.++### Two-minute experiment audit++Compared against SlopFab commit `94fcedc`, `docs/lcs_drift_4way.md`,+`tools/lcs_long_run.py`, and the recorded+`output/lcs-drift-120s-anchors/manifest.json` / `validation.json` in+`D:/Projects/slopfab`. The successful anchors-only arm starts from 73 frames,+adds 42 extensions of 68 frames, and exports the first 2,880 frames of the+2,929-frame joined archive at 24 fps.++The prior Slopus integration used SlopFab's separate Long Context recipe:+39-frame overlap, 22 held frames and 17 regenerated frames. That was **not** the+recipe used in this experiment. New context-video requests instead attach the+previous archive with overlap 22, explicitly lock video/audio, set regenerated+frames to zero, and attach the unchanged original archive with Capstone enabled.+No ending-first pass, repeated-source middle initialization or MotionCache is+used. Updated fingerprints distinguish these requests from existing takes;+existing saved media is not rewritten. Protocol 31 rejects older workers that+would override this overlap with the former recipe.++The experiment used Singularity Ref2VA v1.3 INT8, the original cached prompt+embedding, 384x384, CUDA, Flash2, 25 Euler grid points (24 updates), no LoRA or+LCS in its anchors-only arm, and seeds 424243–424284. Those remain generator /+scene choices in Slopus, not forced Single Shot defaults. Capstone uses four+video updates of delay when the schedule permits; the existing short-schedule+compatibility path reduces it when there are fewer than five video updates.+Such short schedules do not reproduce the experiment's delay.++The bundled runtime's anchoring implementation is unchanged between its pinned+commit and the experiment; the intervening production changes add optional LCS+output stability controls, which the anchors-only arm does not use. No runtime+binary replacement is needed for this correction.++The regression check independently constructs the experiment's native request+and compares its complete plan description with Slopus planning and execution+configuration on CUDA and Vulkan, at the first, second and 42nd handoffs. It+checks 22-frame locking, delay four, 24 evaluations, no overlap replacement,+unchanged source files, and the 2,929-frame endpoint. Small spatial fixtures+keep this check independent of model weights; it verifies request parity, not+a repeated two-minute visual quality benchmark.Without Context video, Single Shot has one reference-aware prompt, an optionalending prompt and an optional previous scene of any type with saved video latents. Its full clip's@@ -145,7 +184,7 @@ buffers. Corrupt archives are regenerated. Planning never calibrates orruns inference. The generation request snapshots the archive before sampling;region masks use fractional coverage of the resolved latent patch grid.-LAN worker protocol 30 carries the portable controls and fitted drift archive and prevents older+LAN worker protocol 31 carries the portable controls and fitted drift archive and prevents olderworkers from silently dropping them. Each worker calibrates and caches itsown VAE. Update workers alongside the desktop app. A runtime missing the LCSexports reports an explicit upgrade error.diff --git a/src-tauri/core/src/slopfab/continuation.rs b/src-tauri/core/src/slopfab/continuation.rsindex 0be3e92..96c8005 100644--- a/src-tauri/core/src/slopfab/continuation.rs+++ b/src-tauri/core/src/slopfab/continuation.rs@@ -311,6 +311,69 @@ pub(super) mod tests {assert_eq!(wire["latentBridge"]["rightMarginFrames"], 34);}+ #[test]+ fn single_shot_matches_two_minute_anchored_request() {+ use super::super::{ffi::{Api, RequestHandle}, h3::configure_request, config::Configuration,+ platform::ComputePlatform, planning::RequestPurpose, types::SingleShotRequest};+ use crate::settings::{ProviderOption, ProviderSetting};+ // SlopFab docs/lcs_drift_4way.md and tools/lcs_long_run.py:+ // 73 original frames, 42 x 68 new frames, 25 grid points, delay 4,+ // fixed original anchors, overlap 22, and no regenerated overlap.+ // Small spatial fixtures exercise the bundled DLL without GPU weights.+ let original = archive(73).into_temp_path();+ let original_bytes = std::fs::read(&original).unwrap();+ let settings = BTreeMap::from([("slopfab".into(), ProviderSetting { enabled: true, model: None,+ options: BTreeMap::from([+ ("attention".into(), ProviderOption::String("flash2".into())),+ ("motionCache".into(), ProviderOption::Boolean(true)),+ ]) })]);+ let configuration = Configuration::from_settings(&settings);+ let api = Api::load(&configuration.dll_path).unwrap();+ for index in [0, 1, 41] {+ let source_frames = 73 + index * 68;+ let previous = archive(source_frames).into_temp_path();+ let previous_bytes = std::fs::read(&previous).unwrap();+ let request = GenerationRequest {+ prompt: "The same subject continues moving".into(), frames: 68, steps: 25, seed: 424243 + index as i64,+ canvas_width: 64, canvas_height: 32,+ single_shot: Some(SingleShotRequest { ending_prompt: String::new(), ending_path: None }),+ continuation_path: Some(previous.to_path_buf()), continuation_overlap_frames: Some(22),+ continuation_source_frames: Some(source_frames as i32), continuation_from: Some("end".into()),+ // Single Shot must enforce locking even for a stale false flag.+ continuation_lock_overlap: false, keystone_path: Some(original.to_path_buf()), ..Default::default()+ };+ for platform in [ComputePlatform::Cuda13, ComputePlatform::Vulkan] {+ // Construct the experiment's request independently of Slopus's recipe.+ let experiment = RequestHandle::new(&api).unwrap();+ api.set_prompt(&experiment, &request.prompt).unwrap();+ api.set_frames(&experiment, 68).unwrap();+ api.set_steps(&experiment, 25).unwrap();+ api.set_seed(&experiment, request.seed as u64).unwrap();+ api.set_resolution(&experiment, 64, 32).unwrap();+ api.set_attention(&experiment, "flash2").unwrap();+ api.set_inference_backend(&experiment, platform.backend()).unwrap();+ api.set_continuation_file(&experiment, &previous, 22).unwrap();+ api.set_continuation_lock_overlap(&experiment, true).unwrap();+ api.set_keystone_file(&experiment, &original, 4).unwrap();+ let expected = api.describe(&experiment).unwrap();+ assert!(expected.contains("90 frames (22 hidden overlap)"));+ assert!(expected.contains("locked video and audio"));+ assert!(expected.contains("capstone locks after 4 video updates"));+ assert!(!expected.contains("overlap replacement"));+ for purpose in [RequestPurpose::Plan, RequestPurpose::Generate] {+ let actual = RequestHandle::new(&api).unwrap();+ configure_request(&api, &actual, &request, &configuration, platform, purpose, &ReferenceVideos::default()).unwrap();+ assert_eq!(api.describe(&actual).unwrap(), expected);+ let plan = api.resolve(&actual).unwrap();+ assert_eq!(plan.aligned_frames, source_frames as i32 + 68);+ assert_eq!(plan.num_model_evaluations, 24);+ }+ }+ assert_eq!(std::fs::read(&previous).unwrap(), previous_bytes);+ }+ assert_eq!(std::fs::read(&original).unwrap(), original_bytes);+ }+#[test]fn single_shot_keystone_adapts_lock_delay_to_short_video_schedules() {use super::super::types::SingleShotRequest;@@ -329,11 +392,15 @@ pub(super) mod tests {assert_eq!(plan.aligned_frames, 175);assert_eq!(plan.model_evaluations, 8);assert!(plan.description.contains("one call-only video latent; front restored before output"));- assert!(plan.description.contains("39 frames; hold 22, regenerate 17"));+ assert!(plan.description.contains("22 hidden overlap"));+ assert!(!plan.description.contains("overlap replacement"));request.continuation_overlap_frames = Some(39);- assert_eq!(resolve_plan(&request, &settings, &ReferenceVideos::default()).unwrap().aligned_frames, 175);- request.continuation_source_frames = Some(34);- assert!(resolve_plan(&request, &settings, &ReferenceVideos::default()).unwrap_err().contains("at least 39"));+ assert!(resolve_plan(&request, &settings, &ReferenceVideos::default()).is_err());+ request.continuation_overlap_frames = Some(22);+ request.continuation_source_frames = Some(21);+ assert!(resolve_plan(&request, &settings, &ReferenceVideos::default()).unwrap_err().contains("shorter than the continuation overlap"));+ request.continuation_source_frames = Some(22);+ assert!(resolve_plan(&request, &settings, &ReferenceVideos::default()).is_ok());request.continuation_source_frames = Some(124);assert_eq!(std::fs::read(&source).unwrap(), source_bytes);assert_eq!(std::fs::read(&context).unwrap(), context_bytes);@@ -381,7 +448,8 @@ pub(super) mod tests {let description = api.describe(&handle).unwrap();assert!(description.contains(&format!("capstone locks after {delay} video updates")));assert!(description.contains(&format!("modality updates video {updates}")));- assert!(description.contains("39 frames; hold 22, regenerate 17"));+ assert!(description.contains("22 hidden overlap"));+ assert!(!description.contains("overlap replacement"));}}}diff --git a/src-tauri/core/src/slopfab/h3.rs b/src-tauri/core/src/slopfab/h3.rsindex 00cb897..7abbcc0 100644--- a/src-tauri/core/src/slopfab/h3.rs+++ b/src-tauri/core/src/slopfab/h3.rs@@ -159,7 +159,7 @@ pub(super) fn configure_request(api.set_latent_upscaler(handle, upscaler)?;api.set_inference_backend(handle, platform.backend())?;api.set_attention(handle, configuration.attention)?;- let lock_overlap = request.continuation_path.is_some() && request.continuation_lock_overlap;+ let lock_overlap = request.continuation_path.is_some() && (request.single_shot.is_some() || request.continuation_lock_overlap);let independent_audio = request.audio_steps.is_some_and(|steps| steps != video_steps);// Overlap locking and different audio/video step counts require full evaluations.api.set_motion_cache(handle, configuration.motion_cache && preset.is_none() && request.image_edit.is_none() && !lock_overlap && !independent_audio && request.latent_bridge.is_none() && request.single_shot.is_none() && source_noise.is_none())?;@@ -178,13 +178,14 @@ pub(super) fn configure_request(api.set_continuation_file(handle,opening.as_ref().map_or(path.as_path(), |file| file.as_ref()),- if request.keystone_path.is_some() { 39 } else { request.continuation_overlap_frames.unwrap_or(crate::models::H3_CAPABILITIES.continuation_overlap) },+ if request.single_shot.is_some() { 22 } else { request.continuation_overlap_frames.unwrap_or(crate::models::H3_CAPABILITIES.continuation_overlap) },)?;api.set_continuation_lock_overlap(handle, lock_overlap)?;if request.keystone_path.is_some() {- // Keep the first 22 frames of the previous 39-frame- // tail, regenerate its last 17, then replace the complete overlap.- api.set_continuation_regenerate_frames(handle, 17)?;+ // Match SlopFab's two-minute anchored test: lock all 22 context+ // frames and preserve the complete preceding video/audio archive.+ // The separate 39/17 Long Context recipe rewrites an approved tail.+ api.set_continuation_regenerate_frames(handle, 0)?;}}if let Some(path) = request.single_shot.as_ref().and_then(|single| single.ending_path.as_ref()) {diff --git a/src-tauri/core/src/slopfab/planning.rs b/src-tauri/core/src/slopfab/planning.rsindex 0ab5e21..20a2f5d 100644--- a/src-tauri/core/src/slopfab/planning.rs+++ b/src-tauri/core/src/slopfab/planning.rs@@ -83,13 +83,10 @@ pub(super) fn validate_generation_controls(request: &GenerationRequest) -> Resulif request.music.is_some() || request.still_image || request.image_edit.is_some() || request.video_transition.is_some() || request.latent_bridge.is_some()|| request.frames < 48 || (request.keystone_path.is_none() && single.ending_prompt.trim().is_empty()) || single.ending_prompt.contains('\0') || single.ending_prompt.len() > 1024 * 1024|| request.continuation_from.as_deref().is_some_and(|from| from != "end")- || request.continuation_overlap_frames.is_some_and(|frames| frames != 22 && !(request.keystone_path.is_some() && frames == 39)) {+ || request.continuation_overlap_frames.is_some_and(|frames| frames != 22) {return Err("Single Shot requires a video of at least 2 seconds, an ending prompt or Context video, and optional ending latents from a Previous video.".into());}}- if request.keystone_path.is_some() && request.continuation_source_frames.is_some_and(|frames| frames < 39) {- return Err("Previous video needs at least 39 frames for Single Shot with Context video.".into());- }if let Some(music) = &request.music { return music.validate(); }if let Some(scale) = request.guidance_scale { crate::models::validate_cfg_scale(f64::from(scale))?; }if let Some(effects) = &request.generation_effects { effects.validate()?; }diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rsindex 942805d..db386fe 100644--- a/src-tauri/core/src/worker/protocol.rs+++ b/src-tauri/core/src/worker/protocol.rs@@ -34,7 +34,8 @@ pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";// v28 bounds image-edit inference to the target region and preserves the original canvas.// v29 aligns Single Shot's Keystone conditioning guide with its original context anchor.// v30 carries portable learned-drift calibration and LCS highlight controls.-pub const PROTOCOL_VERSION: u32 = 30;+// v31 matches the two-minute anchored recipe: lock 22 frames without replacing the source tail.+pub const PROTOCOL_VERSION: u32 = 31;/// Streaming SeedVR2 restoration; model paths are resolved on the worker.#[derive(Debug, Clone, Serialize, Deserialize)]@@ -389,7 +390,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, 30);+ assert_eq!(PROTOCOL_VERSION, 31);}#[test]diff --git a/src/lib/project.singleShot.test.ts b/src/lib/project.singleShot.test.tsindex 433c796..e4c8fbe 100644--- a/src/lib/project.singleShot.test.ts+++ b/src/lib/project.singleShot.test.ts@@ -16,7 +16,11 @@ it("keeps the original context archive while continuation advances and persistsexpect(sendBlocker(next, [])).toBeNull();const request = sceneGenerationRequest(next, config, "C:/Project", 9);expect(request).toMatchObject({ contextSceneId: "original", keystoneRelativePath: original.latentRelativePath,- previousSceneId: "previous", continuationRelativePath: previous.latentRelativePath, singleShot: { endingPrompt: "" } });+ previousSceneId: "previous", continuationRelativePath: previous.latentRelativePath, singleShot: { endingPrompt: "" },+ continuationOverlapFrames: 22, continuationLockOverlap: true, continuationFrom: "end" });+ expect(sceneGenerationSnapshot(next, request)).not.toBe(sceneGenerationSnapshot(next, { ...request, continuationOverlapFrames: 39 }));+ expect(sceneGenerationRequest({ ...next, continuationOverlapFrames: 39, continuationLockOverlap: false }, config, "C:/Project", 9))+ .toMatchObject({ continuationOverlapFrames: 22, continuationLockOverlap: true });expect(JSON.parse(sceneGenerationSnapshot(next, request))).toMatchObject({ contextSceneId: "original", keystoneGuide: "context", capstoneLockAfter: "auto" });expect(sceneGenerationSnapshot({ ...next, endingPrompt: "Something else" }, request)).toBe(sceneGenerationSnapshot(next, request));expect(parseProjectConfig(JSON.parse(JSON.stringify(config))).generationJobs[0].contextSceneId).toBe("original");diff --git a/src/lib/project.ts b/src/lib/project.tsindex c7eaf09..ce2f860 100644--- a/src/lib/project.ts+++ b/src/lib/project.ts@@ -1140,7 +1140,7 @@ export function sceneFrameInputs(job: GenerationJob, config: ProjectConfig) {const resolved = { ...job, startFrameReferenceId: undefined, endFrameReferenceId: undefined };return { job: resolved, references: sceneGenerationReferences(resolved, config.references),previousSceneId: sourceId, continuationRelativePath: previous?.latentRelativePath ?? undefined,- continuationOverlapFrames: job.sceneType === "single-shot" ? job.contextSceneId ? 39 : 22 : job.continuationOverlapFrames ?? DEFAULT_CONTINUATION_OVERLAP,+ 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),continuationSourceFrames: previous ? sceneOutputFrames(previous, config) : undefined };diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.tsindex da44925..4a05351 100644--- a/src/lib/workQueue.test.ts+++ b/src/lib/workQueue.test.ts@@ -612,8 +612,10 @@ it.each([false, true])("chains Single Shots with persistent context %s while capexpect(requests[0].singleShot).toBeUndefined();expect(requests[1].continuationRelativePath).toBe(`latents/${ids[0]}.safetensors`);expect(requests[2].continuationRelativePath).toBe(`latents/${ids[1]}.safetensors`);- expect(requests[1].continuationOverlapFrames).toBe(context ? 39 : 22);- expect(requests[2].continuationOverlapFrames).toBe(context ? 39 : 22);+ expect(requests[1].continuationOverlapFrames).toBe(22);+ expect(requests[2].continuationOverlapFrames).toBe(22);+ expect(requests[1].continuationLockOverlap).toBe(true);+ expect(requests[2].continuationLockOverlap).toBe(true);if (context) {expect(requests[1].keystoneRelativePath).toBe(`latents/${ids[0]}.safetensors`);expect(requests[2].keystoneRelativePath).toBe(`latents/${ids[0]}.safetensors`);