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

A planned shot with no seeded text still gets a start frame

Claudeb6da380373a4
diff --git a/client/src/hooks/useMusicVideoSceneMedia.js b/client/src/hooks/useMusicVideoSceneMedia.js
index 1d9f06c555..779069077b 100644
--- a/client/src/hooks/useMusicVideoSceneMedia.js
+++ b/client/src/hooks/useMusicVideoSceneMedia.js
@@ -1,7 +1,7 @@
import { shotActionContractProblem } from '../../../server/lib/musicVideoActionContract.js';
import { isOutsideMusicVideoReference, musicVideoConditioningReferences, MUSIC_VIDEO_MAX_CONDITIONING_REFERENCES } from '../../../server/lib/musicVideoConditioning.js';
import { sceneEndFrameRequestFields } from '../../../server/lib/musicVideoEndFrame.js';
-import { authoredFramePromptText, authoredShotPrompt, visualDirection } from '../../../server/lib/musicVideoShotPrompt.js';
+import { authoredFramePromptText, authoredShotPrompt, musicVideoFrameModelInput, visualDirection } from '../../../server/lib/musicVideoShotPrompt.js';
import { useEffect, useRef } from 'react';
import socket from '../services/socket';
import toast from '../components/ui/Toast';
@@ -189,7 +189,8 @@ export default function useMusicVideoSceneMedia({ project, videoSettings, applyS
// The director's text (or a refine's instruction); the server composes the still's
// prompt and lists each block it adds (lib/musicVideoShotPrompt.js, #11317).
const prompt = refining ? refine.trim() : authoredFramePromptText(scene);
- if (!prompt) { toast.error('Add a frame prompt or shot prompt first'); return Promise.resolve({ ok: false }); }
+ // A planned shot with no text still renders from its look, frame clause and actions.
+ if (!refining && !musicVideoFrameModelInput(project, scene).prompt) { toast.error('Add a frame prompt or shot prompt first'); return Promise.resolve({ ok: false }); }
// A frame picked on the card (its start or end frame) leads the references, as the image this render reworks.
const references = [...(referenceImageId ? [referenceImageId] : []), ...conditioning.map((ref) => ref.imageId).filter((id) => id !== referenceImageId)];
const projectId = project.id;
@@ -429,7 +430,7 @@ export default function useMusicVideoSceneMedia({ project, videoSettings, applyS
const frameScenes = scenes.filter((scene) => !isSelfDrawnLayer(sceneVisualLayer(scene, { layered })));
const footageScenes = scenes.filter((scene) => sceneVisualLayer(scene, { layered }) === 'footage');
const planMissingFrames = () => frameScenes.filter((scene) =>
- !scene.referenceImageId && !genScenes[scene.sceneId] && authoredFramePromptText(scene));
+ !scene.referenceImageId && !genScenes[scene.sceneId] && musicVideoFrameModelInput(project, scene).prompt);
// The clips a Videos batch would submit: a footage scene with a frame, no clip
// and nothing in flight. A scene still waiting for its frame never blocks the
diff --git a/server/lib/musicVideoShotPrompt.js b/server/lib/musicVideoShotPrompt.js
index 9bfc030cf9..6940ffc97f 100644
--- a/server/lib/musicVideoShotPrompt.js
+++ b/server/lib/musicVideoShotPrompt.js
@@ -100,7 +100,9 @@ export function musicVideoFrameModelInput(project, scene, {
repairs = [], fixes = '',
} = {}) {
const text = typeof authored === 'string' ? authored.trim() : '';
- if (!text) return { prompt: '', promptAdditions: [] };
+ // A refine or an end frame from the start frame says only what changes, so it needs text;
+ // a planned shot with no seeded text still gets its look, frame clause and actions.
+ if (!text && (refine || slot === 'end')) return { prompt: '', promptAdditions: [] };
if (refine) {
return { prompt: refineWrapper(text), promptAdditions: [addition('edit-instructions', 'Edit instructions', refineWrapper('[instruction]'))] };
}
@@ -113,7 +115,7 @@ export function musicVideoFrameModelInput(project, scene, {
addition('visual-direction', 'Palette and camera rules', visualDirection(project?.visualSpec)),
...(slot === 'end' ? [] : [addition('frame-direction', 'Frame direction', scene?.direction?.frameClause)]),
].filter(Boolean);
- const firstLine = [text, ...look.map((item) => item.text)].join(', ');
+ const firstLine = [text, ...look.map((item) => item.text)].filter(Boolean).join(', ');
if (slot === 'end') return { prompt: firstLine, promptAdditions: look };
const unmet = [...new Set(repairs)];
const tail = [
@@ -122,5 +124,5 @@ export function musicVideoFrameModelInput(project, scene, {
addition('plate-repairs', 'Plate repairs', unmet.length ? `Repair these visible plate mismatches while preserving the shot intent:\n${unmet.join('\n')}` : ''),
addition('repair-notes', 'Repair notes', fixes ? `Fix these visible problems from the previous still while preserving the shot intent:\n${fixes}` : ''),
].filter(Boolean);
- return { prompt: [firstLine, ...tail.map((item) => item.text)].join('\n'), promptAdditions: [...look, ...tail] };
+ return { prompt: [firstLine, ...tail.map((item) => item.text)].filter(Boolean).join('\n'), promptAdditions: [...look, ...tail] };
}
diff --git a/server/lib/musicVideoShotPrompt.test.js b/server/lib/musicVideoShotPrompt.test.js
index c1b7555833..f8f5683c03 100644
--- a/server/lib/musicVideoShotPrompt.test.js
+++ b/server/lib/musicVideoShotPrompt.test.js
@@ -47,7 +47,10 @@ describe('musicVideoFrameModelInput', () => {
expect(input.promptAdditions).toEqual([expect.objectContaining({ id: 'edit-instructions', text: expect.stringContaining('[instruction]') })]);
});
- it('sends nothing for a still with no text', () => {
- expect(musicVideoFrameModelInput(project, { sceneId: 's2' })).toEqual({ prompt: '', promptAdditions: [] });
+ it('still composes a planned start frame with no seeded text, and sends nothing for an empty end frame or refine', () => {
+ expect(musicVideoFrameModelInput(project, { sceneId: 's2' }).prompt.startsWith('grainy 16mm, ')).toBe(true);
+ expect(musicVideoFrameModelInput(project, { sceneId: 's2' }, { slot: 'end' })).toEqual({ prompt: '', promptAdditions: [] });
+ expect(musicVideoFrameModelInput(project, scene, { authored: ' ', refine: true })).toEqual({ prompt: '', promptAdditions: [] });
+ expect(musicVideoFrameModelInput(null, { sceneId: 's2' })).toEqual({ prompt: '', promptAdditions: [] });
});
});