@sogni-ai/sogni-intelligence-client 4.22.9 → 4.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/contracts/data/promptContracts.d.ts.map +1 -1
- package/dist/contracts/data/promptContracts.js +35 -28
- package/dist/contracts/data/promptContracts.js.map +1 -1
- package/dist/contracts/idLoraPrompt.js +1 -1
- package/dist/contracts/imagePrompt.d.ts +1 -0
- package/dist/contracts/imagePrompt.d.ts.map +1 -1
- package/dist/contracts/imagePrompt.js +5 -5
- package/dist/contracts/imagePrompt.js.map +1 -1
- package/dist/contracts/toolPromptMarkers.d.ts +1 -1
- package/dist/contracts/toolPromptMarkers.d.ts.map +1 -1
- package/dist/contracts/toolPromptMarkers.js +1 -1
- package/dist/contracts/toolPromptMarkers.js.map +1 -1
- package/dist/contracts/videoComposition.d.ts.map +1 -1
- package/dist/contracts/videoComposition.js +25 -23
- package/dist/contracts/videoComposition.js.map +1 -1
- package/dist/prompt-guides/happyhorse.d.ts +8 -0
- package/dist/prompt-guides/happyhorse.d.ts.map +1 -0
- package/dist/prompt-guides/happyhorse.js +55 -0
- package/dist/prompt-guides/happyhorse.js.map +1 -0
- package/dist/prompt-guides/image.d.ts +5 -0
- package/dist/prompt-guides/image.d.ts.map +1 -0
- package/dist/prompt-guides/image.js +80 -0
- package/dist/prompt-guides/image.js.map +1 -0
- package/dist/prompt-guides/index.d.ts +9 -0
- package/dist/prompt-guides/index.d.ts.map +1 -0
- package/dist/prompt-guides/index.js +70 -0
- package/dist/prompt-guides/index.js.map +1 -0
- package/dist/prompt-guides/ltx.d.ts +8 -0
- package/dist/prompt-guides/ltx.d.ts.map +1 -0
- package/dist/prompt-guides/ltx.js +135 -0
- package/dist/prompt-guides/ltx.js.map +1 -0
- package/dist/prompt-guides/minimax.d.ts +31 -0
- package/dist/prompt-guides/minimax.d.ts.map +1 -0
- package/dist/prompt-guides/minimax.js +172 -0
- package/dist/prompt-guides/minimax.js.map +1 -0
- package/dist/prompt-guides/registry.d.ts +7 -0
- package/dist/prompt-guides/registry.d.ts.map +1 -0
- package/dist/prompt-guides/registry.js +100 -0
- package/dist/prompt-guides/registry.js.map +1 -0
- package/dist/prompt-guides/seedance.d.ts +10 -0
- package/dist/prompt-guides/seedance.d.ts.map +1 -0
- package/dist/prompt-guides/seedance.js +155 -0
- package/dist/prompt-guides/seedance.js.map +1 -0
- package/dist/prompt-guides/shared.d.ts +3 -0
- package/dist/prompt-guides/shared.d.ts.map +1 -0
- package/dist/prompt-guides/shared.js +6 -0
- package/dist/prompt-guides/shared.js.map +1 -0
- package/dist/prompt-guides/types.d.ts +19 -0
- package/dist/prompt-guides/types.d.ts.map +1 -0
- package/dist/prompt-guides/types.js +15 -0
- package/dist/prompt-guides/types.js.map +1 -0
- package/dist/prompt-guides/wan.d.ts +3 -0
- package/dist/prompt-guides/wan.d.ts.map +1 -0
- package/dist/prompt-guides/wan.js +78 -0
- package/dist/prompt-guides/wan.js.map +1 -0
- package/dist/prompt-guides/wan3.d.ts +12 -0
- package/dist/prompt-guides/wan3.d.ts.map +1 -0
- package/dist/prompt-guides/wan3.js +51 -0
- package/dist/prompt-guides/wan3.js.map +1 -0
- package/dist/public-skill-runtime/index.d.ts.map +1 -1
- package/dist/public-skill-runtime/index.js +76 -96
- package/dist/public-skill-runtime/index.js.map +1 -1
- package/dist/tools/definitions/animate-photo/definition.js +10 -10
- package/dist/tools/definitions/animate-photo/definition.js.map +1 -1
- package/dist/tools/definitions/extend-video/definition.js +1 -1
- package/dist/tools/definitions/extend-video/definition.js.map +1 -1
- package/dist/tools/definitions/generate-video/definition.js +6 -6
- package/dist/tools/definitions/generate-video/definition.js.map +1 -1
- package/dist/tools/definitions/sound-to-video/definition.js +3 -3
- package/dist/tools/definitions/video-to-video/definition.js +2 -2
- package/dist-esm/contracts/data/promptContracts.js +35 -28
- package/dist-esm/contracts/data/promptContracts.js.map +1 -1
- package/dist-esm/contracts/idLoraPrompt.js +1 -1
- package/dist-esm/contracts/imagePrompt.js +2 -2
- package/dist-esm/contracts/imagePrompt.js.map +1 -1
- package/dist-esm/contracts/toolPromptMarkers.js +1 -1
- package/dist-esm/contracts/toolPromptMarkers.js.map +1 -1
- package/dist-esm/contracts/videoComposition.js +25 -23
- package/dist-esm/contracts/videoComposition.js.map +1 -1
- package/dist-esm/prompt-guides/happyhorse.js +52 -0
- package/dist-esm/prompt-guides/happyhorse.js.map +1 -0
- package/dist-esm/prompt-guides/image.js +77 -0
- package/dist-esm/prompt-guides/image.js.map +1 -0
- package/dist-esm/prompt-guides/index.js +8 -0
- package/dist-esm/prompt-guides/index.js.map +1 -0
- package/dist-esm/prompt-guides/ltx.js +132 -0
- package/dist-esm/prompt-guides/ltx.js.map +1 -0
- package/dist-esm/prompt-guides/minimax.js +169 -0
- package/dist-esm/prompt-guides/minimax.js.map +1 -0
- package/dist-esm/prompt-guides/registry.js +95 -0
- package/dist-esm/prompt-guides/registry.js.map +1 -0
- package/dist-esm/prompt-guides/seedance.js +152 -0
- package/dist-esm/prompt-guides/seedance.js.map +1 -0
- package/dist-esm/prompt-guides/shared.js +3 -0
- package/dist-esm/prompt-guides/shared.js.map +1 -0
- package/dist-esm/prompt-guides/types.js +12 -0
- package/dist-esm/prompt-guides/types.js.map +1 -0
- package/dist-esm/prompt-guides/wan.js +75 -0
- package/dist-esm/prompt-guides/wan.js.map +1 -0
- package/dist-esm/prompt-guides/wan3.js +48 -0
- package/dist-esm/prompt-guides/wan3.js.map +1 -0
- package/dist-esm/public-skill-runtime/index.js +76 -96
- package/dist-esm/public-skill-runtime/index.js.map +1 -1
- package/dist-esm/tools/definitions/animate-photo/definition.js +10 -10
- package/dist-esm/tools/definitions/animate-photo/definition.js.map +1 -1
- package/dist-esm/tools/definitions/extend-video/definition.js +1 -1
- package/dist-esm/tools/definitions/extend-video/definition.js.map +1 -1
- package/dist-esm/tools/definitions/generate-video/definition.js +6 -6
- package/dist-esm/tools/definitions/generate-video/definition.js.map +1 -1
- package/dist-esm/tools/definitions/sound-to-video/definition.js +3 -3
- package/dist-esm/tools/definitions/video-to-video/definition.js +2 -2
- package/package.json +11 -2
|
@@ -863,7 +863,7 @@ function compileStoryboardImagePromptFromProject(project) {
|
|
|
863
863
|
...compileStoryboardReferenceSection(project),
|
|
864
864
|
'',
|
|
865
865
|
'STYLE:',
|
|
866
|
-
`${project.creativeBrief.visualQualityBar} with cinematic shot language, coherent art direction, readable labels, and consistent reference usage.`,
|
|
866
|
+
`${project.creativeBrief.visualQualityBar || 'Storyboard sheet'} with cinematic shot language, coherent art direction, readable labels, and consistent reference usage.`,
|
|
867
867
|
'Reference-driven personality: before drawing, infer concrete visual and behavioral cues from uploaded/reference images, including character attitude, materials, props, palette, brand tone, typography style, and implied world. Let those cues make this storyboard specific to the supplied subject instead of a generic reusable template.',
|
|
868
868
|
'Vary composition within the required grid: keep the exact scene count, layout, and cell geometry, and make each panel intentionally staged with distinct shot scale, pose/action, camera angle, lighting beat, transition idea, and character-specific detail.',
|
|
869
869
|
'',
|
|
@@ -904,7 +904,7 @@ function compileStoryboardKeyframePrompt(project, scene) {
|
|
|
904
904
|
`Visual: ${promptText}.`,
|
|
905
905
|
scene.referenceUsage.length > 0 ? `Reference usage: ${scene.referenceUsage.join('; ')}.` : '',
|
|
906
906
|
scene.textInImage.length > 0 ? `Visible text: ${scene.textInImage.join('; ')}.` : '',
|
|
907
|
-
`Style: ${project.creativeBrief.visualQualityBar}
|
|
907
|
+
project.creativeBrief.visualQualityBar ? `Style: ${project.creativeBrief.visualQualityBar}.` : '',
|
|
908
908
|
'Do not include storyboard panel labels, timecodes, production notes, or metadata labels inside the frame.',
|
|
909
909
|
].filter(Boolean).join('\n');
|
|
910
910
|
}
|
|
@@ -924,8 +924,8 @@ function compileSeedanceSceneClipPromptFromProject(project, scene, referenceTag)
|
|
|
924
924
|
scene.audioSfx.length > 0 ? `Audio/SFX: ${scene.audioSfx.join(', ')}.` : '',
|
|
925
925
|
scene.music ? `Music: ${scene.music}.` : '',
|
|
926
926
|
scene.textInImage.length > 0 ? `Required visible text: ${scene.textInImage.join('; ')}.` : '',
|
|
927
|
-
`Style: ${project.creativeBrief.visualQualityBar}
|
|
928
|
-
'Use the reference as identity and composition guidance.
|
|
927
|
+
project.creativeBrief.visualQualityBar ? `Style: ${project.creativeBrief.visualQualityBar}.` : '',
|
|
928
|
+
'Use the reference as identity and composition guidance. Only the visible text listed here appears on screen.',
|
|
929
929
|
].filter(Boolean).join('\n');
|
|
930
930
|
}
|
|
931
931
|
function compactSceneVideoPrompt(project, scene, referenceTag) {
|
|
@@ -1211,6 +1211,7 @@ export function compileForModel(modelId, storyboard, input) {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
const PUBLIC_SEEDANCE_PRIMARY_IMAGE_REF = formatModelRef('seedance', 1, 'image');
|
|
1213
1213
|
export const SEEDANCE_STORYBOARD_REFERENCE_PROMPT = `Create a full-screen cinematic video from the storyboard in ${PUBLIC_SEEDANCE_PRIMARY_IMAGE_REF}. Treat ${PUBLIC_SEEDANCE_PRIMARY_IMAGE_REF} as the controlling source for shot order and intent, and as a source layout reference: use the thumbnails, timing, Dialogue/VO, Audio/SFX, timecodes, camera/motion notes, transitions, and scene order as instructions, not as a visual board to reproduce. Do not display the storyboard grid, borders, caption bars, storyboard title/footer text, panel numbers, section labels, slide titles, headings, or transcribed narration. Convert the ordered thumbnails into full-screen chronological beats; do not reuse only one or two motifs while skipping panels. When the board has panel titles, captions, section numbers, slide titles, or headings but no formal Dialogue/VO labels, treat those labels as short audio-only narration/voiceover or key-message beats in order unless they are clearly visual-only metadata. Voice each label as its own brief phrase with a pause; do not concatenate labels into run-on sentences and do not speak panel numbers. Show storyboard labels as visible text only when the user explicitly asks for visible text, subtitles, a title card, lower third, signage, or a title/end frame. Preserve the story spine, character/product/reference continuity, and cause-and-effect progression between beats. Treat transitions as motion instructions, not unrelated hard cuts unless the storyboard explicitly asks for hard cuts. Use brand color, lighting, product imagery, and composition instead of invented typography. Keep visible text limited to exact copy the user or storyboard explicitly marks as on-screen text, signage, title text, or end-frame text. Use a music/SFX arc that follows the storyboard audio notes and lands the final beat. Keep unrelated UI, extra logos, microtext, subtitles, and extra scenes out of the frame.`;
|
|
1214
|
+
const SEEDANCE_STORYBOARD_FULL_FRAME_LINE = 'Each shot fills the whole frame as moving footage of its scene, in the look the storyboard shows.';
|
|
1214
1215
|
export const SEEDANCE_V2V_REFERENCE_MAX_DURATION_SECONDS = 15;
|
|
1215
1216
|
function asciiAt(data, start, length) {
|
|
1216
1217
|
if (data.length < start + length)
|
|
@@ -2030,7 +2031,7 @@ export function formatAudioIdPrompt(prompt, voiceName) {
|
|
|
2030
2031
|
if (speechLines) {
|
|
2031
2032
|
sections.push(speechLines);
|
|
2032
2033
|
}
|
|
2033
|
-
sections.push('', '[SOUNDS]'
|
|
2034
|
+
sections.push('', '[SOUNDS]');
|
|
2034
2035
|
return sections.join('\n');
|
|
2035
2036
|
}
|
|
2036
2037
|
export function getVideoPromptGuardrailPlan({ prompt, duration, frames, fps, durationExplicit, referenceAudioIdentity, voiceName } = {}) {
|
|
@@ -2123,9 +2124,6 @@ export function selectDefaultVideoModel(workflow, opts = {}, config) {
|
|
|
2123
2124
|
return resolveLtx25WorkflowModelForQuality('v2v', opts.quality);
|
|
2124
2125
|
if (workflow === 't2v')
|
|
2125
2126
|
return resolveLtx25WorkflowModelForQuality('t2v', opts.quality);
|
|
2126
|
-
if (workflow === 'i2v' && (opts.referenceAudioIdentity || promptNeedsLtxNativeAudio(opts.prompt) || opts.quality === 'hq' || opts.quality === 'pro')) {
|
|
2127
|
-
return resolveLtx25WorkflowModelForQuality('i2v', opts.quality);
|
|
2128
|
-
}
|
|
2129
2127
|
return VIDEO_WORKFLOW_DEFAULT_MODELS[workflow] || null;
|
|
2130
2128
|
}
|
|
2131
2129
|
export function dimensionsWithShortSide(width, height, shortSide) {
|
|
@@ -2142,11 +2140,8 @@ export function dimensionsWithShortSide(width, height, shortSide) {
|
|
|
2142
2140
|
height: Math.round(h * scale)
|
|
2143
2141
|
};
|
|
2144
2142
|
}
|
|
2145
|
-
function textMentionsPortraitSocialFormat(text) {
|
|
2146
|
-
return /\b(?:tiktok|tik\s*tok|reels?|shorts|story)\b/i.test(text);
|
|
2147
|
-
}
|
|
2148
2143
|
function hasPortraitResolutionHint(text) {
|
|
2149
|
-
return /\b(?:portrait|vertical)\b/i.test(text)
|
|
2144
|
+
return /\b(?:portrait|vertical)\b/i.test(text);
|
|
2150
2145
|
}
|
|
2151
2146
|
function hasLandscapeResolutionHint(text) {
|
|
2152
2147
|
return /\b(landscape|horizontal|wide(?:screen)?|cinematic|youtube)\b/i.test(text);
|
|
@@ -2843,7 +2838,7 @@ export function planSeedanceStoryboardFallback(input) {
|
|
|
2843
2838
|
if (userProvidedDuration && intendedDuration > maxDuration)
|
|
2844
2839
|
return null;
|
|
2845
2840
|
return {
|
|
2846
|
-
prompt: buildSeedanceStoryboardReferencePrompt(userIntentText
|
|
2841
|
+
prompt: buildSeedanceStoryboardReferencePrompt(userIntentText),
|
|
2847
2842
|
duration: Math.max(minDuration, Math.min(maxDuration, intendedDuration)),
|
|
2848
2843
|
referenceImageIndices: input.referenceImageIndices ?? [-1],
|
|
2849
2844
|
skipPromptProcessing: true,
|
|
@@ -2852,12 +2847,8 @@ export function planSeedanceStoryboardFallback(input) {
|
|
|
2852
2847
|
...(storyboardAspectRatio ? { aspectRatio: storyboardAspectRatio } : {}),
|
|
2853
2848
|
};
|
|
2854
2849
|
}
|
|
2855
|
-
function buildSeedanceStoryboardReferencePrompt(userIntentText
|
|
2856
|
-
|
|
2857
|
-
return SEEDANCE_STORYBOARD_REFERENCE_PROMPT;
|
|
2858
|
-
const additionalDirection = userIntentText
|
|
2859
|
-
.replace(/\s+/g, ' ')
|
|
2860
|
-
.trim();
|
|
2850
|
+
function buildSeedanceStoryboardReferencePrompt(userIntentText) {
|
|
2851
|
+
const additionalDirection = userIntentText.trim();
|
|
2861
2852
|
if (!additionalDirection)
|
|
2862
2853
|
return SEEDANCE_STORYBOARD_REFERENCE_PROMPT;
|
|
2863
2854
|
return `${SEEDANCE_STORYBOARD_REFERENCE_PROMPT} Additional user direction to honor while following the storyboard: ${additionalDirection}`;
|
|
@@ -3232,8 +3223,6 @@ function inferStoryboardBoardAspectRatio(text) {
|
|
|
3232
3223
|
const explicitRatio = inferExplicitAspectRatioFromText(text);
|
|
3233
3224
|
if (explicitRatio)
|
|
3234
3225
|
return `${explicitRatio.width}:${explicitRatio.height}`;
|
|
3235
|
-
if (textMentionsPortraitSocialFormat(text))
|
|
3236
|
-
return '9:16';
|
|
3237
3226
|
return '16:9';
|
|
3238
3227
|
}
|
|
3239
3228
|
function inferExplicitStoryboardTargetVideoAspectRatio(text) {
|
|
@@ -3271,7 +3260,7 @@ function inferStoryboardTargetVideoAspect(text, boardAspectRatio, explicitTarget
|
|
|
3271
3260
|
if (explicitTargetVideoAspectRatio) {
|
|
3272
3261
|
return { aspectRatio: explicitTargetVideoAspectRatio, source: 'explicit_ratio' };
|
|
3273
3262
|
}
|
|
3274
|
-
if (/\b(?:portrait|vertical|9\s*:\s*16)\b/i.test(text)
|
|
3263
|
+
if (/\b(?:portrait|vertical|9\s*:\s*16)\b/i.test(text)) {
|
|
3275
3264
|
return { aspectRatio: '9:16', source: 'orientation_cue' };
|
|
3276
3265
|
}
|
|
3277
3266
|
if (/\b(?:landscape|horizontal|widescreen|16\s*:\s*9|youtube)\b/i.test(text)) {
|
|
@@ -4348,13 +4337,6 @@ function inferStoryboardTitle(text) {
|
|
|
4348
4337
|
function compactStoryboardLine(value, fallback = '') {
|
|
4349
4338
|
return String(value || fallback).replace(/\s+/g, ' ').trim();
|
|
4350
4339
|
}
|
|
4351
|
-
function truncateStoryboardText(value, maxLength, fallback = '') {
|
|
4352
|
-
const compact = compactStoryboardLine(value, fallback);
|
|
4353
|
-
if (compact.length <= maxLength)
|
|
4354
|
-
return compact;
|
|
4355
|
-
const truncated = compact.slice(0, maxLength).replace(/\s+\S*$/, '').replace(/[,;:.\s]+$/g, '').trim();
|
|
4356
|
-
return truncated || compact.slice(0, maxLength).trim();
|
|
4357
|
-
}
|
|
4358
4340
|
function cleanStoryboardNarrativeSourceText(value) {
|
|
4359
4341
|
return stripGeneratedStoryboardLayoutHints(String(value || ''))
|
|
4360
4342
|
.split(/\r?\n/)
|
|
@@ -5453,18 +5435,6 @@ function sceneTextRequirementsFromSection(section) {
|
|
|
5453
5435
|
function isNoAudioPlaceholder(value) {
|
|
5454
5436
|
return /^(?:no\s+(?:audio|sound|sfx|audio\/sfx)(?:\s+specified)?|none|n\/a|not\s+specified)\.?$/i.test(value.trim());
|
|
5455
5437
|
}
|
|
5456
|
-
function sanitizeStoryboardExternalAudioReferences(value) {
|
|
5457
|
-
let sanitized = value;
|
|
5458
|
-
sanitized = sanitized
|
|
5459
|
-
.replace(/\b(?:trending|viral|popular)\s+(?:TikTok\s+)?(?:audio|sound|song|track)\b/gi, 'video-model-generated social-video music bed')
|
|
5460
|
-
.replace(/\b(?:a\s+)?(?:trending|viral|popular)\s+(?:upbeat\s+)?(?:audio|sound|song|track)\b/gi, 'a video-model-generated upbeat social-video music bed')
|
|
5461
|
-
.replace(/\b(?:existing|external|licensed|commercial)\s+(?:audio|sound|song|track|music)\b/gi, 'generated audio');
|
|
5462
|
-
sanitized = sanitized.replace(/\b(?:all\s+)?(?:cuts?|edits?|transitions?)\s+(?:must\s+|should\s+)?(?:align|sync|cut)\s+(?:perfectly\s+|exactly\s+)?(?:with|to)\s+([^.!?\n]*(?:beat|beats|drop|drops|snare|hi[-/\s]?hat|kick|percussion)[^.!?\n]*)[.!?]?/gi, 'Cuts should follow a generated music bed, with percussion hits, beat drops, whooshes, and foley cues described for the video model.');
|
|
5463
|
-
if (/\b(?:snare|hi-hat|beat drops?|cuts?)\b/i.test(sanitized) && /\bvideo-model-generated\b/i.test(sanitized)) {
|
|
5464
|
-
sanitized = sanitized.replace(/\bperfectly\b/gi, 'clearly');
|
|
5465
|
-
}
|
|
5466
|
-
return sanitized;
|
|
5467
|
-
}
|
|
5468
5438
|
function splitStoryboardSfxAtTopLevel(value) {
|
|
5469
5439
|
const result = [];
|
|
5470
5440
|
let buffer = '';
|
|
@@ -5522,11 +5492,39 @@ function splitStoryboardSfxAtTopLevel(value) {
|
|
|
5522
5492
|
return result;
|
|
5523
5493
|
}
|
|
5524
5494
|
function normalizeStoryboardAudioSfx(value) {
|
|
5525
|
-
const compact =
|
|
5495
|
+
const compact = compactStoryboardLine(value);
|
|
5526
5496
|
if (!compact || isNoAudioPlaceholder(compact))
|
|
5527
5497
|
return [];
|
|
5528
5498
|
return splitStoryboardSfxAtTopLevel(compact).filter(Boolean);
|
|
5529
5499
|
}
|
|
5500
|
+
const STORYBOARD_DIALOGUE_FIELD_LABELS = ['Dialogue/VO', 'VO/Dialogue', 'Dialogue', 'VO', 'V.O.', 'Voiceover', 'Voice-over', 'Speech', 'Narration'];
|
|
5501
|
+
const STORYBOARD_AUDIO_FIELD_LABELS = ['Audio/SFX', 'Audio/Foley', 'Foley/SFX', 'Audio', 'SFX', 'FX', 'Foley', 'Sound', 'Sounds'];
|
|
5502
|
+
const STORYBOARD_PURPOSE_FIELD_LABELS = ['Purpose', 'Story purpose', 'Narrative purpose', 'Beat purpose', 'Scene purpose', 'Why this beat exists'];
|
|
5503
|
+
const STORYBOARD_PRODUCT_FEATURE_FIELD_LABELS = ['Product/Feature', 'Product feature', 'Feature mapping', 'Product meaning', 'Product idea', 'Feature', 'Capability'];
|
|
5504
|
+
const STORYBOARD_ACTION_FIELD_LABELS = ['Action/Motion', 'Action', 'Motion', 'Performance', 'Beat'];
|
|
5505
|
+
const STORYBOARD_CAMERA_FIELD_LABELS = ['Camera/Motion', 'Camera', 'Framing', 'Shot type'];
|
|
5506
|
+
const STORYBOARD_LIGHTING_FIELD_LABELS = ['Lighting/Style', 'Lighting', 'Style', 'Look'];
|
|
5507
|
+
const STORYBOARD_TRANSITION_IN_FIELD_LABELS = ['Transition in', 'Transition-in', 'In'];
|
|
5508
|
+
const STORYBOARD_TRANSITION_OUT_FIELD_LABELS = ['Transition', 'Transition out', 'Transition-out', 'Edit'];
|
|
5509
|
+
const STORYBOARD_MUSIC_FIELD_LABELS = ['Music', 'Score', 'Underscore'];
|
|
5510
|
+
const STORYBOARD_SEPARATELY_PARSED_FIELD_LINE = new RegExp(String.raw `^\s*(?:${[
|
|
5511
|
+
STORYBOARD_DIALOGUE_FIELD_LABELS,
|
|
5512
|
+
STORYBOARD_AUDIO_FIELD_LABELS,
|
|
5513
|
+
STORYBOARD_PURPOSE_FIELD_LABELS,
|
|
5514
|
+
STORYBOARD_PRODUCT_FEATURE_FIELD_LABELS,
|
|
5515
|
+
STORYBOARD_ACTION_FIELD_LABELS,
|
|
5516
|
+
STORYBOARD_CAMERA_FIELD_LABELS,
|
|
5517
|
+
STORYBOARD_LIGHTING_FIELD_LABELS,
|
|
5518
|
+
STORYBOARD_TRANSITION_IN_FIELD_LABELS,
|
|
5519
|
+
STORYBOARD_TRANSITION_OUT_FIELD_LABELS,
|
|
5520
|
+
STORYBOARD_MUSIC_FIELD_LABELS,
|
|
5521
|
+
].flat().map(storyboardFieldLabelPattern).join('|')})(?:\s*\([^)\n]{0,80}\))?\s*:`, 'i');
|
|
5522
|
+
function storyboardSectionProse(body) {
|
|
5523
|
+
return compactStoryboardLine(stripStoryboardMarkup(body)
|
|
5524
|
+
.split(/\r?\n/)
|
|
5525
|
+
.filter(line => !STORYBOARD_SEPARATELY_PARSED_FIELD_LINE.test(line.replace(/^\s*#{1,6}\s*/, '')))
|
|
5526
|
+
.join(' '));
|
|
5527
|
+
}
|
|
5530
5528
|
function buildSceneFromSection(section, references, fallbackTiming, planningContract) {
|
|
5531
5529
|
const combined = `${section.heading}\n${section.body}`;
|
|
5532
5530
|
const timingSource = `${section.heading.replace(/^\s*(?:[-*+>#_]{1,6}\s*)*(?:[*_]{1,3})?\s*(?:Scene|Shot|Beat|Panel|Frame)\s*_?\s*\d{1,2}\b\s*(?:[-:.)|]\s*)?/i, '')}\n${section.body}`;
|
|
@@ -5535,17 +5533,7 @@ function buildSceneFromSection(section, references, fallbackTiming, planningCont
|
|
|
5535
5533
|
.replace(/^\s*#{1,6}\s*/, '');
|
|
5536
5534
|
const title = compactStoryboardLine(removeStoryboardTimingText(normalizedHeading
|
|
5537
5535
|
.replace(/^\s*(?:Scene|Shot|Beat|Panel|Frame)\s*\d{1,2}\b\s*(?:[-:.)|]\s*)?/i, '')), `Scene ${String(section.number).padStart(2, '0')}`);
|
|
5538
|
-
const dialogueField = extractStoryboardField(combined,
|
|
5539
|
-
'Dialogue/VO',
|
|
5540
|
-
'VO/Dialogue',
|
|
5541
|
-
'Dialogue',
|
|
5542
|
-
'VO',
|
|
5543
|
-
'V.O.',
|
|
5544
|
-
'Voiceover',
|
|
5545
|
-
'Voice-over',
|
|
5546
|
-
'Speech',
|
|
5547
|
-
'Narration',
|
|
5548
|
-
]);
|
|
5536
|
+
const dialogueField = extractStoryboardField(combined, STORYBOARD_DIALOGUE_FIELD_LABELS);
|
|
5549
5537
|
const hasExplicitNoDialogueField = /\b(?:Dialogue\/VO|VO\/Dialogue|Dialogue|VO|V\.O\.|Voiceover|Voice-over|Speech|Narration)\s*:\s*(?:none|no\s+(?:spoken\s+)?(?:dialogue|vo|voiceover|voice-over|speech)|n\/a|not\s+specified|text\s+only)\b/i.test(combined);
|
|
5550
5538
|
const dialogue = dialogueField
|
|
5551
5539
|
? normalizeStoryboardDialogue(dialogueField)
|
|
@@ -5554,7 +5542,7 @@ function buildSceneFromSection(section, references, fallbackTiming, planningCont
|
|
|
5554
5542
|
: /\b(?:VO|V\.O\.|voiceover|voice-over|dialogue|speech|narration|says?|speaks?|whispers?|shouts?)\b/i.test(combined)
|
|
5555
5543
|
? extractQuotedDialogueSegments(combined)[0] || ''
|
|
5556
5544
|
: '';
|
|
5557
|
-
const audio = extractStoryboardField(combined,
|
|
5545
|
+
const audio = extractStoryboardField(combined, STORYBOARD_AUDIO_FIELD_LABELS);
|
|
5558
5546
|
const audioSfx = normalizeStoryboardAudioSfx(audio);
|
|
5559
5547
|
const metadataLabels = normalizeStoryboardContractTextArray(planningContract?.metadataLabels);
|
|
5560
5548
|
const hasTypedVisibleText = Array.isArray(planningContract?.visibleText);
|
|
@@ -5570,17 +5558,19 @@ function buildSceneFromSection(section, references, fallbackTiming, planningCont
|
|
|
5570
5558
|
startSec: timing?.startSec ?? null,
|
|
5571
5559
|
endSec: timing?.endSec ?? null,
|
|
5572
5560
|
durationSec: timing?.durationSec ?? null,
|
|
5573
|
-
purpose: extractStoryboardField(combined,
|
|
5574
|
-
productFeature: extractStoryboardField(combined,
|
|
5575
|
-
visual: extractStoryboardField(combined, ['Visual/Action', 'Visual Frame', 'Visual', 'Frame', 'Image', 'Shot'])
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5561
|
+
purpose: extractStoryboardField(combined, STORYBOARD_PURPOSE_FIELD_LABELS),
|
|
5562
|
+
productFeature: extractStoryboardField(combined, STORYBOARD_PRODUCT_FEATURE_FIELD_LABELS),
|
|
5563
|
+
visual: extractStoryboardField(combined, ['Visual/Action', 'Visual Frame', 'Visual', 'Frame', 'Image', 'Shot'])
|
|
5564
|
+
|| storyboardSectionProse(section.body)
|
|
5565
|
+
|| compactStoryboardLine(section.body),
|
|
5566
|
+
action: extractStoryboardField(combined, STORYBOARD_ACTION_FIELD_LABELS),
|
|
5567
|
+
camera: extractStoryboardField(combined, STORYBOARD_CAMERA_FIELD_LABELS),
|
|
5568
|
+
lighting: extractStoryboardField(combined, STORYBOARD_LIGHTING_FIELD_LABELS),
|
|
5569
|
+
transitionIn: extractStoryboardField(combined, STORYBOARD_TRANSITION_IN_FIELD_LABELS),
|
|
5570
|
+
transitionOut: extractStoryboardField(combined, STORYBOARD_TRANSITION_OUT_FIELD_LABELS),
|
|
5581
5571
|
dialogue,
|
|
5582
5572
|
audioSfx,
|
|
5583
|
-
music:
|
|
5573
|
+
music: extractStoryboardField(combined, STORYBOARD_MUSIC_FIELD_LABELS),
|
|
5584
5574
|
referenceUsage,
|
|
5585
5575
|
textInImage: removeStoryboardMetadataLabelsFromVisibleText(visibleText, metadataLabels),
|
|
5586
5576
|
metadataLabels,
|
|
@@ -5909,7 +5899,7 @@ function inferStoryboardToneProgression(text) {
|
|
|
5909
5899
|
return progression.split(/\s*(?:->|,|;|\|)\s*/).map(item => item.trim()).filter(Boolean);
|
|
5910
5900
|
}
|
|
5911
5901
|
function cleanStoryboardStorySpine(value) {
|
|
5912
|
-
const cleaned =
|
|
5902
|
+
const cleaned = compactStoryboardLine(stripStoryboardMarkup(value))
|
|
5913
5903
|
.replace(/^[:*_\-\s]+|[:*_\-\s]+$/g, '')
|
|
5914
5904
|
.trim();
|
|
5915
5905
|
if (!cleaned || /^[*_\-:.\s]+$/.test(cleaned))
|
|
@@ -5949,14 +5939,14 @@ function inferStoryboardStorySpineFromHeading(text) {
|
|
|
5949
5939
|
return '';
|
|
5950
5940
|
}
|
|
5951
5941
|
function inferStoryboardStorySpine(text, fallbackBrief) {
|
|
5952
|
-
const explicit = cleanStoryboardStorySpine(text.match(/\b(?:story\s+spine|narrative\s+spine|throughline|story\s+arc|creative\s+intent)\s*:\s*([^\n]
|
|
5942
|
+
const explicit = cleanStoryboardStorySpine(text.match(/\b(?:story\s+spine|narrative\s+spine|throughline|story\s+arc|creative\s+intent)\s*:\s*([^\n]+)/i)?.[1] || '');
|
|
5953
5943
|
const generatedFallbackPrefix = 'One continuous progression from the source brief:';
|
|
5954
5944
|
if (explicit && !explicit.startsWith(generatedFallbackPrefix))
|
|
5955
5945
|
return explicit;
|
|
5956
5946
|
const fromHeading = inferStoryboardStorySpineFromHeading(text);
|
|
5957
5947
|
if (fromHeading && !fromHeading.startsWith(generatedFallbackPrefix))
|
|
5958
5948
|
return fromHeading;
|
|
5959
|
-
const compactFallback =
|
|
5949
|
+
const compactFallback = compactStoryboardLine(cleanStoryboardNarrativeSourceText(fallbackBrief || text));
|
|
5960
5950
|
if (compactFallback) {
|
|
5961
5951
|
return `One continuous progression from the source brief: ${compactFallback}`;
|
|
5962
5952
|
}
|
|
@@ -5971,7 +5961,7 @@ function inferStoryboardStorySpineFromScenes(scenes) {
|
|
|
5971
5961
|
.filter(Boolean);
|
|
5972
5962
|
if (beats.length === 0)
|
|
5973
5963
|
return '';
|
|
5974
|
-
return
|
|
5964
|
+
return uniqueStoryboardStrings(beats).join(' -> ');
|
|
5975
5965
|
}
|
|
5976
5966
|
function inferStoryboardProductFeatureMap(text, scenes) {
|
|
5977
5967
|
const explicitLines = text
|
|
@@ -6091,12 +6081,12 @@ export function buildStoryboardProject(options) {
|
|
|
6091
6081
|
const approvedScriptContext = cleanStoryboardNarrativeSourceText(canonicalStoryboardScriptContext(options.approvedScriptContext));
|
|
6092
6082
|
const referencePromptContext = cleanStoryboardNarrativeSourceText(canonicalStoryboardScriptContext(prompt) || prompt);
|
|
6093
6083
|
const primarySourceBrief = selectStoryboardSourceBriefForCompile(options, userIntentText);
|
|
6094
|
-
const sourceText = stripGenericStoryboardVisibleTextMetadata(
|
|
6084
|
+
const sourceText = stripGenericStoryboardVisibleTextMetadata([
|
|
6095
6085
|
cleanStoryboardNarrativeSourceText(primarySourceBrief),
|
|
6096
6086
|
approvedScriptContext
|
|
6097
6087
|
? `APPROVED STORYBOARD SCRIPT CONTEXT TO PRESERVE:\n${approvedScriptContext}`
|
|
6098
6088
|
: '',
|
|
6099
|
-
].filter(Boolean).join('\n\n'))
|
|
6089
|
+
].filter(Boolean).join('\n\n'));
|
|
6100
6090
|
const allText = `${narrativeUserIntentText}\n${sourceText}`;
|
|
6101
6091
|
const layoutTextParts = [userIntentText].filter(Boolean);
|
|
6102
6092
|
if (primarySourceBrief
|
|
@@ -6255,9 +6245,7 @@ export function buildStoryboardProject(options) {
|
|
|
6255
6245
|
mustInclude: mustIncludeText,
|
|
6256
6246
|
mustAvoid: extractStoryboardAvoidConstraints(userConstraintSource),
|
|
6257
6247
|
brandRules: mustIncludeText.length > 0 ? mustIncludeText.map(text => `Preserve exact visible text: "${text}"`) : [],
|
|
6258
|
-
visualQualityBar:
|
|
6259
|
-
? 'production-ready commercial storyboard sheet'
|
|
6260
|
-
: 'clean readable storyboard sheet',
|
|
6248
|
+
visualQualityBar: '',
|
|
6261
6249
|
},
|
|
6262
6250
|
voiceover: {
|
|
6263
6251
|
fullScript: voiceLines.map(line => line.text).join('\n'),
|
|
@@ -6413,13 +6401,16 @@ function compileStoryboardAvoidConstraints(constraints) {
|
|
|
6413
6401
|
'Avoid in-frame comic-book SFX/action text such as Whoosh!, Impact!, Boom!, Thud!, Slash!, Crack!, or Pop!; keep those words in the production notes only.',
|
|
6414
6402
|
];
|
|
6415
6403
|
for (const constraint of constraints) {
|
|
6416
|
-
|
|
6417
|
-
avoidLines.push(/^(?:avoid|without|less|do\s+not|don't)\b/i.test(normalized)
|
|
6418
|
-
? `${normalized}.`
|
|
6419
|
-
: `Avoid ${normalized}.`);
|
|
6404
|
+
avoidLines.push(storyboardUserAvoidLine(constraint));
|
|
6420
6405
|
}
|
|
6421
6406
|
return avoidLines;
|
|
6422
6407
|
}
|
|
6408
|
+
function storyboardUserAvoidLine(constraint) {
|
|
6409
|
+
const normalized = constraint.replace(/[.]+$/g, '').trim();
|
|
6410
|
+
return /^(?:avoid|without|less|do\s+not|don't)\b/i.test(normalized)
|
|
6411
|
+
? `${normalized}.`
|
|
6412
|
+
: `Avoid ${normalized}.`;
|
|
6413
|
+
}
|
|
6423
6414
|
function compileStoryboardAvoidSection(userIntentText) {
|
|
6424
6415
|
return compileStoryboardAvoidConstraints(extractStoryboardAvoidConstraints(userIntentText));
|
|
6425
6416
|
}
|
|
@@ -6621,7 +6612,7 @@ export function compileVideoStoryboardImagePrompt(options) {
|
|
|
6621
6612
|
...compileStoryboardReferenceSection(project),
|
|
6622
6613
|
'',
|
|
6623
6614
|
'STYLE:',
|
|
6624
|
-
`${project.creativeBrief.visualQualityBar} with cinematic shot language, coherent art direction, readable labels, and consistent reference usage.`,
|
|
6615
|
+
`${project.creativeBrief.visualQualityBar || 'Storyboard sheet'} with cinematic shot language, coherent art direction, readable labels, and consistent reference usage.`,
|
|
6625
6616
|
'Reference-driven personality: before drawing, infer concrete visual and behavioral cues from uploaded/reference images, including character attitude, materials, props, palette, brand tone, typography style, and implied world. Let those cues make this storyboard specific to the supplied subject instead of a generic reusable template.',
|
|
6626
6617
|
'Vary composition within the required grid: keep the exact scene count, layout, and cell geometry, and make each panel intentionally staged with distinct shot scale, pose/action, camera angle, lighting beat, transition idea, and character-specific detail.',
|
|
6627
6618
|
'',
|
|
@@ -7259,24 +7250,15 @@ export function compileSeedanceStoryboardPromptFromProject(project, options = {}
|
|
|
7259
7250
|
const aspectRatio = normalizeAspectRatio(options.aspectRatio ?? project.targetVideoAspectRatio)
|
|
7260
7251
|
?? project.targetVideoAspectRatio
|
|
7261
7252
|
?? '16:9';
|
|
7262
|
-
const
|
|
7263
|
-
...project.creativeBrief.mustAvoid,
|
|
7264
|
-
'Do not render the storyboard board, grid, captions, panel dividers, thumbnails, or collage layout as the video.',
|
|
7265
|
-
'Do not add readable text beyond the exact visible text specified by the storyboard scenes.',
|
|
7266
|
-
'Do not drift reference assets, product design, logo, recurring character identity, shot order, or scene timing.',
|
|
7267
|
-
];
|
|
7253
|
+
const userAvoidLines = uniqueStoryboardStrings(project.creativeBrief.mustAvoid.map(storyboardUserAvoidLine));
|
|
7268
7254
|
const metadataLabels = uniqueStoryboardStrings([
|
|
7269
7255
|
...(project.metadataLabels ?? []),
|
|
7270
7256
|
...project.scenes.flatMap(scene => scene.metadataLabels ?? []),
|
|
7271
7257
|
]);
|
|
7272
7258
|
const storySpine = removeStoryboardMetadataLabelsFromPromptText(project.creativeBrief.storySpine, metadataLabels) || project.creativeBrief.storySpine;
|
|
7273
|
-
const visibleText = storyboardRequiredVisibleText(project);
|
|
7274
|
-
const visibleTextInstruction = visibleText.length > 0
|
|
7275
|
-
? 'Render only the storyboard-specified visible text, exactly where its scene requires it. All scene numbers, timecodes, labels, and production notes remain metadata only and must not appear in the video.'
|
|
7276
|
-
: 'All scene numbers, timecodes, labels, and production notes remain metadata only and must not appear in the video.';
|
|
7277
7259
|
const toneProgression = project.creativeBrief.toneProgression.join(' -> ');
|
|
7278
7260
|
const musicArc = project.scenes.map(scene => scene.music).filter(Boolean).join(' -> ');
|
|
7279
|
-
const visualStyle = project.creativeBrief.visualQualityBar.replace(/\bstoryboard\s+sheet\b/gi, '
|
|
7261
|
+
const visualStyle = project.creativeBrief.visualQualityBar.replace(/\bstoryboard\s+sheet\b/gi, 'video');
|
|
7280
7262
|
return [
|
|
7281
7263
|
'PROJECT:',
|
|
7282
7264
|
`Title: ${project.title}`,
|
|
@@ -7285,22 +7267,20 @@ export function compileSeedanceStoryboardPromptFromProject(project, options = {}
|
|
|
7285
7267
|
`Story spine: ${storySpine}`,
|
|
7286
7268
|
'',
|
|
7287
7269
|
'INPUT ASSETS:',
|
|
7288
|
-
`${storyboardImageTag}: approved storyboard reference image
|
|
7270
|
+
`${storyboardImageTag}: approved storyboard reference image, the ordered shot guide and timing reference. ${SEEDANCE_STORYBOARD_FULL_FRAME_LINE}`,
|
|
7289
7271
|
'',
|
|
7290
7272
|
'GLOBAL VIDEO INSTRUCTIONS:',
|
|
7291
7273
|
`Render one continuous cinematic video in ${aspectRatio}. Follow the storyboard scene order, timing ranges, transitions, and audio plan.`,
|
|
7292
7274
|
'Use the storyboard as the controlling source for shot order and intent while converting each panel into full-screen motion.',
|
|
7293
|
-
|
|
7275
|
+
'Only the visible text listed in a scene appears on screen, exactly where that scene places it.',
|
|
7294
7276
|
metadataLabels.length > 0 ? `Do not render these metadata labels as video text: ${metadataLabels.join('; ')}.` : '',
|
|
7295
|
-
|
|
7277
|
+
...userAvoidLines,
|
|
7278
|
+
...(visualStyle ? [`Visual style: ${visualStyle}`] : []),
|
|
7296
7279
|
toneProgression ? `Tone progression: ${toneProgression}` : '',
|
|
7297
7280
|
musicArc ? `Music arc: ${musicArc}` : '',
|
|
7298
7281
|
'',
|
|
7299
7282
|
'TIMECODED SCENES:',
|
|
7300
7283
|
...project.scenes.map(sceneLineForSeedanceStoryboardProject),
|
|
7301
|
-
'',
|
|
7302
|
-
'NEGATIVE / AVOID:',
|
|
7303
|
-
...Array.from(new Set(avoidList.map(item => compactStoryboardLine(item)).filter(Boolean))).map(item => `- ${item}`),
|
|
7304
7284
|
].join('\n');
|
|
7305
7285
|
}
|
|
7306
7286
|
export function lintSeedanceStoryboardPromptFromProject(prompt, project) {
|
|
@@ -7317,8 +7297,8 @@ export function lintSeedanceStoryboardPromptFromProject(prompt, project) {
|
|
|
7317
7297
|
}
|
|
7318
7298
|
if (!/\bshot guide\b/i.test(prompt))
|
|
7319
7299
|
errors.push('missing shot-guide instruction');
|
|
7320
|
-
if (
|
|
7321
|
-
errors.push('missing
|
|
7300
|
+
if (!prompt.includes(SEEDANCE_STORYBOARD_FULL_FRAME_LINE)) {
|
|
7301
|
+
errors.push('missing full-frame shot instruction');
|
|
7322
7302
|
}
|
|
7323
7303
|
if (project.scenes.length === 0)
|
|
7324
7304
|
errors.push('missing storyboard scenes');
|