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

Keep mood board people out of scene frame prompts

Claudea58e455d3a25
diff --git a/client/src/hooks/useMusicVideoSceneMedia.js b/client/src/hooks/useMusicVideoSceneMedia.js
index fbc3e3ff80..7b5f9048c9 100644
--- a/client/src/hooks/useMusicVideoSceneMedia.js
+++ b/client/src/hooks/useMusicVideoSceneMedia.js
@@ -1,7 +1,7 @@
import { shotActionContractProblem, shotActionPrompt } from '../../../server/lib/musicVideoActionContract.js';
import { shotCameraPrompt } from '../../../server/lib/cameraMovements.js';
import { isOutsideMusicVideoReference, musicVideoConditioningReferences, MUSIC_VIDEO_MAX_CONDITIONING_REFERENCES } from '../../../server/lib/musicVideoConditioning.js';
-import { musicVideoCreativeContext } from '../../../server/lib/musicVideoCreativeContext.js';
+import { musicVideoCreativeContext, musicVideoDirectorLook } from '../../../server/lib/musicVideoCreativeContext.js';
import { useEffect, useRef } from 'react';
import socket from '../services/socket';
import toast from '../components/ui/Toast';
@@ -163,7 +163,7 @@ export default function useMusicVideoSceneMedia({ project, videoSettings, applyS
const failedScenes = { frame: frameLane.failedScenes, video: videoLane.failedScenes };
const style = project?.concept?.style?.trim();
- const direction = [musicVideoCreativeContext(project?.concept), visualDirection(project?.visualSpec)].filter(Boolean).join('; ');
+ const direction = [musicVideoCreativeContext(project?.concept, { look: musicVideoDirectorLook(project) }), visualDirection(project?.visualSpec)].filter(Boolean).join('; ');
// The i2v prompt leaves the mood-board look out (handoff.js composePrompt): the frame already carries it.
const motionDirection = [musicVideoCreativeContext(project?.concept, { moodBoard: false }), visualDirection(project?.visualSpec)].filter(Boolean).join('; ');
const conditioning = conditioningReferences(project);
diff --git a/server/lib/musicVideoCreativeContext.js b/server/lib/musicVideoCreativeContext.js
index c9a17155ef..d38aaa7d38 100644
--- a/server/lib/musicVideoCreativeContext.js
+++ b/server/lib/musicVideoCreativeContext.js
@@ -8,22 +8,55 @@ const BIBLE_HEADER = 'Production bible (use the subjects relevant to this shot;
// street or a bathroom), so it is labelled look-only wherever it is included.
export const MOOD_BOARD_LOOK_LABEL = 'Mood board look (palette, lighting and texture only; never its locations, objects or poses)';
+const PERSON = /\b(she|he|her|hers|him|his|they|them|their|woman|women|man|men|girl|boy|person|people|figure|figures|silhouette|someone|somebody|protagonist|character|singer|drummer|dancer)\b/i;
+
+/**
+ * `text` without the sentences or `;` clauses that describe a person (or
+ * `name`). A mood board's pictured people (an image caption, a synthesized
+ * style that poses a woman at a window) never reach a prompt as a subject.
+ * `Avoid:` lines are kept: naming people there only keeps them out.
+ */
+export function withoutPeople(text, name = '') {
+ const who = String(name || '').trim().toLowerCase();
+ const keep = (part) => part.trim() && !PERSON.test(part) && !(who.length >= 3 && part.toLowerCase().includes(who));
+ return String(text || '').split('\n')
+ .map((line) => (/^\s*avoid:/i.test(line) ? line.trim() : line.split(/;\s*/)
+ .map((clause) => clause.split(/(?<=[.!?])\s+/).filter(keep).join(' ').trim())
+ .filter(Boolean).join('; ')))
+ .filter(Boolean).join('\n');
+}
+
+/**
+ * The director-written look (palette, light, film stock, texture) from the
+ * project's Cast & Sets direction; '' when Cast & Sets was skipped or has none.
+ */
+export function musicVideoDirectorLook(project) {
+ if (project?.castAndSets?.status === 'skipped') return '';
+ return trimTo(project?.castAndSets?.direction?.look, 500) || '';
+}
+
// A shot needs the character's identity, look, rules and never-list; the
// wardrobe catalogue is for Cast & Sets, which reads the full snapshot.
const characterStyleForShots = (snapshot) => snapshot.split('\n').filter((line) => !line.startsWith('Wardrobe options:')).join('\n');
/**
* Shared, bounded creative bible for planning, media generation and handoff.
- * `moodBoard: false` leaves the mood-board look out — a motion prompt is
- * conditioned on a reference frame that already carries the look, and the
- * board's pictured places and subjects only fight the shot there.
+ * `moodBoard: false` leaves the look out — a motion prompt is conditioned on a
+ * reference frame that already carries the look, and the board's pictured
+ * places and subjects only fight the shot there. `look` is the director-written
+ * look (musicVideoDirectorLook); when set it replaces the mood board snapshot.
+ * Either way, sentences that picture a person are dropped.
*/
-export function musicVideoCreativeContext(concept, { moodBoard = true } = {}) {
+export function musicVideoCreativeContext(concept, { moodBoard = true, look = '' } = {}) {
if (!concept) return '';
+ const directorLook = withoutPeople(look);
+ const boardLook = directorLook ? '' : withoutPeople(trimTo(concept.moodBoardStyle, 800));
+ const sameAsStyle = directorLook && directorLook === withoutPeople(trimTo(concept.style, 500));
const styles = [
concept.characterStyle && `Character style (fixed identity; use the identity text verbatim): ${trimTo(characterStyleForShots(concept.characterStyle), 1900)}`,
concept.universeStyle && `Universe style: ${trimTo(concept.universeStyle, 800)}`,
- moodBoard && concept.moodBoardStyle && `${MOOD_BOARD_LOOK_LABEL}: ${trimTo(concept.moodBoardStyle, 800)}`,
+ moodBoard && directorLook && !sameAsStyle && `Look (palette, light and texture only): ${directorLook}`,
+ moodBoard && boardLook && `${MOOD_BOARD_LOOK_LABEL}: ${boardLook}`,
].filter(Boolean);
const subjects = (concept.subjects || []).slice(0, 24);
const identities = subjects.map((s) =>
diff --git a/server/services/musicVideo/castAndSetsDirection.js b/server/services/musicVideo/castAndSetsDirection.js
index 2f0c8ac84b..14f50d81a0 100644
--- a/server/services/musicVideo/castAndSetsDirection.js
+++ b/server/services/musicVideo/castAndSetsDirection.js
@@ -33,7 +33,7 @@ import { musicVideoAllowsMedia } from '../../lib/musicVideoMediaPolicy.js';
import { z } from 'zod';
import { ServerError } from '../../lib/errorHandler.js';
import { extractJson } from '../../lib/jsonExtract.js';
-import { musicVideoCreativeContext, musicVideoSongStyleContext } from '../../lib/musicVideoCreativeContext.js';
+import { musicVideoCreativeContext, musicVideoSongStyleContext, withoutPeople } from '../../lib/musicVideoCreativeContext.js';
import { musicVideoBriefTools as briefTools } from '../../lib/musicVideoMediumPlan.js';
import { trimTo } from '../../lib/textUtils.js';
import { CAST_SETS_DEFINITION_LIMITS, normalizeDefinitions } from './castAndSetsDefinitions.js';
@@ -219,7 +219,8 @@ export function buildCastAndSetsPrompt(project, { moodImages = [], board = null,
// The song's Suno style shapes the design; the director's visual style is the look.
const songStyle = musicVideoSongStyleContext({ songStyle: concept.songStyle || track?.prompt });
const visualStyle = trimTo(concept.style, 1500);
- const boardStyle = trimTo(board?.style?.prompt, 1500) || trimTo(concept.moodBoardStyle, 1500);
+ // The board's pictured people are never design input (#10982).
+ const boardStyle = withoutPeople(trimTo(board?.style?.prompt, 1500) || trimTo(concept.moodBoardStyle, 1500));
const boardNegative = trimTo(board?.style?.negativePrompt, 600);
const moodLines = moodImages.map((img, i) => `${i}. ${[img.caption, img.analysis].filter(Boolean).join(' — ') || '(no caption or analysis)'}`);
const sectionLines = sections.map((s) => `${s.index}. ${s.label} ${fmtTime(s.startSec)}–${fmtTime(s.endSec)}`);
diff --git a/server/services/musicVideo/castAndSetsPlan.js b/server/services/musicVideo/castAndSetsPlan.js
index d9edce64be..929f98c935 100644
--- a/server/services/musicVideo/castAndSetsPlan.js
+++ b/server/services/musicVideo/castAndSetsPlan.js
@@ -27,6 +27,8 @@
import { trimTo } from '../../lib/textUtils.js';
import { isOutsideMusicVideoReference } from '../../lib/musicVideoConditioning.js';
+// A sentence naming a person or the protagonist puts someone in an empty plate.
+import { withoutPeople } from '../../lib/musicVideoCreativeContext.js';
import { songSections } from './castAndSetsDirection.js';
export const CAST_SETS_IMAGE_SIZE = Object.freeze({ width: 1536, height: 1024 });
@@ -46,17 +48,6 @@ const sentence = (s) => {
};
const join = (...parts) => parts.map(sentence).filter(Boolean).join(' ');
-// A sentence naming a person or the protagonist puts someone in an empty plate.
-const PERSON = /\b(she|he|her|hers|him|his|they|them|their|woman|women|man|men|girl|boy|person|people|figure|figures|silhouette|someone|somebody|protagonist|character|singer|drummer|dancer)\b/i;
-
-/** `text` without the sentences that describe a person (or `name`). */
-function withoutPeople(text, name = '') {
- const who = String(name || '').trim().toLowerCase();
- return String(text || '').split(/(?<=[.!?])\s+/)
- .filter((part) => part.trim() && !PERSON.test(part) && !(who.length >= 3 && part.toLowerCase().includes(who)))
- .join(' ');
-}
-
function identity(p) {
return [p.face && `face: ${p.face}`, p.hair && `hair: ${p.hair}`].filter(Boolean).join('; ');
}
diff --git a/server/services/musicVideo/handoff.js b/server/services/musicVideo/handoff.js
index 3d165f3236..6fa633d221 100644
--- a/server/services/musicVideo/handoff.js
+++ b/server/services/musicVideo/handoff.js
@@ -1,6 +1,6 @@
import { shotActionPrompt } from '../../lib/musicVideoActionContract.js';
import { shotCameraPrompt } from '../../lib/cameraMovements.js';
-import { musicVideoCreativeContext } from '../../lib/musicVideoCreativeContext.js';
+import { musicVideoCreativeContext, musicVideoDirectorLook } from '../../lib/musicVideoCreativeContext.js';
import { MOTION_CONTINUITY_CLAUSE } from '../../lib/musicVideoMotion.js';
import { isOutsideMusicVideoReference } from '../../lib/musicVideoConditioning.js';
/**
@@ -93,7 +93,7 @@ function composePrompt(primary, fallback, project, clause, { motion = false } =
return [
primary?.trim() || fallback?.trim() || '',
project.concept?.style?.trim() || '',
- musicVideoCreativeContext(project.concept, { moodBoard: !motion }),
+ musicVideoCreativeContext(project.concept, { moodBoard: !motion, look: musicVideoDirectorLook(project) }),
visualDirection(project.visualSpec),
clause?.trim() || '',
motion ? MOTION_CONTINUITY_CLAUSE : '',
diff --git a/server/services/musicVideo/handoff.test.js b/server/services/musicVideo/handoff.test.js
index db93ed8dc8..0616b5ff89 100644
--- a/server/services/musicVideo/handoff.test.js
+++ b/server/services/musicVideo/handoff.test.js
@@ -134,6 +134,35 @@ describe('buildHandoffManifest typography (#8992)', () => {
expect(manifest.scenes[0].shotPrompt).toContain('Universe style: Ink silhouettes');
});
+describe('frame prompt look (mood board people stay out)', () => {
+ const scene = { framePrompt: 'An editing bay at night', prompt: 'Slow push in' };
+ const boardCaptions = 'Example board image; A young woman with loose hair leans out of a car window\nAmber window light, 35mm grain. She looks into the lens.\nAvoid: people, glossy CG';
+
+ it('drops person sentences from a mood board snapshot', async () => {
+ const { sceneFramePrompt } = await import('./handoff.js');
+ const prompt = sceneFramePrompt({ concept: { moodBoardStyle: boardCaptions }, visualSpec: {} }, scene);
+ expect(prompt).toContain('Amber window light, 35mm grain.');
+ expect(prompt).toContain('Avoid: people, glossy CG');
+ expect(prompt).not.toMatch(/woman|car window|She looks/);
+ });
+
+ it("uses the Cast & Sets director's look instead of the board snapshot", async () => {
+ const { sceneFramePrompt } = await import('./handoff.js');
+ const project = {
+ concept: { moodBoardStyle: boardCaptions },
+ visualSpec: {},
+ castAndSets: { status: 'approved', direction: { look: 'Hazy window daylight, worn wood, 35mm grain. She stands by the desk.' } },
+ };
+ const prompt = sceneFramePrompt(project, scene);
+ expect(prompt).toContain('Look (palette, light and texture only): Hazy window daylight, worn wood, 35mm grain.');
+ expect(prompt).not.toMatch(/Mood board look|Amber window light|She stands|woman/);
+ // Skipped Cast & Sets falls back to the (filtered) board snapshot.
+ const skipped = sceneFramePrompt({ ...project, castAndSets: { ...project.castAndSets, status: 'skipped' } }, scene);
+ expect(skipped).toContain('Amber window light');
+ expect(skipped).not.toContain('Hazy window daylight');
+ });
+});
+
describe('sceneShotPrompt camera block (#10589)', () => {
it('appends the four-part camera block for a planned shot, and nothing otherwise', async () => {
const { sceneShotPrompt } = await import('./handoff.js');