Spaces:
Running
title: ChronoWeave
emoji: π
colorFrom: red
colorTo: pink
sdk: streamlit
sdk_version: 1.44.1
app_file: app.py
pinned: false
ChronoWeave - Interactive Multiverse Story Generation
# <-- Add your space URL later
This Streamlit application demonstrates the "ChronoWeave" concept: generating multiple, branching narrative timelines based on a core theme using Google's Gemini and Imagen APIs.
Concept:
Instead of a single linear story, ChronoWeave explores "what if" scenarios. You provide a theme, the number of scenes, the number of parallel timelines you want to explore, and optionally, a specific point or idea for divergence. The application then:
- Generates structured story data for multiple timelines using Gemini, ensuring narrative divergence.
- Generates images for each scene in each timeline using Imagen, potentially with subtle visual shifts.
- Generates narration audio for each scene using Gemini Live.
- Composes separate video files for each timeline using MoviePy.
How to Use:
- API Key: Ensure you have a Google API Key with access to the Gemini API (including v1alpha for Live) and Imagen. Add this key as a Secret named
GOOGLE_API_KEY
in your Hugging Face Space settings. - Inputs:
- Enter a story
theme
. - Select the
number of scenes
per timeline. - Select the
number of timelines
to generate (e.g., 2 or 3). - (Optional) Provide a
divergence prompt
hinting at how the timelines should differ (e.g., "What if the hero hesitated?", "Explore a path where they find a map").
- Enter a story
- Generate: Click the "Generate ChronoWeave" button.
- Wait: Generation involves multiple API calls and video processing, which can take time. Status updates will be shown.
- View: Once complete, videos for each generated timeline will be displayed.
Technology Stack:
- Streamlit (UI)
- Google Gemini API (Story Generation, Audio Narration - v1alpha Live)
- Google Imagen API (Image Generation)
- MoviePy (Video Composition)
- Hugging Face Spaces (Hosting)
Based On:
This application builds upon the concepts demonstrated in the "Gemini API: Animated Story Video Generation" Colab Notebook by Yousif Ahmed. Copyright 2025 Google LLC. Licensed under Apache License 2.0.
Note: Generation can be resource-intensive. Higher numbers of scenes or timelines may take longer or hit resource limits on Hugging Face Spaces free tier. Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference