Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Leave a leading count like "2-3:" in a video prompt; only a timed song span is cut

Claude0f781a1599d4
diff --git a/client/src/components/musicVideo/SceneRenderInputs.test.jsx b/client/src/components/musicVideo/SceneRenderInputs.test.jsx
index 79013d15f8..311d55e9c2 100644
--- a/client/src/components/musicVideo/SceneRenderInputs.test.jsx
+++ b/client/src/components/musicVideo/SceneRenderInputs.test.jsx
@@ -30,6 +30,8 @@ describe('shotCardRenderRequest', () => {
const base = { scene: scene({ prompt: typed }), settings: { backend: 'local', modelId: 'ltx25_example' }, models };
expect(shotCardRenderRequest(base).prompt).toBe('Her palm slams the splicer.');
expect(shotCardRenderRequest({ ...base, inputs: { songAudio: true } }).prompt).toBe('Her palm slams the splicer. No lip-sync.');
+ // A leading count is action, not a song span.
+ expect(shotCardRenderRequest({ ...base, scene: scene({ prompt: '2-3: two dancers spin' }) }).prompt).toBe('2-3: two dancers spin');
});
// Review on #11280: an audio-reactive render hears the song through its LoRA, so the card must say so and never stack a supplied window.
diff --git a/server/lib/musicVideoMotion.js b/server/lib/musicVideoMotion.js
index 21a99e1f4c..e6f8bc3255 100644
--- a/server/lib/musicVideoMotion.js
+++ b/server/lib/musicVideoMotion.js
@@ -83,7 +83,8 @@ export function silentMotionPrompt(prompt, { styleParts = [], keep = [] } = {})
// Render bookkeeping a video model cannot act on: a leading song span with its length
// ("26.45-28.31s (1.87 s)." or "0:26.4–0:28.3:"), and a trim note ("Use the first ~1.9 s.").
-const SONG_SPAN_PREFIX = /^\s*(?:\d{1,2}:)?\d+(?:\.\d+)?\s*s?\s*[-–—]\s*(?:\d{1,2}:)?\d+(?:\.\d+)?\s*s?\s*(?:\(\s*~?\d+(?:\.\d+)?\s*s(?:ec(?:onds?)?)?\s*\))?\s*[.:]\s*/;
+// A span has a decimal, a seconds unit or a m:ss clock, so a leading count ("2-3: two dancers") stays.
+const SONG_SPAN_PREFIX = /^\s*(?=[\d:.]*[.:]\d|[\d\s:.–—-]*\ds)(?:\d{1,2}:)?\d+(?:\.\d+)?\s*s?\s*[-–—]\s*(?:\d{1,2}:)?\d+(?:\.\d+)?\s*s?\s*(?:\(\s*~?\d+(?:\.\d+)?\s*s(?:ec(?:onds?)?)?\s*\))?\s*[.:]\s*/;
const TRIM_NOTE = /(^|[.!?;]\s+)(?:Use|Keep)\s+(?:only\s+)?the\s+(?:first|last|opening|final)\s+~?\d+(?:\.\d+)?\s*s(?:ec(?:onds?)?)?\b(?:\s+of\s+(?:the\s+)?(?:clip|take|output|render|shot))?\s*(?:[.!?]|$)/gi;
// "No lip-sync." tells a model that hears nothing to avoid what it cannot do.
const NO_LIP_SYNC = /(^|[.!?;]\s+)No\s+(?:singing\s*(?:,|or)\s*)?lip[- ]?sync(?:ing)?(?:\s*(?:,|or)\s*(?:singing|speaking|talking))?\s*(?:[.!?]|$)/gi;
diff --git a/server/services/videoGen/submitJob.test.js b/server/services/videoGen/submitJob.test.js
index c789cf9ca0..8777197aee 100644
--- a/server/services/videoGen/submitJob.test.js
+++ b/server/services/videoGen/submitJob.test.js
@@ -443,6 +443,14 @@ describe('shot intent at the video submission boundary', () => {
expect(mocks.enqueueJob.mock.calls[0][0].params.prompt.split('\n')[0]).toBe('Her palm slams the splicer.');
});
+ it('keeps "No lip-sync" for a take that hears the song', async () => {
+ mocks.prepareVideoGenParams.mockResolvedValue({ backend: 'fal', cleanupStaged: vi.fn(), sourceImagePath: '/example/frame.png' });
+ mocks.preparePerformanceShot.mockResolvedValue({ audioFilePath: '/example/audio.wav', modelId: 'lip-sync', resolution: '1080P',
+ shotInstruction: { version: 1, shotMode: 'performance', songInterval: { startSec: 10, endSec: 14 }, edit: { inSec: 1.5, outSec: 5.5 } } });
+ await submitVideoGenJob({ prompt: '10-14s. She listens. No lip-sync.', backend: 'fal', musicVideo: { projectId: 'p', sceneId: 's', promptAsTyped: true } }, {});
+ expect(mocks.enqueueJob.mock.calls[0][0].params.prompt.split('\n')[0]).toBe('She listens. No lip-sync.');
+ });
+
it('still re-times a card-typed performance prompt to its padded song slice', async () => {
mocks.prepareVideoGenParams.mockResolvedValue({ backend: 'fal', cleanupStaged: vi.fn(), sourceImagePath: '/example/frame.png' });
mocks.preparePerformanceShot.mockResolvedValue({ audioFilePath: '/example/audio.wav', modelId: 'lip-sync', resolution: '1080P',