WhoBuilt

Storyteller: Building Multi-modal Apps with TS & ModelFusion

Jan 23, 2024· 8 min· 1.2K views·Watch on YouTube

Speaker

Lars Grammel, PhD, presents Storyteller, a TypeScript app built with ModelFusion for generating short audio stories for preschool kids; no company or event venue is stated.

Storyteller and its design goals

Storyteller turns a spoken topic into an audio story of about two minutes. Grammel describes it as a React client with a custom Fastify server, designed around responsiveness, quality, and consistency.

From voice input to story assets

The server transcribes the recording with OpenAI Whisper, which takes about 1.5 seconds for a short topic, and sends updates to the client through server-sent events. GPT-3 Turbo Instruct creates an outline in about four seconds; after that, title and image generation run alongside story narration.

Generating a consistent image

GPT-4 extracts representative keywords from the story to form an image prompt, which Stable Diffusion XL uses to generate an image. The server stores the image as a virtual file and sends its path to the client for display.

Streaming story parts into speech

A full GPT-4 story generation can take about a minute and a half, so Storyteller streams and partially parses the story structure to identify passages ready for narration. For new speakers, GPT-3.5 generates a gender and voice description; the app retrieves a matching voice while avoiding duplicates, then synthesizes audio with ElevenLabs.

Playing audio as generation continues

The client begins playback as soon as the first audio part is ready, while the server continues generating later parts. Grammel attributes responsiveness to progressive loading updates, parallel backend work, streaming, and choosing models with shorter processing times.

Takeaways

  • Send progress events as outputs become ready so the interface can show work in progress.
  • Run independent tasks, such as title and image generation, in parallel after producing a story outline.
  • Stream and parse structured model output so completed sections can be processed before the full response arrives.
  • Start playback when the first audio segment is ready, while later segments continue generating.
  • For consistent images, derive prompts from story details; for distinct character voices, match descriptions and prevent voice reuse.

Mentioned in this talk

Search inside this talk

What was claimed 15

Related talks