Skip to content

Commit c027ffc

Browse files
authored
feat: infographic schema + per-scene image prompts in buildPrompt
Task A: Schema + buildPrompt for infographic-driven videos\n\n- Added imagePrompts (string[]) to each scene in automatedVideo script\n- Added infographicsHorizontal and infographicsVertical arrays at doc root\n- Updated buildPrompt() with per-scene image prompt generation instructions\n- Template: 'Infographic 2D architecture style, black background. [scene]. #15b27b accents.'\n- Prompt count: Math.ceil(durationEstimate / 4) per scene\n- NO text overlays instruction
1 parent a23f23e commit c027ffc

2 files changed

Lines changed: 94 additions & 0 deletions

File tree

app/api/cron/ingest/route.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ interface ScriptScene {
2020
visualDescription: string;
2121
bRollKeywords: string[];
2222
durationEstimate: number;
23+
imagePrompts?: string[];
2324
// Scene-type-specific data
2425
code?: {
2526
snippet: string;
@@ -330,6 +331,25 @@ Each scene MUST have a "sceneType" that determines its visual treatment. Choose
330331
- For "list" scenes, provide 3-6 concise items
331332
- For "comparison" scenes, provide 2-4 rows
332333
334+
## Infographic Image Prompts
335+
336+
CRITICAL: This video will be a visual infographic explainer. There will be NO text, titles, or script words shown on screen — the narration audio carries all words. The visuals are entirely infographic images.
337+
338+
For EACH scene, generate an "imagePrompts" array with 2-5 image generation prompts. Each prompt should follow this exact template:
339+
340+
"Infographic 2D architecture style, black background. [SPECIFIC VISUAL FOR THIS SCENE]. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations."
341+
342+
Replace [SPECIFIC VISUAL FOR THIS SCENE] with a detailed description of what the infographic should show for that particular scene. Be specific — reference the actual technical concepts, comparisons, or workflows being discussed.
343+
344+
Guidelines for image prompts:
345+
- Each scene needs Math.ceil(durationEstimate / 4) prompts (one image every ~4 seconds)
346+
- A 15-second scene needs 4 prompts, a 20-second scene needs 5
347+
- Each prompt should show a DIFFERENT aspect or angle of the scene's content
348+
- For code scenes: show architecture diagrams, data flow, or system diagrams (NOT the code itself)
349+
- For comparison scenes: show side-by-side comparison charts or feature matrices
350+
- For list scenes: show each item as a distinct visual element in the infographic
351+
- Make prompts visually varied — don't repeat the same layout
352+
333353
## JSON Schema
334354
335355
Return ONLY a JSON object matching this exact schema:
@@ -349,6 +369,7 @@ Return ONLY a JSON object matching this exact schema:
349369
"visualDescription": "string - what to show on screen (fallback for all types)",
350370
"bRollKeywords": ["keyword1", "keyword2"],
351371
"durationEstimate": 15,
372+
"imagePrompts": ["Infographic 2D architecture style, black background. [specific visual]. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations."],
352373
"code": {
353374
"snippet": "string - actual code to display (only for sceneType: code)",
354375
"language": "typescript | javascript | jsx | tsx | css | html | json | bash",
@@ -383,6 +404,10 @@ Requirements:
383404
- Only include the type-specific field that matches the sceneType (e.g., only include "code" when sceneType is "code")
384405
- For "code" scenes, provide real, syntactically correct code
385406
- The qualityScore should be your honest self-assessment (0-100)
407+
- Each scene MUST include an "imagePrompts" array with 2-5 image generation prompts
408+
- Image prompts must follow the template: "Infographic 2D architecture style, black background. [specific]. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations."
409+
- Do NOT include any text overlays, titles, or script words in the video — narration audio carries all words
410+
- Calculate prompt count per scene: Math.ceil(durationEstimate / 4)
386411
- Return ONLY the JSON object, no markdown or extra text`;
387412
}
388413

sanity/schemas/documents/automatedVideo.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ export default defineType({
8989
},
9090
initialValue: 'narration',
9191
}),
92+
defineField({
93+
name: 'imagePrompts',
94+
title: 'Image Prompts',
95+
type: 'array',
96+
of: [{type: 'string'}],
97+
description: 'Per-scene infographic image generation prompts (generated by Gemini)',
98+
}),
9299
defineField({
93100
name: 'code',
94101
title: 'Code',
@@ -314,6 +321,68 @@ export default defineType({
314321
},
315322
],
316323
}),
324+
defineField({
325+
name: 'infographicsHorizontal',
326+
title: 'Infographics (Horizontal 16:9)',
327+
type: 'array',
328+
description: 'Generated infographic images for the horizontal/landscape video format',
329+
of: [
330+
{
331+
type: 'object',
332+
fields: [
333+
defineField({
334+
name: 'image',
335+
title: 'Image',
336+
type: 'image',
337+
options: { hotspot: true },
338+
}),
339+
defineField({
340+
name: 'prompt',
341+
title: 'Prompt',
342+
type: 'string',
343+
description: 'The image generation prompt used to create this infographic',
344+
}),
345+
defineField({
346+
name: 'sceneNumber',
347+
title: 'Scene Number',
348+
type: 'number',
349+
description: 'Which scene this infographic belongs to',
350+
}),
351+
],
352+
},
353+
],
354+
}),
355+
defineField({
356+
name: 'infographicsVertical',
357+
title: 'Infographics (Vertical 9:16)',
358+
type: 'array',
359+
description: 'Generated infographic images for the vertical/shorts video format',
360+
of: [
361+
{
362+
type: 'object',
363+
fields: [
364+
defineField({
365+
name: 'image',
366+
title: 'Image',
367+
type: 'image',
368+
options: { hotspot: true },
369+
}),
370+
defineField({
371+
name: 'prompt',
372+
title: 'Prompt',
373+
type: 'string',
374+
description: 'The image generation prompt used to create this infographic',
375+
}),
376+
defineField({
377+
name: 'sceneNumber',
378+
title: 'Scene Number',
379+
type: 'number',
380+
description: 'Which scene this infographic belongs to',
381+
}),
382+
],
383+
},
384+
],
385+
}),
317386
defineField({
318387
name: 'renderData',
319388
title: 'Render Data',

0 commit comments

Comments
 (0)