Skip to content

feat: infographic scale-up — dual orientation + per-scene prompts (Task C)#640

Merged
codercatdev merged 3 commits intodevfrom
feat/infographic-scaleup
Mar 13, 2026
Merged

feat: infographic scale-up — dual orientation + per-scene prompts (Task C)#640
codercatdev merged 3 commits intodevfrom
feat/infographic-scaleup

Conversation

@codercatdev
Copy link
Copy Markdown
Contributor

Task C: Infographic Scale-Up for Overnight Sprint

Scale up infographic generation to support 20-50 images per video with dual orientation (16:9 + 9:16).

Changes

File 1: lib/services/gemini-infographics.ts

  • New DualOrientationResult interface — typed result for dual-orientation generation
  • New generateFromScenePrompts() function — main entry point for the new pipeline. Takes per-scene image prompts and generates both 16:9 (horizontal/YouTube) and 9:16 (vertical/shorts) versions
  • Updated DEFAULT_INSTRUCTIONS — switched to Alex's brand style: "Infographic 2D architecture style, black background... #15b27b... white lines"
  • Rate limiting — 2-second pause every 5 prompts to avoid Imagen API throttling (50 prompts × 2 orientations = 100 API calls)
  • All existing exports preserved (generateInfographic, generateInfographicBatch, generateInfographicsForTopic, buildInfographicPrompt, etc.)

File 2: app/api/cron/check-research/route.ts

  • Updated PipelineDoc interface — added imagePrompts?: string[] to scene type
  • Updated EnrichedScript interface — added imagePrompts?: string[] to scene type
  • Updated enrichment prompt — instructs Gemini to output 2-5 imagePrompts per scene following the brand template
  • Updated stepResearchComplete() — new dual-path logic:
    • If scenes have imagePrompts: uses generateFromScenePrompts() for both orientations, uploads to infographicsHorizontal and infographicsVertical Sanity fields
    • Fallback: uses existing generateInfographicsForTopic() (backward compatible)
    • Backward compat: still writes to infographics field for existing consumers

Verification

  • npx tsc --noEmit — clean (no errors on either file)
  • New exports verified: DualOrientationResult, generateFromScenePrompts
  • imagePrompts present in enrichment prompt JSON schema and requirements

Notes

  • Rate limiting is critical: at 50 prompts × 2 orientations = 100 Imagen API calls per video
  • The enrichment prompt now instructs: "Do NOT include any script text, titles, or word overlays in the video. The narration audio carries all words."
  • Each imagePrompt is a frame shown for 3-5 seconds while narration plays

Miriad and others added 2 commits March 13, 2026 05:27
Co-authored-by: research <research@miriad.systems>
Co-authored-by: research <research@miriad.systems>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codingcat-dev Ignored Ignored Mar 13, 2026 5:34am

Tracks which imagePrompts belong to which scene via scenePromptMap,
then maps generated CDN URLs back to script.scenes[].infographicUrls
so Remotion mapInputProps() can pick them up per-scene.
@codercatdev codercatdev merged commit 5cc3b11 into dev Mar 13, 2026
2 checks passed
codercatdev added a commit that referenced this pull request Mar 13, 2026
Sprint 1: Infographic-driven explainer videos\n\nTask A (PR #638): Schema + buildPrompt — imagePrompts[] per scene, infographicsHorizontal/Vertical arrays, Gemini prompt template\nTask B (PR #639): Remotion rewrite — multi-image cycling with crossfade, NO text overlays, backward compat\nTask C (PR #640): Infographic generation — dual orientation (16:9 + 9:16), per-scene prompts, Sanity upload, scene-level URL distribution\n\nBuild verified: tsc clean, Node 22.
@codercatdev codercatdev deleted the feat/infographic-scaleup branch March 13, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant