Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Add separate audio generation steps

Bitti16bef3489b6f
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 34c68b6..21439fb 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -32,6 +32,7 @@ This alpha update adds LAN generation workers, Linux support, expanded color gra
## Fixes and improvements
+- Video scenes offer a separate audio step count. Audio follows the video step count by default, with optional overrides for local and worker generation.
- Character Sheet lets you enable Close up, Front view, Side view and Back view independently. Side view is off by default; generation and the combined image include only enabled views.
- Real-ESRGAN and SeedVR2 weights support local file paths in Other weights settings. SeedVR2 sends selected local files to the worker and downloads any missing components there.
- Scene continuation offers a Lock Overlap toggle for local and worker generation, constraining overlapping video and audio to the source scene.
diff --git a/src-tauri/core/src/slopfab/ffi/mod.rs b/src-tauri/core/src/slopfab/ffi/mod.rs
index 39d977a..494e266 100644
--- a/src-tauri/core/src/slopfab/ffi/mod.rs
+++ b/src-tauri/core/src/slopfab/ffi/mod.rs
@@ -139,6 +139,10 @@ impl Api {
self.check(r)?;
self.inner.set_steps(r.pointer.as_ptr(), v)
}
+ pub fn set_audio_steps(&self, r: &RequestHandle, steps: i32) -> Result<(), String> {
+ self.check(r)?;
+ self.inner.set_audio_steps(r.pointer.as_ptr(), steps)
+ }
pub fn set_continuation_lock_overlap(&self, r: &RequestHandle, enabled: bool) -> Result<(), String> {
self.check(r)?;
self.inner.set_continuation_lock_overlap(r.pointer.as_ptr(), enabled)
diff --git a/src-tauri/core/src/slopfab/ffi/raw/mod.rs b/src-tauri/core/src/slopfab/ffi/raw/mod.rs
index 6f35a9e..ee847f8 100644
--- a/src-tauri/core/src/slopfab/ffi/raw/mod.rs
+++ b/src-tauri/core/src/slopfab/ffi/raw/mod.rs
@@ -89,6 +89,7 @@ pub struct Api {
set_continuation_lock_overlap: 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>,
set_sampling_settings: Option<unsafe extern "C" fn(*mut Request, *const c_char) -> i32>,
set_seed: unsafe extern "C" fn(*mut Request, u64) -> i32,
set_model: unsafe extern "C" fn(*mut Request, i32, *const c_char) -> i32,
@@ -206,6 +207,9 @@ impl Api {
"slopfab_request_set_steps",
unsafe extern "C" fn(*mut Request, i32) -> i32
),
+ set_audio_steps: library
+ .get::<unsafe extern "C" fn(*mut Request, i32) -> i32>(b"slopfab_request_set_audio_steps\0")
+ .ok().map(|symbol| *symbol),
set_sampling_settings: library
.get::<unsafe extern "C" fn(*mut Request, *const c_char) -> i32>(b"slopfab_request_set_sampling_settings\0")
.ok().map(|symbol| *symbol),
@@ -453,6 +457,12 @@ impl Api {
pub fn set_steps(&self, r: *mut Request, v: i32) -> Result<(), String> {
self.error(unsafe { (self.set_steps)(r, v) })
}
+ pub fn set_audio_steps(&self, r: *mut Request, steps: i32) -> Result<(), String> {
+ let Some(set) = self.set_audio_steps else {
+ return if steps == 0 { Ok(()) } else { Err("Separate audio steps require SlopFab API 1.21 or later. Update the generation runtime.".into()) };
+ };
+ self.error(unsafe { set(r, steps) })
+ }
pub fn set_seed(&self, r: *mut Request, v: u64) -> Result<(), String> {
self.error(unsafe { (self.set_seed)(r, v) })
}
diff --git a/src-tauri/core/src/slopfab/h3.rs b/src-tauri/core/src/slopfab/h3.rs
index 746d324..b9f6abd 100644
--- a/src-tauri/core/src/slopfab/h3.rs
+++ b/src-tauri/core/src/slopfab/h3.rs
@@ -52,11 +52,14 @@ pub(super) fn configure_request(
if request.still_image {
api.set_still_image(handle)?;
}
- api.set_steps(handle, configuration.generation_steps(request.steps)?)?;
+ let video_steps = configuration.generation_steps(request.steps)?;
+ api.set_steps(handle, video_steps)?;
let dmad = configuration.sampling_preset.as_ref().map_err(Clone::clone)? == &Some(SamplingPreset::Dmad4Step);
if dmad {
api.set_dmad_sampling(handle)?;
}
+ // Sampling presets replace overrides, so apply the audio setting afterward.
+ api.set_audio_steps(handle, request.audio_steps.unwrap_or(0))?;
api.set_seed(handle, generation_seed(request.seed)?)?;
if let Some(edit) = &request.image_edit {
let step = edit.edits.first().ok_or("Add an image edit before generating.")?;
@@ -79,8 +82,9 @@ pub(super) fn configure_request(
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;
- // SlopFab's overlap constraint cannot be combined with approximate caches.
- api.set_motion_cache(handle, configuration.motion_cache && !dmad && request.image_edit.is_none() && !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 && !dmad && request.image_edit.is_none() && !lock_overlap && !independent_audio)?;
api.set_verbose(handle, false)?;
if let Some(mode) = request.video_transition.as_deref() {
api.set_video_transition(handle, if mode == "bridge" { 2 } else { 1 })?;
diff --git a/src-tauri/core/src/slopfab/planning.rs b/src-tauri/core/src/slopfab/planning.rs
index dad340b..00b6efa 100644
--- a/src-tauri/core/src/slopfab/planning.rs
+++ b/src-tauri/core/src/slopfab/planning.rs
@@ -90,6 +90,9 @@ pub(super) fn validate_generation_controls(request: &GenerationRequest) -> Resul
if request.steps < limits.min_steps {
return Err("Generation step count must be at least 2.".into());
}
+ if request.audio_steps.is_some_and(|steps| !(2..=1_000_000).contains(&steps)) {
+ return Err("Audio step count must be a whole number from 2 to 1000000.".into());
+ }
if request.seed < -1 {
return Err("Generation seed must be -1 or greater.".into());
}
diff --git a/src-tauri/core/src/slopfab/tests.rs b/src-tauri/core/src/slopfab/tests.rs
index 8fcb173..cecfd17 100644
--- a/src-tauri/core/src/slopfab/tests.rs
+++ b/src-tauri/core/src/slopfab/tests.rs
@@ -5,6 +5,28 @@ use super::{
use crate::settings::{ProviderOption, ProviderSetting};
use std::collections::BTreeMap;
+#[test]
+fn audio_steps_override_and_reset_reach_planning_and_execution() {
+ let mut configuration = Configuration::from_settings(&BTreeMap::new());
+ configuration.motion_cache = true;
+ let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lib/slopfab").join(super::DLL_FILE_NAME);
+ let api = ffi::Api::load(&path).unwrap();
+ for purpose in [RequestPurpose::Plan, RequestPurpose::Generate] {
+ let handle = RequestHandle::new(&api).unwrap();
+ let mut request = GenerationRequest { prompt: "Ocean waves".into(), frames: 48, steps: 4,
+ audio_steps: Some(7), seed: 1, canvas_width: 64, canvas_height: 32, ..Default::default() };
+ configure_request(&api, &handle, &request, &configuration, ComputePlatform::Cuda13, purpose, &ReferenceVideos::default()).unwrap();
+ assert!(api.resolve(&handle).unwrap().num_model_evaluations >= 6);
+ request.audio_steps = None;
+ configure_request(&api, &handle, &request, &configuration, ComputePlatform::Cuda13, purpose, &ReferenceVideos::default()).unwrap();
+ assert_eq!(api.resolve(&handle).unwrap().num_model_evaluations, 3);
+ for steps in [0, 1, 1_000_001] {
+ request.audio_steps = Some(steps);
+ assert!(validate_generation_controls(&request).is_err());
+ }
+ }
+}
+
#[test]
fn dmad_recipe_reaches_preview_and_execution_on_both_backends() {
let root = tempfile::tempdir().unwrap();
diff --git a/src-tauri/core/src/slopfab/types.rs b/src-tauri/core/src/slopfab/types.rs
index f93d694..4efeab7 100644
--- a/src-tauri/core/src/slopfab/types.rs
+++ b/src-tauri/core/src/slopfab/types.rs
@@ -54,6 +54,8 @@ pub struct GenerationRequest {
#[serde(skip)]
pub image_edit_pixels: Option<std::sync::Arc<Vec<u8>>>,
pub steps: i32,
+ #[serde(default)]
+ pub audio_steps: Option<i32>,
/// -1 asks the host to draw a fresh seed for this generation.
pub seed: i64,
pub canvas_width: i32,
diff --git a/src-tauri/core/src/worker/protocol.rs b/src-tauri/core/src/worker/protocol.rs
index dd08dc2..5d191f7 100644
--- a/src-tauri/core/src/worker/protocol.rs
+++ b/src-tauri/core/src/worker/protocol.rs
@@ -9,10 +9,11 @@ use std::collections::BTreeMap;
pub const SERVICE_TYPE: &str = "_slopus-worker._tcp.local.";
/// Bumped on any incompatible change to the routes or bodies below.
-// v6 carries custom upscale weights; older workers would silently ignore them.
+// v7 carries separate audio steps; older workers would silently ignore them.
+// v6 added custom upscale weights.
// v5 added overlap locking.
// v4 added SeedVR2 export streams. v3 added inverted image masks.
-pub const PROTOCOL_VERSION: u32 = 6;
+pub const PROTOCOL_VERSION: u32 = 7;
/// Streaming SeedVR2 restoration; model paths are resolved on the worker.
#[derive(Debug, Clone, Serialize, Deserialize)]
diff --git a/src-tauri/src/project/scenes.rs b/src-tauri/src/project/scenes.rs
index e11d3fc..d931c1b 100644
--- a/src-tauri/src/project/scenes.rs
+++ b/src-tauri/src/project/scenes.rs
@@ -117,6 +117,8 @@ pub(crate) struct GenerationJob {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) steps: Option<i32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
+ pub(crate) audio_steps: Option<i32>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) seed: Option<i64>,
/// Base guide §4.6 and §4.7 — per-prompt fields, so they sit on the scene
/// rather than on a shot. Absent means the compiler writes its own
@@ -175,6 +177,7 @@ impl GenerationJob {
shots: Some(Vec::new()),
duration_seconds: Some(defaults.duration_seconds),
steps: None,
+ audio_steps: None,
seed: None,
soundscape: None,
music: None,
diff --git a/src-tauri/src/project/validation/scenes.rs b/src-tauri/src/project/validation/scenes.rs
index 64d2854..3fa40f6 100644
--- a/src-tauri/src/project/validation/scenes.rs
+++ b/src-tauri/src/project/validation/scenes.rs
@@ -105,6 +105,9 @@ pub(super) fn validate(config: &mut ProjectConfig) -> Result<(), String> {
job.id, limits.min_steps
));
}
+ if job.audio_steps.is_some_and(|steps| !(2..=1_000_000).contains(&steps)) {
+ return Err(format!("Scene '{}' must use 2 to 1000000 audio steps.", job.id));
+ }
if job.seed.is_some_and(|seed| seed < -1) {
return Err(format!("Scene '{}' has a seed below -1.", job.id));
}
diff --git a/src-tauri/src/tests/scenes.rs b/src-tauri/src/tests/scenes.rs
index 24d2112..432d00e 100644
--- a/src-tauri/src/tests/scenes.rs
+++ b/src-tauri/src/tests/scenes.rs
@@ -433,6 +433,25 @@ fn a_scene_is_bounded_to_fifteen_seconds_on_both_the_length_and_the_cuts() {
assert!(validate_and_normalize_config(twins).is_err());
}
+#[test]
+fn scene_audio_steps_save_and_validate_without_changing_video_steps() {
+ for audio_steps in [None, Some(2), Some(17), Some(1_000_000)] {
+ let mut config = scene_fixture();
+ config.generation_jobs[0].steps = Some(28);
+ config.generation_jobs[0].audio_steps = audio_steps;
+ let folder = tempfile::tempdir().unwrap();
+ write_project(folder.path(), &config).unwrap();
+ let restored = read_project(folder.path()).unwrap().config;
+ assert_eq!(restored.generation_jobs[0].audio_steps, audio_steps);
+ assert_eq!(restored.generation_jobs[0].steps, Some(28));
+ }
+ for audio_steps in [0, 1, 1_000_001] {
+ let mut config = scene_fixture();
+ config.generation_jobs[0].audio_steps = Some(audio_steps);
+ assert!(validate_and_normalize_config(config).is_err());
+ }
+}
+
#[test]
fn scene_generation_controls_match_the_frontend_boundaries() {
for (steps, seed) in [(2, -1), (20, 0), (50, 9_007_199_254_740_991)] {
diff --git a/src-tauri/src/worker/client.rs b/src-tauri/src/worker/client.rs
index 5638121..8eb1494 100644
--- a/src-tauri/src/worker/client.rs
+++ b/src-tauri/src/worker/client.rs
@@ -1089,6 +1089,7 @@ mod tests {
continuation_overlap_frames: Some(39),
continuation_source_frames: Some(85),
continuation_lock_overlap: true,
+ audio_steps: Some(17),
..Default::default()
};
let (job, sources) = build_job(&request, &settings, &[]).unwrap();
@@ -1104,6 +1105,7 @@ mod tests {
assert_eq!(wire["request"]["continuationOverlapFrames"], 39);
assert_eq!(wire["request"]["continuationSourceFrames"], 85);
assert_eq!(wire["request"]["continuationLockOverlap"], true);
+ assert_eq!(wire["request"]["audioSteps"], 17);
assert_eq!(sources.len(), 2);
assert!(build_job(&GenerationRequest { reference_paths: vec![folder.path().join("missing.png").to_string_lossy().into_owned()], ..Default::default() }, &BTreeMap::new(), &[]).is_err());
}
diff --git a/src/components/WorkQueuePanel.tsx b/src/components/WorkQueuePanel.tsx
index 0cedca9..a27074f 100644
--- a/src/components/WorkQueuePanel.tsx
+++ b/src/components/WorkQueuePanel.tsx
@@ -14,7 +14,7 @@ import { Flyout, ProgressBar, ProgressRing } from "./ui";
it runs, a 3px bar. The render settings a row was queued with sit in its
tooltip rather than on a third line. */
-const settingsLine = (item: WorkItem) => item.kind === "refmod" ? "Safetensors refmod" : `${item.settings.canvasWidth} × ${item.settings.canvasHeight} · ${item.kind === "reference-icons" ? "JPG icons" : item.kind === "image" ? "JPG image" : `${(item.settings.frames / GENERATION_FRAME_RATE).toFixed(1)}s`} · ${item.settings.steps} steps · ${item.settings.seed === -1 ? "Random seed" : `Seed ${item.settings.seed}`}`;
+const settingsLine = (item: WorkItem) => item.kind === "refmod" ? "Safetensors refmod" : `${item.settings.canvasWidth} × ${item.settings.canvasHeight} · ${item.kind === "reference-icons" ? "JPG icons" : item.kind === "image" ? "JPG image" : `${(item.settings.frames / GENERATION_FRAME_RATE).toFixed(1)}s`} · ${item.settings.steps} steps${item.settings.audioSteps !== undefined ? ` · ${item.settings.audioSteps} audio steps` : ""} · ${item.settings.seed === -1 ? "Random seed" : `Seed ${item.settings.seed}`}`;
function StateGlyph({ item }: { item: WorkItem }) {
if (item.status === "completed") return <Check16 />;
diff --git a/src/components/workspace/GeneratorView.test.tsx b/src/components/workspace/GeneratorView.test.tsx
index 3cde047..a096895 100644
--- a/src/components/workspace/GeneratorView.test.tsx
+++ b/src/components/workspace/GeneratorView.test.tsx
@@ -585,7 +585,7 @@ describe("Generator scene controls", () => {
expect(state.latest().generationJobs.map((job) => job.status)).toEqual(["queued", "queued"]);
});
- it("shows scene generation controls and sends their values in the render snapshot", async () => {
+ it.each([false, true])("saves generation controls with separate audio steps %s", async (separateAudio) => {
const initial = project();
initial.settings = { ...initial.settings, resolution: "416p", frameRate: 60 };
const state = setup(initial);
@@ -595,10 +595,18 @@ describe("Generator scene controls", () => {
fireEvent.change(within(generation).getByRole("spinbutton", { name: "Generation step count" }), { target: { value: "28" } });
fireEvent.change(within(generation).getByRole("spinbutton", { name: "Generation seed" }), { target: { value: "9173" } });
+ expect(within(generation).getByRole("switch", { name: "Separate audio steps" })).not.toBeChecked();
+ expect(within(generation).queryByRole("spinbutton", { name: "Audio step count" })).toBeNull();
+ fireEvent.click(within(generation).getByRole("switch", { name: "Separate audio steps" }));
+ expect(within(generation).getByRole("spinbutton", { name: "Audio step count" })).toHaveValue(28);
+ fireEvent.change(within(generation).getByRole("spinbutton", { name: "Audio step count" }), { target: { value: "17" } });
+ if (!separateAudio) fireEvent.click(within(generation).getByRole("switch", { name: "Separate audio steps" }));
+ expect(parseProjectConfig(JSON.parse(JSON.stringify(state.latest()))).generationJobs[0].audioSteps).toBe(separateAudio ? 17 : undefined);
expect(state.latest().generationJobs[0]).toEqual(expect.objectContaining({ steps: 28, seed: 9173 }));
fireEvent.click(within(screen.getByRole("region", { name: "First scene" })).getByRole("button", { name: "Generate" }));
await waitFor(() => expect(state.latest().generationJobs[0].generationSnapshot).toEqual(expect.any(String)));
+ expect(JSON.parse(state.latest().generationJobs[0].generationSnapshot!).audioSteps).toBe(separateAudio ? 17 : undefined);
expect(JSON.parse(state.latest().generationJobs[0].generationSnapshot!)).toEqual(expect.objectContaining({
steps: 28,
seed: 9173,
diff --git a/src/components/workspace/SceneEditor.tsx b/src/components/workspace/SceneEditor.tsx
index edf1788..92761ee 100644
--- a/src/components/workspace/SceneEditor.tsx
+++ b/src/components/workspace/SceneEditor.tsx
@@ -18,6 +18,7 @@ import {
sceneDurationSeconds,
sceneGenerationSeed,
sceneGenerationSteps,
+ MAX_AUDIO_GENERATION_STEPS,
sceneGenerationReferences,
splitActionText,
DEFAULT_SPEECH_LANGUAGE,
@@ -487,6 +488,14 @@ export function SceneInspector({ job, shots, references, folderPath = "", scenes
onCommit={(value) => onChange({ steps: value })}
/>
</PropRow>
+ <PropRow label="Separate audio steps" htmlFor={`${id}-separate-audio-steps`}>
+ <ToggleSwitch id={`${id}-separate-audio-steps`} aria-label="Separate audio steps" checked={job.audioSteps != null} disabled={disabled}
+ onChange={(checked) => onChange({ audioSteps: checked ? Math.min(sceneGenerationSteps(job, defaultSteps), MAX_AUDIO_GENERATION_STEPS) : undefined })} />
+ </PropRow>
+ {job.audioSteps != null ? <PropRow label="Audio steps" htmlFor={`${id}-audio-steps`}>
+ <CommittedNumberInput id={`${id}-audio-steps`} className="text-field" minimum={2} maximum={MAX_AUDIO_GENERATION_STEPS} step={1}
+ value={job.audioSteps} integer disabled={disabled} aria-label="Audio step count" onCommit={(value) => onChange({ audioSteps: value })} />
+ </PropRow> : <p className="prop-caption">Audio uses the video generation step count.</p>}
<PropRow label="Seed" htmlFor={`${id}-seed`}>
<CommittedNumberInput
id={`${id}-seed`}
diff --git a/src/lib/project.ts b/src/lib/project.ts
index a6b15fc..cd3f47e 100644
--- a/src/lib/project.ts
+++ b/src/lib/project.ts
@@ -17,6 +17,7 @@ export const DEFAULT_GENERATION_STEPS = 20;
* target; higher rates are produced later by interpolation and retiming. */
export const GENERATION_FRAME_RATE = 24;
export const MAX_GENERATION_STEPS = 2_147_483_647;
+export const MAX_AUDIO_GENERATION_STEPS = 1_000_000;
export const RANDOM_GENERATION_SEED = -1;
/** Languages MiniMax H3 documents as stable for dialogue generation. These are
@@ -578,6 +579,7 @@ export const generationJobSchema = z.object({
* were exposed; the readers below give those scenes the current defaults
* without rewriting the file just because it was opened. */
steps: z.number().int().min(2).max(MAX_GENERATION_STEPS).nullish(),
+ audioSteps: z.number().int().min(2).max(MAX_AUDIO_GENERATION_STEPS).nullish(),
seed: z.number().int().min(RANDOM_GENERATION_SEED).max(Number.MAX_SAFE_INTEGER).nullish(),
/** Base guide §4.6 and §4.7. Per-PROMPT fields, not per-shot, so they live on
* the scene. Blank or absent means the compiler emits its own content-neutral
@@ -1129,6 +1131,7 @@ export interface SceneGenerationInput {
videoTransition?: "extend" | "bridge";
frames: number;
steps: number;
+ audioSteps?: number;
seed: number;
canvasWidth: number;
canvasHeight: number;
@@ -1159,6 +1162,7 @@ export function sceneGenerationSnapshot(job: GenerationJob, input: SceneGenerati
...(input.videoTransition ? { videoTransition: input.videoTransition } : {}),
frames: input.frames,
steps: input.steps,
+ ...(input.audioSteps !== undefined ? { audioSteps: input.audioSteps } : {}),
seed: input.seed,
canvasWidth: input.canvasWidth,
canvasHeight: input.canvasHeight,
diff --git a/src/lib/runtime.ts b/src/lib/runtime.ts
index 6b2a192..aec61d0 100644
--- a/src/lib/runtime.ts
+++ b/src/lib/runtime.ts
@@ -98,6 +98,7 @@ export interface SlopfabGenerationRequest {
stillImage?: boolean;
imageEdit?: { sourceRelativePath: string; edits: import("./imageEditing").ImageEditStep[] };
steps: number;
+ audioSteps?: number;
seed: number;
canvasWidth: number;
canvasHeight: number;
diff --git a/src/lib/sceneGeneration.ts b/src/lib/sceneGeneration.ts
index de3861a..f872727 100644
--- a/src/lib/sceneGeneration.ts
+++ b/src/lib/sceneGeneration.ts
@@ -33,6 +33,7 @@ export function sceneGenerationRequest(job: GenerationJob, config: ProjectConfig
// The scene's own length, not a fixed six seconds.
frames: Math.round(sceneDurationSeconds(job) * GENERATION_FRAME_RATE),
steps: sceneGenerationSteps(job, defaultGenerationSteps),
+ ...(job.audioSteps != null ? { audioSteps: job.audioSteps } : {}),
seed: sceneGenerationSeed(job),
canvasWidth: canvas.width,
canvasHeight: canvas.height,
diff --git a/src/lib/workQueue.test.ts b/src/lib/workQueue.test.ts
index a4d4dbe..975da91 100644
--- a/src/lib/workQueue.test.ts
+++ b/src/lib/workQueue.test.ts
@@ -58,6 +58,19 @@ const finish = async (queue: WorkQueue, id: string) => {
await waitFor(() => expect(queue.getSnapshot().find((item) => item.id === id)?.status).toBe("completed"));
};
+it.each([undefined, 17])("freezes audio steps %s independently of video steps through the queue", async (audioSteps) => {
+ const { queue, first } = setup();
+ const item = submission(first);
+ item.request.audioSteps = audioSteps;
+ queue.enqueue(first, [item]);
+ item.request.audioSteps = 99;
+ await waitFor(() => expect(enqueueSlopfabGeneration).toHaveBeenCalledOnce());
+ expect(vi.mocked(resolveSlopfabPlan).mock.calls[0][0]).toMatchObject({ steps: 12, audioSteps });
+ expect(vi.mocked(enqueueSlopfabGeneration).mock.calls[0][0]).toMatchObject({ steps: 12, audioSteps });
+ expect(queue.getSnapshot()[0].settings).toMatchObject({ steps: 12, audioSteps });
+ await finish(queue, queue.getSnapshot()[0].id);
+});
+
describe("agent scene generation", () => {
const templates = () => {
const chosen: GeneratorTemplate = { id: "chosen", name: "Chosen engine", modelType: "minimax-h3", defaultSteps: 8, attention: "exact",
diff --git a/src/lib/workQueue.ts b/src/lib/workQueue.ts
index ed630b7..08421e5 100644
--- a/src/lib/workQueue.ts
+++ b/src/lib/workQueue.ts
@@ -55,7 +55,7 @@ export interface WorkItem {
completionAt: number | null;
cancelling: boolean;
needsSave: boolean;
- settings: { frames: number; steps: number; seed: number; canvasWidth: number; canvasHeight: number };
+ settings: { frames: number; steps: number; audioSteps?: number; seed: number; canvasWidth: number; canvasHeight: number };
}
interface PendingWork {
extend?: { sourceId: string; name: string; options: ExtendOptions };
@@ -228,7 +228,7 @@ export class WorkQueue {
sceneId: submission.job.id, title: submission.job.title, submittedAt: new Date().toISOString(),
status: "queued", progress: 0, detail: "Waiting to generate", error: null, completionAt: null,
cancelling: false, needsSave: false,
- settings: { frames: request.frames, steps: request.steps, seed: request.seed, canvasWidth: request.canvasWidth, canvasHeight: request.canvasHeight },
+ settings: { frames: request.frames, steps: request.steps, audioSteps: request.audioSteps, seed: request.seed, canvasWidth: request.canvasWidth, canvasHeight: request.canvasHeight },
}];
this.updateScene(this.work.get(id)!, { status: "queued", stage: "queued", progress: 0, error: null, generationSnapshot: submission.snapshot });
}