Skip to content

Commit 518dcca

Browse files
authored
fix: enforce brand colors in infographic generation + enrichment prompts
Strict black bg + emerald green in DEFAULT_INSTRUCTIONS, enrichment prompt, and negativePrompt on all Imagen calls. Blocks purple/blue at every generation point.
1 parent 9d01a31 commit 518dcca

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

app/api/cron/check-research/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ Return ONLY a JSON object:
686686
"list": { "items": ["Item 1", "Item 2"], "icon": "🚀" },
687687
"comparison": { "leftLabel": "A", "rightLabel": "B", "rows": [{ "left": "...", "right": "..." }] },
688688
"mockup": { "deviceType": "browser | phone | terminal", "screenContent": "..." },
689-
"imagePrompts": ["Infographic 2D architecture style, black background. [specific visual for this scene]. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations."]
689+
"imagePrompts": ["Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. [specific visual for this scene]. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable labels."]
690690
}
691691
],
692692
"cta": "string - call to action"
@@ -697,7 +697,7 @@ Return ONLY a JSON object:
697697
Requirements:
698698
- 3-5 scenes totaling 60-90 seconds
699699
- Use at least 2 different scene types
700-
- Each scene MUST include 2-5 imagePrompts following this exact template: "Infographic 2D architecture style, black background. [specific visual]. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations."
700+
- Each scene MUST include 2-5 imagePrompts following this exact template: "Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. [specific visual]. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable labels."
701701
- imagePrompts should describe specific 2D infographic visuals that illustrate the narration content
702702
- Do NOT include any script text, titles, or word overlays in the video. The narration audio carries all words.
703703
- Think of each imagePrompt as a frame that will be shown for 3-5 seconds while the narration plays

lib/services/gemini-infographics.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ export function buildInfographicPrompt(
210210

211211
/** Default infographic instructions if Sanity contentConfig is not set up */
212212
const DEFAULT_INSTRUCTIONS: string[] = [
213-
'Infographic 2D architecture style, black background. A high-level technical architecture overview showing system components and data flow. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations.',
214-
'Infographic 2D architecture style, black background. A comparison chart showing key features and alternatives side by side. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations.',
215-
'Infographic 2D architecture style, black background. A step-by-step workflow diagram showing the process from start to finish. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations.',
216-
'Infographic 2D architecture style, black background. A timeline of key developments, milestones, and version releases. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations.',
217-
'Infographic 2D architecture style, black background. A pros and cons visual summary with clear icons and labels. Highlighted elements filled with #15b27b. White lines connecting components and white text annotations.',
213+
'Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. A high-level technical architecture overview showing system components and data flow. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable text labels suitable for mobile viewing at 360px width. No watermarks.',
214+
'Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. A comparison chart showing key features and alternatives side by side. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable text labels suitable for mobile viewing at 360px width. No watermarks.',
215+
'Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. A step-by-step workflow diagram showing the process from start to finish. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable text labels suitable for mobile viewing at 360px width. No watermarks.',
216+
'Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. A timeline of key developments, milestones, and version releases. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable text labels suitable for mobile viewing at 360px width. No watermarks.',
217+
'Infographic 2D architecture style. STRICTLY black (#000000) background only \u2014 no gradients, no purple, no blue. A pros and cons visual summary with clear icons and labels. Highlighted elements filled with bright green (#15b27b) only. White lines connecting components and white text annotations. Large, readable text labels suitable for mobile viewing at 360px width. No watermarks.',
218218
];
219219

220220
// ---------------------------------------------------------------------------
@@ -318,7 +318,7 @@ export async function generateFromScenePrompts(
318318
// Generate horizontal (16:9)
319319
try {
320320
const hResult = await generateInfographic(
321-
{ prompt, aspectRatio: "16:9" },
321+
{ prompt, aspectRatio: "16:9", negativePrompt: "purple background, blue gradient, watermark, blurry text, small text" },
322322
model,
323323
);
324324
horizontal.push(hResult);
@@ -330,7 +330,7 @@ export async function generateFromScenePrompts(
330330
// Generate vertical (9:16)
331331
try {
332332
const vResult = await generateInfographic(
333-
{ prompt, aspectRatio: "9:16" },
333+
{ prompt, aspectRatio: "9:16", negativePrompt: "purple background, blue gradient, watermark, blurry text, small text" },
334334
model,
335335
);
336336
vertical.push(vResult);

0 commit comments

Comments
 (0)