AI media harness for planning, generating, and editing locally
TypeScript
Match Single Shot overlap joining
Bittie345d9b8e634
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex 7a30b7f..7032321 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -4,7 +4,7 @@ Changes since 0.3.2.## What's new-- **Single Shot continuity.** Updated SlopFab keeps Keystone and Capstone context inside sampling, restores the original beginning before output, and avoids replacing generated end frames or adding hidden tail frames.+- **Single Shot continuity.** With Context video, use the Clown Context overlap recipe: hold the first 22 frames of Previous video's 39-frame tail, regenerate the final 17, and replace the overlap in joined video and audio. Keystone and Capstone remain sampling context; original source files stay intact. Requires updated workers.- **LoRA controls.** Enable MiniMax H3 LoRAs globally, drag the library to set application order, and add scene overrides in Generation. Global adapters remain active and appear read only in scenes. Step counts and sampling recipes follow the effective stack, with conflicting recipes blocked.diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.mdindex 1f1ea24..64fb203 100644--- a/docs/slopfab-compatibility.md+++ b/docs/slopfab-compatibility.md@@ -1,19 +1,21 @@# Slopfab compatibility-## Bundled runtime (API 1.46.0)+## Bundled runtime (API 1.47.0)-Windows and Linux runtimes use SlopFab commit `2beebd6be5e0c69411e7670e53a789cab9109b6c`+Windows and Linux runtimes use SlopFab commit `65898fd02797e148c86c10384cf341eca6aa8c7f`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. Saved joined output preserves the previous clip.+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.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 25 so workers also support still-image previews. Single Shot automatically shortens its preferred four-update+LAN protocol is 26 so workers use the same overlap replacement 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.@@ -26,8 +28,15 @@ workaround documented below.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; native joining handles the overlap-without extra tail trimming. Both sources must have matching latent geometry.+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.+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.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'sdiff --git a/lib/slopfab/libslopfab.so b/lib/slopfab/libslopfab.soindex 80b15e5..c0cd818 100644--- a/lib/slopfab/libslopfab.so+++ b/lib/slopfab/libslopfab.so@@ -1,3 +1,3 @@version https://git-lfs.github.com/spec/v1-oid sha256:4b5ce49ad603b6867f52f819def6d8282adbeb40a38314785d7bbdb3483b32c3-size 23539272+oid sha256:0daf39cc557c8876c3e0f7c9669de909a9cd42724f66fb2e940a0a123bb104b0+size 23543504diff --git a/lib/slopfab/slopfab.dll b/lib/slopfab/slopfab.dllindex f7cd859..e076ffa 100644--- a/lib/slopfab/slopfab.dll+++ b/lib/slopfab/slopfab.dll@@ -1,3 +1,3 @@version https://git-lfs.github.com/spec/v1-oid sha256:5d3897316ff119acfcf1e93d58ebcc2728b9d7f12fa6cac26197744ed27b6d5b-size 20016640+oid sha256:0cde2ce5a1d4ae81fb4e08f125256a18a589a7c73723a7650aab6ae9825309a9+size 20018176diff --git a/src-tauri/core/src/slopfab/continuation.rs b/src-tauri/core/src/slopfab/continuation.rsindex 126f390..0be3e92 100644--- a/src-tauri/core/src/slopfab/continuation.rs+++ b/src-tauri/core/src/slopfab/continuation.rs@@ -329,6 +329,12 @@ 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"));+ 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"));+ request.continuation_source_frames = Some(124);assert_eq!(std::fs::read(&source).unwrap(), source_bytes);assert_eq!(std::fs::read(&context).unwrap(), context_bytes);for steps in [2, 3, 4, 5, 6, 9] {@@ -375,6 +381,7 @@ 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"));}}}diff --git a/src-tauri/core/src/slopfab/ffi/mod.rs b/src-tauri/core/src/slopfab/ffi/mod.rsindex 53bd63c..603092a 100644--- a/src-tauri/core/src/slopfab/ffi/mod.rs+++ b/src-tauri/core/src/slopfab/ffi/mod.rs@@ -208,6 +208,10 @@ impl Api {self.check(r)?;self.inner.set_continuation_lock_overlap(r.pointer.as_ptr(), enabled)}+ pub fn set_continuation_regenerate_frames(&self, r: &RequestHandle, frames: i32) -> Result<(), String> {+ self.check(r)?;+ self.inner.set_continuation_regenerate_frames(r.pointer.as_ptr(), frames)+ }pub fn set_seed(&self, r: &RequestHandle, v: u64) -> Result<(), String> {self.check(r)?;self.inner.set_seed(r.pointer.as_ptr(), v)diff --git a/src-tauri/core/src/slopfab/ffi/raw/mod.rs b/src-tauri/core/src/slopfab/ffi/raw/mod.rsindex aa9177c..9bfb3d3 100644--- a/src-tauri/core/src/slopfab/ffi/raw/mod.rs+++ b/src-tauri/core/src/slopfab/ffi/raw/mod.rs@@ -127,6 +127,7 @@ pub struct Api {set_continuation_source_init: Option<unsafe extern "C" fn(*mut Request, i32, f32) -> i32>,set_latent_bridge_files: Option<unsafe extern "C" fn(*mut Request, *const c_char, *const c_char, i32, i32, i32) -> i32>,set_continuation_lock_overlap: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,+ set_continuation_regenerate_frames: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,set_video_transition: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,set_steps: unsafe extern "C" fn(*mut Request, i32) -> i32,set_audio_steps: Option<unsafe extern "C" fn(*mut Request, i32) -> i32>,@@ -311,6 +312,9 @@ impl Api {set_continuation_lock_overlap: library.get::<unsafe extern "C" fn(*mut Request, i32) -> i32>(b"slopfab_request_set_continuation_lock_overlap\0").ok().map(|symbol| *symbol),+ set_continuation_regenerate_frames: library+ .get::<unsafe extern "C" fn(*mut Request, i32) -> i32>(b"slopfab_request_set_continuation_regenerate_frames\0")+ .ok().map(|symbol| *symbol),add_refmod: library.get::<unsafe extern "C" fn(*mut Request, *const c_char, f32, i32) -> i32>(b"slopfab_request_add_refmod\0",@@ -714,6 +718,10 @@ impl Api {};self.error(unsafe { set(r, i32::from(enabled)) })}+ pub fn set_continuation_regenerate_frames(&self, r: *mut Request, frames: i32) -> Result<(), String> {+ let set = self.set_continuation_regenerate_frames.ok_or("Single Shot overlap replacement requires SlopFab API 1.47 or newer. Update the app and workers.")?;+ self.error(unsafe { set(r, frames) })+ }#[cfg(test)]pub fn disable_lora_preparation_for_test(&mut self) {self.prepare_lora_grid = None;diff --git a/src-tauri/core/src/slopfab/h3.rs b/src-tauri/core/src/slopfab/h3.rsindex 173048c..ec3a204 100644--- a/src-tauri/core/src/slopfab/h3.rs+++ b/src-tauri/core/src/slopfab/h3.rs@@ -159,9 +159,14 @@ pub(super) fn configure_request(api.set_continuation_file(handle,opening.as_ref().map_or(path.as_path(), |file| file.as_ref()),- request.continuation_overlap_frames.unwrap_or(crate::models::H3_CAPABILITIES.continuation_overlap),+ if request.keystone_path.is_some() { 39 } 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)?;+ }}if let Some(path) = request.single_shot.as_ref().and_then(|single| single.ending_path.as_ref()) {api.set_end_anchor_file(handle, path)?;diff --git a/src-tauri/core/src/slopfab/planning.rs b/src-tauri/core/src/slopfab/planning.rsindex f65b2ab..59610a0 100644--- a/src-tauri/core/src/slopfab/planning.rs+++ b/src-tauri/core/src/slopfab/planning.rs@@ -82,10 +82,13 @@ 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.continuation_overlap_frames.is_some_and(|frames| frames != 22 && !(request.keystone_path.is_some() && frames == 39)) {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 3292ee5..a1809e0 100644--- a/src-tauri/core/src/worker/protocol.rs+++ b/src-tauri/core/src/worker/protocol.rs@@ -29,7 +29,8 @@ pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";// v23 carries Single Shot's persistent context archive; older workers ignore Keystone.// v24 adapts capstone locking to the resolved video schedule, including short LoRA grids.// v25 emits MiniMax still-image previews as well as video previews.-pub const PROTOCOL_VERSION: u32 = 25;+// v26 replaces Single Shot's 39-frame overlap, holding 22 and regenerating 17.+pub const PROTOCOL_VERSION: u32 = 26;/// Streaming SeedVR2 restoration; model paths are resolved on the worker.#[derive(Debug, Clone, Serialize, Deserialize)]@@ -384,7 +385,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, 25);+ assert_eq!(PROTOCOL_VERSION, 26);}#[test]diff --git a/src/lib/project.ts b/src/lib/project.tsindex 61faa91..ee3ffe3 100644--- a/src/lib/project.ts+++ b/src/lib/project.ts@@ -1139,7 +1139,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" ? 22 : job.continuationOverlapFrames ?? DEFAULT_CONTINUATION_OVERLAP,+ continuationOverlapFrames: job.sceneType === "single-shot" ? job.contextSceneId ? 39 : 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 0d0294a..9f1a1ec 100644--- a/src/lib/workQueue.test.ts+++ b/src/lib/workQueue.test.ts@@ -345,6 +345,8 @@ 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);if (context) {expect(requests[1].keystoneRelativePath).toBe(`latents/${ids[0]}.safetensors`);expect(requests[2].keystoneRelativePath).toBe(`latents/${ids[0]}.safetensors`);