AI media harness for planning, generating, and editing locally
TypeScript
Unify Tone across Single Shot ending and main clip
Bitti60e3c0a21463
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.mdindex 927ffcf..cf107b7 100644--- a/RELEASE_NOTES.md+++ b/RELEASE_NOTES.md@@ -34,6 +34,7 @@ Changes since 0.3.2.## Fixes and improvements+- Single Shot without Context video applies Tone once across the assembled main clip and ending, avoiding separate grading of its temporary ending. Retained Previous video frames are preserved. Requires updated workers.- Shot speech language keeps the existing choices and also accepts custom language names.- 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.diff --git a/docs/slopfab-compatibility.md b/docs/slopfab-compatibility.mdindex 64fb203..9efed86 100644--- a/docs/slopfab-compatibility.md+++ b/docs/slopfab-compatibility.md@@ -1,8 +1,8 @@# Slopfab compatibility-## Bundled runtime (API 1.47.0)+## Bundled runtime (API 1.48.0)-Windows and Linux runtimes use SlopFab commit `65898fd02797e148c86c10384cf341eca6aa8c7f`+Windows and Linux runtimes use SlopFab commit `fd264f6bc293d21e76cf26aaae3e70ed25f1e491`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 clean@@ -15,7 +15,7 @@ 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 26 so workers use the same overlap replacement behavior. Single Shot automatically shortens its preferred four-update+LAN protocol is 27 so workers use the same 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.@@ -64,6 +64,17 @@ Temporary endings are removed on success, failure and cancellation. Startingscenes must use compatible original latent resolutions. Protocol 24 also requiresworkers to support saved-latent upscale requests.+For ending-first Single Shot (without Context video), Tone is omitted from the+temporary ending. The full pass sends `tone_after_denoise` with its native LCS+settings: contrast, brightness, saturation and temperature are applied once to+the assembled new main clip and ending, before saving latents and decoding.+Previously retained source frames are excluded. Region masks apply to both+parts identically. Step limits affect the remaining sampling effects; they do+not limit this final Tone adjustment. Sampling previews omit the final Tone pass.+Context-video Single Shot and other generation types retain their existing+sampling effects. Existing takes require regeneration; this change does not+remove effects already baked into previous/context source archives.+Single Shot disables `slopfab_request_set_continuation_source_init` in bothpasses: repeating the final source latent slice across the new interval canfreeze the middle. Only the starting and ending contexts are fixed; new videodiff --git a/lib/slopfab/libslopfab.so b/lib/slopfab/libslopfab.soindex c0cd818..6f2e905 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:0daf39cc557c8876c3e0f7c9669de909a9cd42724f66fb2e940a0a123bb104b0-size 23543504+oid sha256:8da3df0c508e51127eccae15f66341a61915d6a2f22f8f1baeab0ba39a10d801+size 23898928diff --git a/lib/slopfab/slopfab.dll b/lib/slopfab/slopfab.dllindex e076ffa..e3ef8a1 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:0cde2ce5a1d4ae81fb4e08f125256a18a589a7c73723a7650aab6ae9825309a9-size 20018176+oid sha256:1582a9dc7093fc7ccb271f0cd8df2e15530ae67faaeb5e95cce42348635d7910+size 20310016diff --git a/src-tauri/core/src/slopfab/ffi/lcs_tests.rs b/src-tauri/core/src/slopfab/ffi/lcs_tests.rsindex 15820cd..678ce7e 100644--- a/src-tauri/core/src/slopfab/ffi/lcs_tests.rs+++ b/src-tauri/core/src/slopfab/ffi/lcs_tests.rs@@ -56,6 +56,27 @@ fn bundled_lcs_snapshots_settings_and_validates_masks() {assert!(other.set_lcs_mask(&request, &[]).unwrap_err().contains("different runtime"));}+#[test]+fn bundled_single_shot_output_tone_requires_ending_and_spatial_mask() {+ let api = bundled_api(); api.require_output_tone().unwrap();+ let request = RequestHandle::new(&api).unwrap();+ let folder = tempfile::tempdir().unwrap();+ let archive = folder.path().join("calibration.safetensors");+ calibration(&archive);+ api.set_resolution(&request, 64, 32).unwrap();+ api.set_frames(&request, 34).unwrap();+ api.set_lcs(&request, &archive, r#"{"contrast":0.9,"brightness":0.1,"saturation":0.95,"tone_after_denoise":true}"#).unwrap();+ assert!(api.resolve(&request).is_err());+ let ending = crate::slopfab::continuation::tests::archive(22).into_temp_path();+ api.set_end_anchor_file(&request, &ending).unwrap();+ let plan = api.resolve(&request).unwrap();+ let plane = (plan.latent_width / 2 * (plan.latent_height / 2)) as usize;+ api.set_lcs_mask(&request, &vec![0.5; plane]).unwrap();+ api.resolve(&request).unwrap();+ api.set_lcs_mask(&request, &vec![0.5; plane * 2]).unwrap();+ assert!(api.resolve(&request).is_err());+}+#[test]fn calibration_cancellation_and_callback_panics_preserve_existing_archive() {let api = bundled_api();diff --git a/src-tauri/core/src/slopfab/ffi/mod.rs b/src-tauri/core/src/slopfab/ffi/mod.rsindex 603092a..013c6c1 100644--- a/src-tauri/core/src/slopfab/ffi/mod.rs+++ b/src-tauri/core/src/slopfab/ffi/mod.rs@@ -30,6 +30,7 @@ impl Api {})}pub fn require_lcs(&self) -> Result<(), String> { self.inner.require_lcs() }+ pub fn require_output_tone(&self) -> Result<(), String> { self.inner.require_output_tone() }pub fn set_lcs(&self, r: &RequestHandle, path: &Path, settings: &str) -> Result<(), String> {self.check(r)?; self.inner.set_lcs(r.pointer.as_ptr(), path, settings)}diff --git a/src-tauri/core/src/slopfab/ffi/raw/lcs.rs b/src-tauri/core/src/slopfab/ffi/raw/lcs.rsindex 309dafb..fbdbf4f 100644--- a/src-tauri/core/src/slopfab/ffi/raw/lcs.rs+++ b/src-tauri/core/src/slopfab/ffi/raw/lcs.rs@@ -5,6 +5,12 @@ type SetMask = unsafe extern "C" fn(*mut Request, *const f32, usize) -> i32;const UPDATE: &str = "Generation effects require SlopFab API 1.31 or newer. Update the runtime on the machine running generation.";impl Api {+ pub fn require_output_tone(&self) -> Result<(), String> {+ if unsafe { (self.capi_version)() } < ((1 << 24) | (48 << 12)) {+ return Err("Consistent Single Shot Tone requires SlopFab API 1.48 or newer. Update the runtime on the machine running generation.".into());+ }+ Ok(())+ }pub fn require_lcs(&self) -> Result<(), String> {unsafe {self._library.get::<Calibrate>(b"slopfab_lcs_calibrate\0").map_err(|_| UPDATE)?;diff --git a/src-tauri/core/src/slopfab/generation.rs b/src-tauri/core/src/slopfab/generation.rsindex 23a728d..2bbe1f9 100644--- a/src-tauri/core/src/slopfab/generation.rs+++ b/src-tauri/core/src/slopfab/generation.rs@@ -28,7 +28,12 @@ pub(super) fn run_generation() -> Result<(OutputMetadata, rendered::RenderedVideo), String> {if item.request.latent_upscale_source.is_some() { return run_latent_upscale(item); }if item.request.single_shot.is_some() {- if item.request.keystone_path.is_none() { ffi::Api::load(&item.configuration.dll_path)?.require_end_anchor()?; }+ if item.request.keystone_path.is_none() {+ let api = ffi::Api::load(&item.configuration.dll_path)?;+ api.require_end_anchor()?;+ if item.request.generation_effects.as_ref().map(|e| e.native_settings()).transpose()?.flatten()+ .is_some_and(|settings| settings.get("contrast").is_some()) { api.require_output_tone()?; }+ }return run_single_shot(item, run_single_generation);}run_edit_sequence(item, run_single_generation)@@ -62,6 +67,9 @@ fn run_single_shot(// the ending pass. Both passes use fresh noise between fixed anchors.request.continuation_source_noise = None;if index == 0 {+ // The ending is conditioning for the full pass. Grade Tone only+ // once, after the main clip and this neutral ending are joined.+ if let Some(effects) = request.generation_effects.as_mut() { effects.tone = None; }request.single_shot = None;request.prompt = single.ending_prompt.clone();request.frames = 22;diff --git a/src-tauri/core/src/slopfab/generation_tests.rs b/src-tauri/core/src/slopfab/generation_tests.rsindex 22cf945..7a798c1 100644--- a/src-tauri/core/src/slopfab/generation_tests.rs+++ b/src-tauri/core/src/slopfab/generation_tests.rs@@ -156,6 +156,11 @@ fn single_shot_generates_ending_first_then_attaches_it_with_the_starting_source(for (continued, noise) in [(false, None), (true, None), (true, Some(0.35)), (true, Some(1.0))] {let (mut item, source) = single_shot_item();item.request.continuation_source_noise = noise;+ item.request.generation_effects = Some(serde_json::from_value(serde_json::json!({+ "tone": {"contrast":0.9,"brightness":0.1,"saturation":0.95,"temperature":0},+ "sharpness": {"strength":0.5}, "startStep":2,"endStep":4,+ "region":{"x":0,"y":0,"width":50,"height":100,"invert":false}+ })).unwrap());let original_source = std::fs::read(&source).unwrap();if !continued {item.request.continuation_path = None;@@ -174,6 +179,9 @@ fn single_shot_generates_ending_first_then_attaches_it_with_the_starting_source(assert_eq!(stage.request.reference_paths, item.request.reference_paths);assert_eq!(stage.request.seed, item.request.seed);if calls == 1 {+ let mut expected = item.request.generation_effects.clone().unwrap();+ expected.tone = None;+ assert_eq!(stage.request.generation_effects, Some(expected));assert!(stage.request.single_shot.is_none());assert_eq!(stage.request.prompt, "Waves goodbye");assert_eq!(stage.request.frames, 22);@@ -193,6 +201,7 @@ fn single_shot_generates_ending_first_then_attaches_it_with_the_starting_source(ending_path = stage.request.save_latents_path.clone().unwrap();std::fs::copy(generated_ending.path(), &ending_path).unwrap();} else {+ assert_eq!(stage.request.generation_effects, item.request.generation_effects);assert_eq!(stage.request.prompt, item.request.prompt);assert_eq!(stage.request.frames, 48);assert_eq!(stage.request.continuation_path, item.request.continuation_path);diff --git a/src-tauri/core/src/slopfab/lcs.rs b/src-tauri/core/src/slopfab/lcs.rsindex e2a2ba1..52c9f97 100644--- a/src-tauri/core/src/slopfab/lcs.rs+++ b/src-tauri/core/src/slopfab/lcs.rs@@ -22,8 +22,12 @@ fn calibration_path(directory: &Path, vae: &Path, cancel: &AtomicBool, mut check}pub(super) fn prepare(api: &Api, request: &RequestHandle, item: &QueueItem, platform: ComputePlatform) -> Result<bool, String> {- let Some(settings) = item.request.generation_effects.as_ref().map(|e| e.native_settings()).transpose()?.flatten() else { return Ok(false); };+ let Some(mut settings) = item.request.generation_effects.as_ref().map(|e| e.native_settings()).transpose()?.flatten() else { return Ok(false); };api.require_lcs()?;+ if settings.get("contrast").is_some() && item.request.single_shot.as_ref().is_some_and(|single| single.ending_path.is_some()) {+ api.require_output_tone()?;+ settings["tone_after_denoise"] = serde_json::json!(true);+ }// Retain the library's small fingerprint cache across isolated jobs, including// Vulkan hosts. The queue still releases reused model/GPU buffers when idle.static RUNTIME: std::sync::Mutex<Option<Api>> = std::sync::Mutex::new(None);diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rsindex a1809e0..c690d85 100644--- a/src-tauri/core/src/worker/protocol.rs+++ b/src-tauri/core/src/worker/protocol.rs@@ -30,7 +30,8 @@ pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";// v24 adapts capstone locking to the resolved video schedule, including short LoRA grids.// v25 emits MiniMax still-image previews as well as video previews.// v26 replaces Single Shot's 39-frame overlap, holding 22 and regenerating 17.-pub const PROTOCOL_VERSION: u32 = 26;+// v27 grades Tone once after joining Single Shot's neutral ending and main clip.+pub const PROTOCOL_VERSION: u32 = 27;/// Streaming SeedVR2 restoration; model paths are resolved on the worker.#[derive(Debug, Clone, Serialize, Deserialize)]@@ -385,7 +386,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, 26);+ assert_eq!(PROTOCOL_VERSION, 27);}#[test]diff --git a/src/components/workspace/GenerationEffects.tsx b/src/components/workspace/GenerationEffects.tsxindex 6699ac1..e81f05f 100644--- a/src/components/workspace/GenerationEffects.tsx+++ b/src/components/workspace/GenerationEffects.tsx@@ -4,8 +4,8 @@ import { SliderNumberInput } from "./SliderNumberInput";import { Add16, ChevronDown12, Delete14, Reset16 } from "../ui/icons";import { GENERATION_EFFECTS, GENERATION_EFFECT_DEFAULTS, generationEffectsSchema, type GenerationEffectId, type GenerationEffects as Settings } from "../../lib/generationEffects";-export function GenerationEffects({ value, onChange, supported, disabled = false }: {- value?: Settings | null; onChange: (value: Settings | undefined) => void; supported: boolean; disabled?: boolean;+export function GenerationEffects({ value, onChange, supported, disabled = false, finalTone = false }: {+ value?: Settings | null; onChange: (value: Settings | undefined) => void; supported: boolean; disabled?: boolean; finalTone?: boolean;}) {const effects = value ?? {};const [open, setOpen] = useState(false);@@ -71,7 +71,7 @@ export function GenerationEffects({ value, onChange, supported, disabled = false{present.length > 0 && <><PropRow label="First step"><input className="text-field" aria-label="First effect step" type="number" min={0} max={effects.endStep ?? 2147483647} disabled={locked} value={effects.startStep ?? 0} onChange={(e) => update({ ...effects, startStep: Number(e.target.value) })} /></PropRow><PropRow label="Last step"><input className="text-field" aria-label="Last effect step" type="number" min={effects.startStep ?? 0} max={2147483647} placeholder="Last" disabled={locked} value={effects.endStep ?? ""} onChange={(e) => update({ ...effects, endStep: e.target.value === "" ? undefined : Number(e.target.value) })} /></PropRow>- <p className="clip-effect__note">Steps start at 0. Leave the last step empty to apply through completion.</p>+ <p className="clip-effect__note">Steps start at 0. Leave the last step empty to apply through completion.{finalTone && effects.tone && " Tone is applied once to the completed Single Shot, including its ending. Step limits apply to the other effects."}</p><Checkbox label="Limit to a region" checked={!!effects.region} disabled={locked} onChange={(enabled) => update({ ...effects, region: enabled ? { x: 0, y: 0, width: 100, height: 100, invert: false } : undefined })} />{effects.region && <>{(["x", "y", "width", "height"] as const).map((field) => <PropRow key={field} label={`${field[0].toUpperCase()}${field.slice(1)} (%)`}>diff --git a/src/components/workspace/SceneEditor.tsx b/src/components/workspace/SceneEditor.tsxindex 4f48aa8..64a1ecb 100644--- a/src/components/workspace/SceneEditor.tsx+++ b/src/components/workspace/SceneEditor.tsx@@ -595,7 +595,7 @@ export function SceneInspector({ job, shots, references, folderPath = "", scenes</>}</PropSection></div>- <GenerationEffects key={job.id} value={job.generationEffects} supported={generatorModel(template?.modelType).generationEffects} disabled={disabled} onChange={(generationEffects) => onChange({ generationEffects })} />+ <GenerationEffects key={job.id} value={job.generationEffects} finalTone={job.sceneType === "single-shot" && !job.contextSceneId} supported={generatorModel(template?.modelType).generationEffects} disabled={disabled} onChange={(generationEffects) => onChange({ generationEffects })} /></section>;}