Inspiration

Can a single sentence spark a child's imagination and turn into a vivid fairy tale? This question was the starting point of our journey. We wanted to go beyond simple text generation and create an interactive experience where visual images and lifelike narration unfold simultaneously.

What it does

Vivid Story Generator creates a multi-scene storyline based on just a single sentence from the user. Each scene includes AI-generated custom images and narration streamed via Server-Sent Events (SSE) as soon as each scene is ready, so users experience a 'living' storybook.

How we built it

We adopted an event-driven orchestration architecture for maximum efficiency and user experience:

  • Frontend: Built an interactive UI using Streamlit.
  • Backend: Managed asynchronous API communication via FastAPI.
  • AI engine: We integrated K2 Think and Google Gemini for story generation, Dedalus API (GPT-Image-1 and DALL-E 2) for scene illustrations, and ElevenLabs for high-quality speech synthesis.

Challenges we ran into

Our biggest challenge was library compatibility in the deployment environment. Unlike our local setup, the Cloud server (Streamlit Cloud/Render) running Python 3.13 caused crashes with specific libraries like ElevenLabs (e.g., No module named 'elevenlabs.client'). We overcame this by fixing the Python version with runtime.txt and painstakingly syncing the requirements.txt with our local environment.

Accomplishments that we're proud of

We are proud to have implemented a real-time streaming system where text, images, and audio are organically combined. Successfully overcoming numerous deployment errors to deliver a project in a fully functional service format is a major achievement for us.

What we learned

We learned there is a significant gap between local development and production. Specifically, we gained a deep understanding of environment variable management (Secrets), library dependency chains, and real-time streaming optimization to deliver data seamlessly to users.

What's next for Vivid Story Generator

We plan to enhance the experience by adding a 'Choice' feature, allowing users to decide the direction of the story. We also aim to strengthen the custom story-making capability by providing a wider variety of voices and image styles.

Built With

  • dedalus
  • elevenlabs
  • fastapi
  • k2-think
  • python
  • streamlit
  • uvicorn
Share this project:

Updates