Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Add Single Shot Continuation strength control

Bittid599d8e59192
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 1fb1d84..acedf8a 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -23,7 +23,7 @@ Changes since 0.3.2.
## Fixes and improvements
- Editing generated music creates a separate draft; cards distinguish drafts from playable songs.
-- Single Shot continuation conditions both generation passes on the previous clip's final latents to preserve continuity.
+- Single Shot initializes both passes from the previous clip's final latents, with a Continuation control defaulting to 30% for appearance guidance.
- 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.md
index 7421c39..696a31b 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 **Create
The 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 a short ending first, then uses those latents to anchor the full shot. A blank ending prompt uses the main prompt. **Starting video** can select any other generated scene; its final latents condition both the ending pass and the full shot for continuity. Generate all handles dependency order. Use matching resolution and latent-upscale settings, a duration of at least two seconds, and updated LAN workers.
+- **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.
- **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.md
index 20b4ebc..72e0fc4 100644
--- a/docs/slopfab-compatibility.md
+++ b/docs/slopfab-compatibility.md
@@ -1,15 +1,15 @@
# Slopfab compatibility
-## Bundled runtime (API 1.40.0)
+## Bundled runtime (API 1.41.0)
-Windows and Linux runtimes use SlopFab commit `af664eb94519fec7604c265a76a602be597fa12b`
+Windows and Linux runtimes use SlopFab commit `bcc1d26d92433475434447f34017550f9f823fe2`
from `D:\Projects\slopfab`, with CUDA and Vulkan enabled and FFmpeg disabled.
-This update includes music performance improvements and additive ending-anchor
-APIs. Single Shot uses the latent ending-anchor API. LAN protocol is 19. Restart Slopus and
+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
update workers to load the new runtime.
-Both runtimes pass C API and embedded-tokenizer checks. Slopus core and desktop
-Rust tests pass against the Windows DLL. Linux retains the Fibo text-renderer
+The Linux runtime passes C API and embedded-tokenizer checks. Slopus core and desktop
+project tests pass against the Windows DLL. Linux retains the Fibo text-renderer
linker workaround documented below and passes unresolved-symbol checks.
## Single Shot
@@ -37,8 +37,19 @@ final duration; Single Shot requires at least two seconds.
Only the final joined output and latents enter scene history. Timeline ranges
identify 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 19
-prevents older workers from silently skipping the ending pass.
+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.
Checks cover prompt/reference compilation, persistence, dependency ordering,
queue snapshots, cancellation, temporary cleanup and native anchored planning.
diff --git a/src-tauri/src/project/scenes.rs b/src-tauri/src/project/scenes.rs
index 20501f1..0e36ab6 100644
--- a/src-tauri/src/project/scenes.rs
+++ b/src-tauri/src/project/scenes.rs
@@ -102,6 +102,8 @@ pub(crate) struct GenerationJob {
pub(crate) continuation_from: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) continuation_lock_overlap: Option<bool>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub(crate) continuation_strength: Option<f64>,
/// The H3 vocabulary tags this shot was built from: group id -> option ids.
/// zod spells it `.nullish()` (src/lib/project.ts `shotTagSelectionSchema`),
/// so `null` IS readable on the frontend — but the key is still skipped
@@ -199,6 +201,7 @@ impl GenerationJob {
continuation_overlap_frames: None,
continuation_from: None,
continuation_lock_overlap: None,
+ continuation_strength: None,
shot_tags: None,
shots: Some(Vec::new()),
duration_seconds: Some(defaults.duration_seconds),
diff --git a/src-tauri/src/project/validation/scenes.rs b/src-tauri/src/project/validation/scenes.rs
index 73f6e7d..0d1a453 100644
--- a/src-tauri/src/project/validation/scenes.rs
+++ b/src-tauri/src/project/validation/scenes.rs
@@ -24,6 +24,7 @@ fn validate_jobs(jobs: &mut [GenerationJob]) -> Result<(), String> {
return Err(format!("Scene '{}' has an ending prompt longer than 30000 characters.", job.id));
}
if job.continuation_scene_id.as_deref() == Some("")
+ || job.continuation_strength.is_some_and(|strength| !strength.is_finite() || !(0.0..=0.99).contains(&strength))
|| job.continuation_from.as_deref().is_some_and(|value| !matches!(value, "start" | "end"))
|| job.continuation_overlap_frames.is_some_and(|frames| !(22..=362).contains(&frames) || frames % 17 != 5) {
return Err(format!("Scene '{}' has invalid continuation settings. Overlap must be 22, 39, 56, … frames.", job.id));
@@ -282,11 +283,15 @@ mod history_tests {
config.generation_jobs[0].scene_type = Some("single-shot".into());
config.generation_jobs[0].ending_prompt = Some("@[ref:hero] waves goodbye".into());
config.generation_jobs[0].continuation_scene_id = Some("start".into());
+ config.generation_jobs[0].continuation_strength = Some(0.65);
validate(&mut config).unwrap();
let restored: ProjectConfig = serde_json::from_slice(&serde_json::to_vec(&config).unwrap()).unwrap();
assert_eq!(restored.generation_jobs[0].ending_prompt, config.generation_jobs[0].ending_prompt);
assert_eq!(restored.generation_jobs[0].scene_type.as_deref(), Some("single-shot"));
assert_eq!(restored.generation_jobs[0].continuation_scene_id.as_deref(), Some("start"));
+ assert_eq!(restored.generation_jobs[0].continuation_strength, Some(0.65));
+ config.generation_jobs[0].continuation_strength = Some(1.0);
+ assert!(validate(&mut config).is_err());
}
fn project_with_history() -> ProjectConfig {
let mut config: ProjectConfig = serde_json::from_str(include_str!("../../../../fixtures/project-v1-complete.json")).unwrap();
diff --git a/src/components/workspace/GeneratorView.test.tsx b/src/components/workspace/GeneratorView.test.tsx
index c8feb6b..3303a2f 100644
--- a/src/components/workspace/GeneratorView.test.tsx
+++ b/src/components/workspace/GeneratorView.test.tsx
@@ -118,6 +118,7 @@ it("keeps Single Shot prompts in the shot panel and the ending prompt and starti
initial.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.queryByLabelText("Describe shot 1")).not.toBeInTheDocument();
const ending = screen.getByLabelText("Ending prompt");
typePrompt(ending, "Wave goodbye.");
@@ -131,7 +132,12 @@ it("keeps Single Shot prompts in the shot panel and the ending prompt and starti
expect(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);
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();
const main = screen.getByLabelText("Describe shot 1");
typePrompt(main, "Walk forward.");
diff --git a/src/components/workspace/SceneEditor.tsx b/src/components/workspace/SceneEditor.tsx
index ebd8dee..74a6d19 100644
--- a/src/components/workspace/SceneEditor.tsx
+++ b/src/components/workspace/SceneEditor.tsx
@@ -378,6 +378,10 @@ 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>
<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.ts
index 05a847c..bbd2bb6 100644
--- a/src/lib/project.singleShot.test.ts
+++ b/src/lib/project.singleShot.test.ts
@@ -6,6 +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", () => {
+ 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);
+ 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(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);
+ 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 };
+ expect(() => parseProjectConfig(config)).toThrow();
+});
+
it("compiles both prompts with consistent reference numbering and persists ending settings in drafts and copies", () => {
const config = project();
config.references = ["main", "ending", "unused"].map((id): ProjectReference => ({ id, name: id, kind: "image", description: "", intendedUse: [], relativePath: `references/${id}.png`, createdAt: config.createdAt }));
diff --git a/src/lib/project.ts b/src/lib/project.ts
index eb1e3f6..00c2c2e 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(),
+ 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(),
bridgeRightMargin: z.number().int().min(0).max(340).multipleOf(17).nullish(),
@@ -1123,6 +1124,7 @@ 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 };
}
@@ -1265,6 +1267,7 @@ export interface SceneGenerationInput {
continuationOverlapFrames?: number;
continuationFrom?: "start" | "end";
continuationLockOverlap?: boolean;
+ continuationSourceNoise?: number;
continuationSourceFrames?: number;
}
@@ -1301,6 +1304,7 @@ export function sceneGenerationSnapshot(job: GenerationJob, input: SceneGenerati
...(input.continuationRelativePath ? { continuationRelativePath: input.continuationRelativePath } : {}),
...(input.previousSceneId ? { continuationOutput: "joined", continuationOverlapFrames: input.continuationOverlapFrames ?? DEFAULT_CONTINUATION_OVERLAP,
...(input.continuationLockOverlap ? { continuationLockOverlap: true } : {}),
+ ...(input.continuationSourceNoise != null ? { continuationSourceNoise: input.continuationSourceNoise } : {}),
continuationFrom: input.continuationFrom ?? "end", ...(input.continuationSourceFrames ? { continuationSourceFrames: input.continuationSourceFrames } : {}) } : {}),
shots,
});
diff --git a/src/lib/runtime.ts b/src/lib/runtime.ts
index 70f1157..067da3e 100644
--- a/src/lib/runtime.ts
+++ b/src/lib/runtime.ts
@@ -134,6 +134,7 @@ export interface SlopfabGenerationRequest {
continuationOverlapFrames?: number;
continuationFrom?: "start" | "end";
continuationLockOverlap?: boolean;
+ continuationSourceNoise?: number;
continuationSourceFrames?: number;
}
diff --git a/src/lib/sceneGeneration.ts b/src/lib/sceneGeneration.ts
index 91af476..80c3f80 100644
--- a/src/lib/sceneGeneration.ts
+++ b/src/lib/sceneGeneration.ts
@@ -39,6 +39,7 @@ 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),