How lazyai-engineer/instaai-carousel works
InstaAI is a terminal-driven generator that turns a topic into a validated, seven-slide educational carousel and exports seven 1080 × 1350 PNGs. The main flow runs from topic entry through prompt construction, SenseNova generation, JSON parsing and content/visual validation, then deterministic HTML/CSS/SVG rendering in Playwright/Chromium. The documented slide progression—hook, motivation, concept, mechanism, example, insight, takeaway—and seven visual layout types are represented in the content strategy and renderer nodes. The source excerpts are partial, so internal details beyond the documented flow are not inferred.
Main entry points: generator.py Generation orchestrator · renderer.py Carousel renderer · app.py Terminal app · prompts.py Seven-slide strategy
Components 11
Terminal interface
- Terminal app
InstaAI/app.py
Content generation
- Generation orchestrator
InstaAI/generator.py - Seven-slide strategy
InstaAI/prompts.py
Carousel validation
- Response parser
InstaAI/generator.py - Content and visual checks
InstaAI/generator.py
Visual rendering
- Carousel renderer
InstaAI/renderer.py - Layout and SVG scenes
InstaAI/renderer.py - Seven PNG slides
Other components
- Topic author
- SenseNova API
- Playwright Chromium
Connections 13
- Topic author → Terminal app: enters topic
- Terminal app → Generation orchestrator: calls generation
- Terminal app → Seven PNG slides: clears and verifies
- Generation orchestrator → Seven-slide strategy: builds prompt
- Seven-slide strategy → Generation orchestrator: returns instructions
- Generation orchestrator → SenseNova API: requests carousel
- SenseNova API → Generation orchestrator: returns response
- Generation orchestrator → Response parser: parses JSON
- Response parser → Content and visual checks: supplies carousel
- Generation orchestrator → Carousel renderer: passes validated slides
- Carousel renderer → Layout and SVG scenes: builds slide layouts
- Carousel renderer → Playwright Chromium: renders pages
- Carousel renderer → Seven PNG slides: writes slide images