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

Show exactly what a shot card's Render sends, with still, end frame and song audio toggles

Claudeaa5a758c1c04
diff --git a/client/src/components/musicVideo/SceneCard.jsx b/client/src/components/musicVideo/SceneCard.jsx
index 1779ceaff2..9abc589414 100644
--- a/client/src/components/musicVideo/SceneCard.jsx
+++ b/client/src/components/musicVideo/SceneCard.jsx
@@ -32,6 +32,7 @@ import { COVERAGE_TOLERANCE_SEC, SCENE_ATTENTION_LABELS, sceneAttention } from '
import { ShotLockButton, useShotLock } from './ShotLock.jsx';
import ScenePoster from './ScenePoster.jsx';
import SceneRenderTarget, { lastRenderTarget, renderTargetOverrides } from './SceneRenderTarget.jsx';
+import SceneRenderInputs, { shotCardRenderRequest, shotCardRequestProblem } from './SceneRenderInputs.jsx';
import SceneFrameFit, { sceneFrameFit } from './SceneFrameFit.jsx';
// The two timeline-bound scene fields rendered as identical number inputs.
@@ -184,20 +185,29 @@ export default function SceneCard({
// retry is in flight (or lands a take, which clears it server-side).
const failure = scene.lastFailure && !(scene.lastFailure.lane === 'video' ? generatingVideo : generatingFrame)
? scene.lastFailure : null;
+ const endFramePlan = sceneEndFramePlanFor(scene, renderSettings || {}, { models: videoModels, defaultModel: defaultVideoModel });
+ // Exactly what Render sends: the prompt as typed and the inputs the card toggles.
+ const [renderInputs, setRenderInputs] = useState({});
+ const cardRequest = shotCardRenderRequest({ scene, settings: renderSettings || {}, performance, endFramePlan,
+ models: videoModels, defaultModel: defaultVideoModel, inputs: renderInputs });
const videoRefusal = videoGenerationRefusal({
settingsSaving, speakerUnsaved: performance && (speakerDirty || speakerSaving),
referenceImageId: scene.referenceImageId, generatingVideo, performanceBlocked, lockBlocked,
videoBlockedReason: renderOverrides && videoBlockedReasonFor ? videoBlockedReasonFor(renderSettings) : videoBlockedReason,
- });
+ }) || shotCardRequestProblem(cardRequest);
const generateVideo = () => {
if (videoRefusal) return;
- if (renderOverrides) onGenerateVideo?.(scene, { target: renderOverrides });
- else onGenerateVideo?.(scene);
+ const { songAudio, endFrame } = cardRequest;
+ const card = {
+ prompt: cardRequest.prompt,
+ ...(endFrame ? { endFrame: endFrame.state === 'on' } : {}),
+ ...(songAudio.state === 'on' || songAudio.state === 'off' ? { songAudio: songAudio.state === 'on' } : {}),
+ };
+ onGenerateVideo?.(scene, { ...(renderOverrides ? { target: renderOverrides } : {}), card });
};
const renderCost = performance ? performanceCost : timing.falCost;
// A footage shot's start and end frames show as a pair; the end frame is optional.
const endFrames = Boolean(onGenerateEndFrame) && layer === 'footage';
- const endFramePlan = sceneEndFramePlanFor(scene, renderSettings || {}, { models: videoModels, defaultModel: defaultVideoModel });
const shotModeValue = performance ? (scene.performanceStyle === 'music' ? 'music' : 'performance') : 'cutaway';
// The collapsed Shot settings row says what is set, so it rarely needs opening.
const settingsSummary = [
@@ -505,6 +515,9 @@ export default function SceneCard({
saved={falVideoSettings || {}} disabled={!!generatingVideo} />
{renderCost && <span className="text-[11px] text-port-text-muted">{renderCost}</span>}
</div>
+ {layer === 'footage' && (
+ <SceneRenderInputs id={fieldId('inputs')} request={cardRequest} onChange={(patch) => setRenderInputs((prev) => ({ ...prev, ...patch }))} />
+ )}
{endFramePlan.endImageId && (
<p className={`text-[11px] ${endFramePlan.used ? 'text-port-text-muted' : 'text-port-warning'}`} data-testid="end-frame-plan">
{endFramePlan.used ? 'The clip ends on the end frame.' : `${endFramePlan.reason}.`}
diff --git a/client/src/components/musicVideo/SceneCard.test.jsx b/client/src/components/musicVideo/SceneCard.test.jsx
index f2179ff43a..588a87ae2f 100644
--- a/client/src/components/musicVideo/SceneCard.test.jsx
+++ b/client/src/components/musicVideo/SceneCard.test.jsx
@@ -346,7 +346,7 @@ describe('Render follows the shot locks', () => {
expect(screen.getByRole('button', { name: 'Render again' }).title).toMatch(/^Video locked/);
rerender(card('locked', 'open'));
fireEvent.click(screen.getByRole('button', { name: 'Render again' }));
- expect(onGenerateVideo).toHaveBeenCalledWith(scene);
+ expect(onGenerateVideo).toHaveBeenCalledWith(scene, { card: expect.objectContaining({ prompt: scene.prompt }) });
});
});
@@ -430,3 +430,20 @@ describe('frame fit for an off-shape clip', () => {
expect(onEditLocal).toHaveBeenCalledWith('s1', { frameFit: 'vhs' });
});
});
+
+describe('Sent to the model', () => {
+ // Uniquely catches the card's Render sending anything other than what the card shows, or dropping the Song audio toggle.
+ it('shows the prompt Render sends and hands it, with the song audio pick, to the render', () => {
+ const scene = { sceneId: 's1', prompt: 'She shakes her head', referenceImageId: 'start.png', startSec: 0, endSec: 4,
+ takes: [{ takeId: 't1', kind: 'image', assetId: 'start.png', status: 'selected' }] };
+ const onGenerateVideo = vi.fn();
+ const models = [{ id: 'ltx25_example', name: 'LTX-2.5 Example', runtime: 'ltx25', supportedModes: ['image', 'a2v'] }];
+ render(<SceneCard scene={scene} index={0} expanded onEditLocal={() => {}} onSave={() => {}} onGenerateVideo={onGenerateVideo}
+ videoModels={models} falVideoSettings={{ backend: 'local', modelId: 'ltx25_example' }} />);
+ const inputs = screen.getByTestId('render-inputs');
+ expect(within(inputs).getByText('She shakes her head')).toBeTruthy();
+ fireEvent.click(within(inputs).getByLabelText('Song audio'));
+ fireEvent.click(screen.getByRole('button', { name: 'Render' }));
+ expect(onGenerateVideo).toHaveBeenCalledWith(scene, expect.objectContaining({ card: { prompt: 'She shakes her head', songAudio: true } }));
+ });
+});
diff --git a/client/src/components/musicVideo/SceneRenderInputs.jsx b/client/src/components/musicVideo/SceneRenderInputs.jsx
new file mode 100644
index 0000000000..8721d1acd6
--- /dev/null
+++ b/client/src/components/musicVideo/SceneRenderInputs.jsx
@@ -0,0 +1,96 @@
+import { getFalVideoModel } from '../../lib/falVideoModels.js';
+import { falSceneTake } from '../../lib/musicVideoShotTiming.js';
+import { shotCameraPrompt } from '../../../../server/lib/cameraMovements.js';
+import { localModelTakesSongAudio } from '../../../../server/lib/musicVideoLocalModels.js';
+import { formatCount } from '../../utils/formatters.js';
+
+const clock = (sec) => {
+ const whole = Math.max(0, sec || 0);
+ const minutes = Math.floor(whole / 60);
+ return `${minutes}:${(whole - minutes * 60).toFixed(1).padStart(4, '0')}`;
+};
+
+/**
+ * Exactly what the shot card's Render sends: the prompt as typed (plus the
+ * camera move the card sets), and which inputs go with it. Nothing the card
+ * does not show is added: the server receives `promptAsTyped` and leaves the
+ * prompt alone.
+ *
+ * `settings` is the renderer this render uses (the project's, or the card's
+ * Render on pick merged over it); `inputs` holds the card's toggles,
+ * `{ endFrame, songAudio }`, each undefined until the director flips it.
+ * Returns `{ prompt, promptUsed, maxChars, endFrame, songAudio }`, where each
+ * input is `{ state: 'on' | 'off' | 'required' | 'unavailable', note }`.
+ */
+export function shotCardRenderRequest({
+ scene, settings = {}, performance = false, endFramePlan = null, models = [], defaultModel = '', inputs = {},
+}) {
+ const prompt = [(scene?.prompt?.trim() || scene?.framePrompt?.trim() || ''), shotCameraPrompt(scene?.camera)].filter(Boolean).join('\n');
+ const falModel = settings.backend === 'fal' ? getFalVideoModel(falSceneTake({ scene, videoSettings: settings }).modelId) : null;
+ const localModel = settings.backend === 'local'
+ ? models.find((model) => model.id === (settings.modelId || defaultModel)) || null : null;
+ const span = `${clock(scene?.startSec)}–${clock(scene?.endSec)}`;
+
+ let songAudio;
+ if (performance) songAudio = { state: 'required', note: `Song ${span}` };
+ else if (localModel && localModelTakesSongAudio(localModel)) {
+ const on = inputs.songAudio ?? settings.generationMode === 'suppliedAudio';
+ songAudio = { state: on ? 'on' : 'off', note: `Song ${span}` };
+ } else songAudio = { state: 'unavailable', note: 'This model hears no audio' };
+
+ let endFrame = null;
+ if (scene?.endImageId) {
+ if (songAudio.state === 'on') endFrame = { state: 'unavailable', note: 'Not with song audio' };
+ else if (endFramePlan?.used) endFrame = { state: inputs.endFrame === false ? 'off' : 'on', note: null };
+ // The card says why under Render on (its end-frame line), so no note repeats it here.
+ else endFrame = { state: 'unavailable', note: null };
+ }
+
+ return {
+ prompt,
+ promptUsed: falModel?.prompt !== 'none',
+ maxChars: falModel?.promptMaxChars ?? null,
+ endFrame,
+ songAudio,
+ };
+}
+
+function InputToggle({ id, label, input, onChange }) {
+ const fixed = input.state === 'required' || input.state === 'unavailable';
+ return (
+ <span className={`flex items-center gap-1 ${input.state === 'unavailable' ? 'text-port-text-muted' : ''}`}>
+ <input id={id} type="checkbox" checked={input.state === 'on' || input.state === 'required'} disabled={fixed}
+ onChange={(e) => onChange(e.target.checked)} className="h-4 w-4" />
+ <label htmlFor={id}>{label}</label>
+ {input.note && <span className="text-port-text-muted">· {input.note}</span>}
+ </span>
+ );
+}
+
+/** The card's "Sent to the model" block: the exact prompt and the inputs going with it. */
+export default function SceneRenderInputs({ id, request, onChange }) {
+ const { prompt, promptUsed, maxChars, endFrame, songAudio } = request;
+ const over = maxChars != null && prompt.length > maxChars;
+ return (
+ <div className="min-w-0 space-y-1 rounded border border-port-border p-2 text-xs" data-testid="render-inputs">
+ <div className="text-port-text-muted">Sent to the model</div>
+ {promptUsed
+ ? <p className="whitespace-pre-wrap break-words">{prompt || <span className="text-port-text-muted">No prompt</span>}</p>
+ : <p className="text-port-text-muted">No prompt: this model takes the still and the song only.</p>}
+ {promptUsed && maxChars != null && (
+ <p className={over ? 'text-port-warning' : 'text-port-text-muted'}>
+ {formatCount(prompt.length)} of {formatCount(maxChars)} characters{over ? ' · shorten the prompt to render' : ''}
+ </p>
+ )}
+ <div className="flex flex-wrap gap-x-3 gap-y-1">
+ <InputToggle id={`${id}-still`} label="Still" input={{ state: 'required', note: null }} />
+ {endFrame && <InputToggle id={`${id}-end`} label="End frame" input={endFrame} onChange={(on) => onChange({ endFrame: on })} />}
+ <InputToggle id={`${id}-audio`} label="Song audio" input={songAudio} onChange={(on) => onChange({ songAudio: on })} />
+ </div>
+ </div>
+ );
+}
+
+/** Why the card's Render cannot send this request, or null. */
+export const shotCardRequestProblem = (request) => (request.promptUsed && request.maxChars != null && request.prompt.length > request.maxChars
+ ? `The prompt is ${formatCount(request.prompt.length)} characters; this model takes ${formatCount(request.maxChars)}` : null);
diff --git a/client/src/components/musicVideo/SceneRenderInputs.test.jsx b/client/src/components/musicVideo/SceneRenderInputs.test.jsx
new file mode 100644
index 0000000000..304c502e71
--- /dev/null
+++ b/client/src/components/musicVideo/SceneRenderInputs.test.jsx
@@ -0,0 +1,45 @@
+import { describe, expect, it, vi } from 'vitest';
+import { fireEvent, render, screen } from '@testing-library/react';
+import SceneRenderInputs, { shotCardRenderRequest, shotCardRequestProblem } from './SceneRenderInputs.jsx';
+
+const models = [
+ { id: 'ltx25_example', name: 'LTX-2.5 Example', runtime: 'ltx25', supportedModes: ['text', 'image', 'fflf', 'a2v'] },
+ { id: 'wan_example', name: 'Wan Example', runtime: 'wan22', supportedModes: ['text', 'image'] },
+];
+const scene = (over = {}) => ({ sceneId: 's1', startSec: 64.2, endSec: 69.8, prompt: 'She shakes her head', referenceImageId: 'still.png', ...over });
+
+// Adam: the card's Render sends only what the card shows, with the inputs he picks.
+describe('shotCardRenderRequest', () => {
+ it('sends the typed prompt and the card camera move, nothing else', () => {
+ const request = shotCardRenderRequest({ scene: scene({ camera: { move: 'slow-dolly-in' } }), settings: { backend: 'local', modelId: 'wan_example' }, models });
+ expect(request.prompt).toMatch(/^She shakes her head\nCamera movement: /);
+ expect(request.prompt).not.toMatch(/bible|hold the reference frame/i);
+ expect(request.songAudio).toEqual({ state: 'unavailable', note: 'This model hears no audio' });
+ });
+
+ it('offers song audio for a cutaway on an LTX-2 model, off unless toggled, and drops the end frame with it', () => {
+ const base = { scene: scene({ endImageId: 'end.png' }), settings: { backend: 'local', modelId: 'ltx25_example' }, models, endFramePlan: { used: true } };
+ expect(shotCardRenderRequest(base)).toMatchObject({ songAudio: { state: 'off', note: 'Song 1:04.2–1:09.8' }, endFrame: { state: 'on' } });
+ expect(shotCardRenderRequest({ ...base, inputs: { songAudio: true } })).toMatchObject({ songAudio: { state: 'on' }, endFrame: { state: 'unavailable' } });
+ expect(shotCardRenderRequest({ ...base, inputs: { endFrame: false } }).endFrame.state).toBe('off');
+ });
+
+ it('requires the song for a performance shot and flags a prompt over the fal model limit', () => {
+ expect(shotCardRenderRequest({ scene: scene(), performance: true, settings: { backend: 'local' }, models }).songAudio.state).toBe('required');
+ const long = shotCardRenderRequest({ scene: scene({ prompt: 'x'.repeat(2100) }), settings: { backend: 'fal' } });
+ expect(long.maxChars).toBe(2000);
+ expect(shotCardRequestProblem(long)).toMatch(/2,100 characters; this model takes 2,000/);
+ });
+});
+
+describe('SceneRenderInputs', () => {
+ it('shows the exact prompt and reports a toggle', () => {
+ const onChange = vi.fn();
+ const request = shotCardRenderRequest({ scene: scene(), settings: { backend: 'local', modelId: 'ltx25_example' }, models });
+ render(<SceneRenderInputs id="card" request={request} onChange={onChange} />);
+ expect(screen.getByText('She shakes her head')).toBeTruthy();
+ expect(screen.getByLabelText('Still').disabled).toBe(true);
+ fireEvent.click(screen.getByLabelText('Song audio'));
+ expect(onChange).toHaveBeenCalledWith({ songAudio: true });
+ });
+});
diff --git a/client/src/hooks/useMusicVideoSceneMedia.batch.test.jsx b/client/src/hooks/useMusicVideoSceneMedia.batch.test.jsx
index c175b8f5d0..014caa3ba7 100644
--- a/client/src/hooks/useMusicVideoSceneMedia.batch.test.jsx
+++ b/client/src/hooks/useMusicVideoSceneMedia.batch.test.jsx
@@ -70,3 +70,18 @@ describe('useMusicVideoSceneMedia clip batch (#10153)', () => {
expect(result.current.videoBatch.state).toMatchObject({ done: 1, canceled: 8, failed: 0 });
});
});
+
+describe('useMusicVideoSceneMedia shot card Render', () => {
+ beforeEach(() => { handlers.clear(); generateVideo.mockReset(); });
+
+ // Uniquely catches a card Render picking up hidden direction, or its Song audio pick not reaching the server.
+ it('sends the card prompt untouched, tagged as typed, with its song audio pick', async () => {
+ generateVideo.mockResolvedValue({ status: 'queued', jobId: 'job-card' });
+ const { result } = renderMedia();
+ await act(() => result.current.generateSceneVideo(project.scenes[0], { card: { prompt: 'exactly this', songAudio: true } }));
+ const request = generateVideo.mock.calls[0][0];
+ expect(request.prompt).toBe('exactly this');
+ expect(request.mode).toBe('a2v');
+ expect(JSON.parse(request.musicVideo)).toEqual({ projectId: 'p1', sceneId: 's0', promptAsTyped: true, songAudio: true });
+ });
+});
diff --git a/client/src/hooks/useMusicVideoSceneMedia.js b/client/src/hooks/useMusicVideoSceneMedia.js
index 212745ee66..5fbe2fb260 100644
--- a/client/src/hooks/useMusicVideoSceneMedia.js
+++ b/client/src/hooks/useMusicVideoSceneMedia.js
@@ -350,11 +350,13 @@ export default function useMusicVideoSceneMedia({ project, videoSettings, applyS
* Returns a promise that always resolves to `{ ok }` — see generateFrame's
* doc comment. `revisionId` (optional) is the revision hook's kickoff tag (#9011).
*/
- const generateSceneVideo = (scene, { revisionId, onJob, target = null } = {}) => {
+ const generateSceneVideo = (scene, { revisionId, onJob, target = null, card = null } = {}) => {
if (!scene.referenceImageId) { toast.error('Generate a reference frame first'); return Promise.resolve({ ok: false }); }
const problem = shotActionContractProblem(scene.direction?.actionContract, scene);
if (problem) { toast.error(problem); return Promise.resolve({ ok: false }); }
- const basePrompt = buildShotPrompt(scene);
+ // `card` is the shot card's Render: its prompt exactly as shown and its input toggles
+ // ({ prompt, endFrame, songAudio }), sent with nothing added (SceneRenderInputs).
+ const basePrompt = card ? card.prompt : buildShotPrompt(scene);
if (!basePrompt) { toast.error('Add a shot prompt first'); return Promise.resolve({ ok: false }); }
// `target` renders this one shot elsewhere (a scene card's Render on pick) without changing the saved setting.
const settings = target ? { ...videoSettings.settings, ...target } : videoSettings.settings;
@@ -375,10 +377,11 @@ export default function useMusicVideoSceneMedia({ project, videoSettings, applyS
// whose timing is explicitly approximate. The environmental-motion guard
// stays exclusive to the audio-reactive lane.
const motionCues = settings.backend === 'grok' ? approximateMotionCues(project?.phrases, scene.startSec, scene.endSec) : '';
- const prompt = audioReactiveSelected
+ const prompt = card ? basePrompt : audioReactiveSelected
? `${basePrompt}. ${AUDIO_REACTIVE_PERFORMANCE_GUARD}`
: [basePrompt, motionCues].filter(Boolean).join('. ');
- const mode = audioReactiveSelected || settings.generationMode === 'suppliedAudio' ? 'a2v' : 'image';
+ const songAudio = typeof card?.songAudio === 'boolean' ? card.songAudio : settings.generationMode === 'suppliedAudio';
+ const mode = audioReactiveSelected || songAudio ? 'a2v' : 'image';
const falFields = settings.backend === 'fal'
? falTakeRequestFields(falSceneTake({ scene, videoSettings: settings, songDurationSec: project?.audioAnalysis?.durationSec ?? null }))
: null;
@@ -410,16 +413,19 @@ export default function useMusicVideoSceneMedia({ project, videoSettings, applyS
sourceImageFile: scene.referenceImageId,
// A style-break end frame (#11173), when this fal or local model takes one
// (a local LTX clip then renders first+last frame, #11258).
- ...sceneEndFrameRequestFields(scene, {
+ ...(card && (card.endFrame === false || songAudio) ? {} : sceneEndFrameRequestFields(scene, {
backend: settings.backend, falModelId: falFields?.falModelId, mode, // A card's local pick names its own model; else the active one.
localRuntime: (target?.modelId ? (videoSettings.models || []).find((m) => m.id === target.modelId)?.runtime : videoSettings.activeModel?.runtime) ?? null,
- }),
+ })),
...(audioReactiveSelected ? {
audioStartSec: scene.startSec || 0,
loraFilenames: [detectedAudioReactiveLora.filename],
loraScales: [settings.audioReactiveScale],
} : {}),
- musicVideo: JSON.stringify({ projectId: project.id, sceneId: scene.sceneId, ...(revisionId ? { revisionId } : {}) }),
+ musicVideo: JSON.stringify({
+ projectId: project.id, sceneId: scene.sceneId, ...(revisionId ? { revisionId } : {}),
+ ...(card ? { promptAsTyped: true, ...(typeof card.songAudio === 'boolean' && !performance ? { songAudio: card.songAudio } : {}) } : {}),
+ }),
})
.then((res) => trackVideoJob(res, scene.sceneId, onJob))
.catch((err) => handleVideoError(err, scene.sceneId, 'Scene video generation failed'));
diff --git a/server/lib/README.md b/server/lib/README.md
index b79fe5c42f..bac3116ad4 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -862,7 +862,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `musicVideoTitleCard.js` | The MTV-style opening title card (song, artist, year over the opener): `normalizeTitleCard`, `titleCardVisible`, `titleCardPrefill` (a new card's text and a window ending before the first sung line), and `titleCardRuntimeSource` (the page script the live preview and the document render install to draw it per seek, with its fade and title-safe layout). Browser-safe. |
| `musicVideoDependencies.js` | Versioned take/evidence provenance, dependency comparisons and bounded selective-repair previews. |
| `musicVideoEndFrame.js` | Style-break end frames (#11173): `sceneEndFramePlan(scene, { backend, falModelId })` says whether a clip sends the scene's end frame (only fal models with an end image, never a performance shot) and why not; `sceneEndFrameRequestFields` turns it into `lastImageFile`. Shared by the board and production. |
-| `musicVideoLocalModels.js` | Which local video models render which Music Video shot: `localModelRendersCutaway` (image-to-video), `localModelRendersPerformance` (LTX-2 family a2v or MiniMax H3 Ref2VA, from the still + song slice) and `localMusicVideoModels(models, performance)`. Shared by the shot card and project model pickers and `submitJob.js` / `prepareParams.js`. |
+| `musicVideoLocalModels.js` | Which local video models render which Music Video shot: `localModelRendersCutaway` (image-to-video), `localModelRendersPerformance` (LTX-2 family a2v or MiniMax H3 Ref2VA, from the still + song slice), `localMusicVideoModels(models, performance)` and `localModelTakesSongAudio` (LTX-2 family a2v: a cutaway can take its song slice). Shared by the shot card and project model pickers and `submitJob.js` / `prepareParams.js`. |
| `musicVideoHandoffFrame.js` | Continuing shots: `sceneClipOutFrameSec(scene, clipDurationSec, fps)` is the time in a shot's clip of the last frame the cut shows (performance edit in/out, loop wrap, hold past the clip's end); `previousShot(project, sceneId)` is the shot before it by start time. |
| `musicVideoCrossLinks.js` | Cross-links between a release's posts: each post's public link, the `Label: url` lines a new draft adds, which links a posted record carries (`links`, or what its draft always linked), and `crossLinkBackfill(kit)` listing the links each editable post (YouTube, Suno, X, Stacker News) still lacks. Shared by the publish payloads and the Publish stage. |
| `musicVideoExcerptRange.js` | `excerptRangeFits(startSec, endSec, totalSec, fps)`: whether a code/document excerpt window fits a frame-quantized render, allowing the end up to one frame past it (scene ends follow the analysed song length; the caller clamps). The start must fall inside the render; an unknown fps allows no slack. |
diff --git a/server/lib/musicVideoLocalModels.js b/server/lib/musicVideoLocalModels.js
index 594fba5b0a..b40c5e5410 100644
--- a/server/lib/musicVideoLocalModels.js
+++ b/server/lib/musicVideoLocalModels.js
@@ -21,3 +21,10 @@ export const localModelRendersPerformance = (model) => !!model
/** The local models a shot can render on (performance shots, or cutaways). */
export const localMusicVideoModels = (models, performance) => (Array.isArray(models) ? models : [])
.filter(performance ? localModelRendersPerformance : localModelRendersCutaway);
+
+/**
+ * Whether `model` can take a song slice for a cutaway (supplied song audio):
+ * the LTX-2 family's PCM window. Other audio-to-video runtimes are not negotiated.
+ */
+export const localModelTakesSongAudio = (model) => !!model
+ && isLtx2FamilyRuntime(model.runtime) && resolveVideoSupportedModes(model).includes('a2v');
diff --git a/server/routes/videoGen.js b/server/routes/videoGen.js
index 3354167913..bbaef650c2 100644
--- a/server/routes/videoGen.js
+++ b/server/routes/videoGen.js
@@ -481,6 +481,12 @@ const generateBodySchema = z.object({
// revisionGenerationJobs/revisionSectionStates uses it for an exact
// match instead of the pre-#9011 scene+time heuristic.
revisionId: z.string().min(1).max(200).optional(),
+ // The shot card's Render: `prompt` is exactly what the director sees and
+ // sends, so the shot-intent lines and the silent-model rewrite are skipped.
+ promptAsTyped: z.boolean().optional(),
+ // The shot card's Song audio toggle: hand a cutaway its song slice (true) or
+ // render it silent (false), whatever the project's generation mode says.
+ songAudio: z.boolean().optional(),
}).optional(),
),
// File the clip into this music video's media collection even when no shot
diff --git a/server/services/federatedMedia/sourceAudio.js b/server/services/federatedMedia/sourceAudio.js
index 968e5b6b01..fc7ac77935 100644
--- a/server/services/federatedMedia/sourceAudio.js
+++ b/server/services/federatedMedia/sourceAudio.js
@@ -7,13 +7,11 @@ import { basename, dirname, join, resolve } from 'node:path';
import { PATHS, ensureDir, sha256File } from '../../lib/fileUtils.js';
import { isPathInsideDir } from '../../lib/pathSafety.js';
import { ServerError } from '../../lib/errorHandler.js';
-import { isLtx2FamilyRuntime } from '../../lib/runners.js';
-import { resolveVideoSupportedModes } from '../../lib/videoModeProfiles.js';
+import { localModelTakesSongAudio } from '../../lib/musicVideoLocalModels.js';
// This slice uses the LTX PCM input and --no-audio contract. Other A2V
// runtimes have different output/window controls and are not negotiated yet.
-export const supportsSourceAudioWindow = (model) => isLtx2FamilyRuntime(model?.runtime)
- && resolveVideoSupportedModes(model).includes('a2v');
+export const supportsSourceAudioWindow = localModelTakesSongAudio;
/** Only this feature's owned copies may be released, never a master recording. */
export async function discardSourceAudioWindow(path) {
diff --git a/server/services/musicVideo/renderPool.js b/server/services/musicVideo/renderPool.js
index ad85c00259..fcf04f286a 100644
--- a/server/services/musicVideo/renderPool.js
+++ b/server/services/musicVideo/renderPool.js
@@ -10,23 +10,25 @@ export async function applyProjectRenderPool(body) {
const { getProject } = await import('./projects.js');
const project = await getProject(body.musicVideo.projectId);
const pool = project?.videoSettings?.renderPool;
- if (project?.videoSettings?.generationMode === 'suppliedAudio'
+ // The shot card's Song audio toggle decides for its own render; else the project's generation mode.
+ const supplied = typeof body.musicVideo.songAudio === 'boolean'
+ ? body.musicVideo.songAudio : project?.videoSettings?.generationMode === 'suppliedAudio';
+ if (supplied
&& ((body.mode && !['image', 'a2v'].includes(body.mode)) || body.extendFromVideoId
|| body.lastImageFile || body.keyframes?.length || body.chunks > 1)) {
refuse('Supplied song audio does not support continuation, end frames, keyframes or chained clips');
}
// A production run's own routes decide: a supplied-audio route sends `_suppliedAudio` itself.
- if (body.musicVideo.productionRunId && project?.videoSettings?.generationMode === 'suppliedAudio' && !body._suppliedAudio) {
+ if (body.musicVideo.productionRunId && supplied && !body._suppliedAudio) {
refuse('This production run was started with Prompt motion; start a new run to use Supplied song audio');
}
// Existing projects retain their renderer pins until a pool is saved.
if (!pool || pool.mode === 'local') {
if (body.mediaProviderPeerId) refuse('Select a peer in the saved project render pool first');
- if (project?.videoSettings?.generationMode === 'suppliedAudio' && body.backend && body.backend !== 'local') {
+ if (supplied && body.backend && body.backend !== 'local') {
refuse('Supplied song audio requires Local video; choose that renderer explicitly');
}
- return project?.videoSettings?.generationMode === 'suppliedAudio'
- ? { ...body, backend: 'local', mode: 'a2v', _suppliedAudio: true } : body;
+ return supplied ? { ...body, backend: 'local', mode: 'a2v', _suppliedAudio: true } : body;
}
const scene = project.scenes?.find((entry) => entry.sceneId === body.musicVideo.sceneId);
if (!scene) refuse('The requested scene is no longer in this project');
@@ -42,7 +44,7 @@ export async function applyProjectRenderPool(body) {
refuse('Audio-reactive LoRA weights cannot cross to peers; use Prompt motion or Supplied song audio');
}
if (body.mode && !['image', 'a2v'].includes(body.mode)) refuse('Peer pools do not support video continuation or chain state');
- const suppliedAudio = project.videoSettings.generationMode === 'suppliedAudio';
+ const suppliedAudio = supplied;
const requestedMode = suppliedAudio ? 'a2v' : 'image';
const [{ getPeers }, { resolveFederatedMediaProvider }, { listJobs }] = await Promise.all([
import('../instances.js'), import('../federatedMediaConsumer.js'), import('../mediaJobQueue/index.js'),
diff --git a/server/services/musicVideo/renderPool.test.js b/server/services/musicVideo/renderPool.test.js
index 8c6c0ae227..5d8a3ade4d 100644
--- a/server/services/musicVideo/renderPool.test.js
+++ b/server/services/musicVideo/renderPool.test.js
@@ -104,4 +104,13 @@ describe('project render-pool submission policy', () => {
const local = { ...m.project, updatedAt: '2026-10-01T00:00:00.000Z' };
expect(mergeProjectRecord(local, remote).next.videoSettings.renderPool).toEqual(pool);
});
+ // The shot card's Song audio toggle decides for its own render, so a local test never needs the project setting flipped.
+ it('lets one render hand its cutaway the song slice, or keep it silent, whatever the project mode', async () => {
+ m.project.videoSettings = { backend: 'local', generationMode: 'image' };
+ const withSong = { ...body(), musicVideo: { ...body().musicVideo, songAudio: true } };
+ expect(await applyProjectRenderPool(withSong)).toMatchObject({ backend: 'local', mode: 'a2v', _suppliedAudio: true });
+ m.project.videoSettings = { backend: 'local', generationMode: 'suppliedAudio' };
+ const silent = { ...body(), backend: 'fal', musicVideo: { ...body().musicVideo, songAudio: false } };
+ expect(await applyProjectRenderPool(silent)).toEqual(silent);
+ });
});
diff --git a/server/services/videoGen/submitJob.js b/server/services/videoGen/submitJob.js
index 6425264ce4..b6bf03deb2 100644
--- a/server/services/videoGen/submitJob.js
+++ b/server/services/videoGen/submitJob.js
@@ -313,8 +313,10 @@ const submitValidatedVideoGenJob = async (body, uploads) => {
// A take that hears nothing (no lip-sync or supplied song audio) gets plain physical
// motion: the model would act out song cues and look words instead of reading them.
const hearsAudio = !!(performance || prepared.audio || params.audioConditioning || params.audioFilePath);
- params.prompt = withShotActionPrompt(params.prompt, project, scene, { offsetSec: performance?.shotInstruction?.edit?.inSec || 0 });
- if (!hearsAudio) params.prompt = await silentMusicVideoMotionPrompt(params.prompt, project, scene);
+ if (!body.musicVideo.promptAsTyped) {
+ params.prompt = withShotActionPrompt(params.prompt, project, scene, { offsetSec: performance?.shotInstruction?.edit?.inSec || 0 });
+ if (!hearsAudio) params.prompt = await silentMusicVideoMotionPrompt(params.prompt, project, scene);
+ }
const interval = performance?.shotInstruction?.songInterval || prepared.audio?.songInterval;
if (params.audioConditioning && Math.round(scene?.startSec * 48000) !== params.audioConditioning.startSample) {
throw new ServerError('Scene timing changed while source audio was prepared', { status: 409, code: 'MUSIC_VIDEO_SHOT_TIMING_CHANGED' });
diff --git a/server/services/videoGen/submitJob.test.js b/server/services/videoGen/submitJob.test.js
index 65830eea87..8ac0bd6f5f 100644
--- a/server/services/videoGen/submitJob.test.js
+++ b/server/services/videoGen/submitJob.test.js
@@ -426,6 +426,16 @@ describe('shot intent at the video submission boundary', () => {
expect(params.prompt).not.toMatch(/Sleep|Kodak|grain|Word \d|Musical onsets/);
});
+ // Adam: the shot card's Render sends what the card shows, nothing the director cannot see.
+ it('sends a shot card Render prompt exactly as typed', async () => {
+ mocks.getMusicVideoProject.mockResolvedValue({ ...project(), concept: { style: 'grainy 35mm Kodak look' } });
+ const prompt = 'She shakes her head on "Sleep", grainy 35mm Kodak look';
+ await submitVideoGenJob({ prompt, musicVideo: { projectId: 'p', sceneId: 's', promptAsTyped: true } }, {});
+ const { params } = mocks.enqueueJob.mock.calls[0][0];
+ expect(params.prompt).toBe(prompt);
+ expect(params.shotInstruction.actionContract).toEqual(contract);
+ });
+
it('shifts contract and words into a padded performance window exactly once', 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',