# manasi-rathod/storytrails architecture

> Architecture diagram of the GitHub repository manasi-rathod/storytrails, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manasi-rathod/storytrails
- Repository: https://github.com/manasi-rathod/storytrails

## Overview

StoryTrails turns a story into a scene plan and per-scene narration, with a separate editor that combines available scene media into a movie. A standalone generation script demonstrates SDXL image creation followed by Stable Video Diffusion, but the sampled source does not connect it to the main workflow. The README describes a Streamlit interface; sampled main.py is a script, so that interface is not shown as an implemented component.

Main entry points: [`final_editor.py`](https://github.com/manasi-rathod/storytrails/blob/main/final_editor.py) (Video editor), [`main.py`](https://github.com/manasi-rathod/storytrails/blob/main/main.py) (Workflow script), [`project_be.py`](https://github.com/manasi-rathod/storytrails/blob/main/project_be.py) (Visual generation demo), [`director.py`](https://github.com/manasi-rathod/storytrails/blob/main/director.py) (Scene planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Story planning"]
  node_main["Workflow script<br/>[main.py]"]
  node_director["Scene planner<br/>[director.py]"]
end

subgraph group_media["Media generation"]
  node_narrator["Voice synthesis<br/>[narrator.py]"]
  node_visual_demo["Visual generation demo<br/>[project_be.py]"]
end

subgraph group_assembly["Movie assembly"]
  node_editor["Video editor<br/>[final_editor.py]"]
end

subgraph group_artifacts["Project artifacts"]
  node_shotlist["Shot list JSON"]
  node_voice_sample["Voice sample<br/>[my_voice.wav]"]
  node_scene_audio[("Scene audio")]
  node_scene_video[("Scene video")]
  node_temp_scenes[("Prepared scenes")]
  node_final_movie["Final movie"]
end

node_storyteller(("Story author"))
node_ollama["Ollama LLM"]
node_sdxl["SDXL image model"]
node_svd["SVD video model"]

node_storyteller -->|"provides story"| node_main
node_main -->|"requests plan"| node_director
node_director -->|"queries model"| node_ollama
node_main -->|"writes plan"| node_shotlist
node_main -->|"requests narration"| node_narrator
node_main -->|"supplies sample"| node_voice_sample
node_narrator -->|"writes audio"| node_scene_audio
node_visual_demo -->|"generates image"| node_sdxl
node_visual_demo -->|"generates video"| node_svd
node_sdxl -->|"provides image"| node_svd
node_editor -->|"reads order"| node_shotlist
node_editor -->|"reads audio"| node_scene_audio
node_editor -->|"reads video"| node_scene_video
node_editor -->|"writes merged scenes"| node_temp_scenes
node_editor -->|"writes movie"| node_final_movie

click node_main "https://github.com/manasi-rathod/storytrails/blob/main/main.py"
click node_director "https://github.com/manasi-rathod/storytrails/blob/main/director.py"
click node_shotlist "https://github.com/manasi-rathod/storytrails/blob/main/master_shot_list.json"
click node_narrator "https://github.com/manasi-rathod/storytrails/blob/main/narrator.py"
click node_voice_sample "https://github.com/manasi-rathod/storytrails/blob/main/my_voice.wav"
click node_scene_audio "https://github.com/manasi-rathod/storytrails/tree/main/project_assets"
click node_visual_demo "https://github.com/manasi-rathod/storytrails/blob/main/project_be.py"
click node_scene_video "https://github.com/manasi-rathod/storytrails/tree/main/project_assets"
click node_editor "https://github.com/manasi-rathod/storytrails/blob/main/final_editor.py"
click node_temp_scenes "https://github.com/manasi-rathod/storytrails/tree/main/temp_scenes"
click node_final_movie "https://github.com/manasi-rathod/storytrails/blob/main/FINAL_STORY_MOVIE.mp4"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_director toneBlue
class node_narrator,node_visual_demo toneAmber
class node_editor toneMint
class node_shotlist,node_voice_sample,node_scene_audio,node_scene_video,node_temp_scenes,node_final_movie toneRose
class node_storyteller,node_ollama,node_sdxl,node_svd toneIndigo
```

## Components

### Story planning

- [Workflow script](https://github.com/manasi-rathod/storytrails/blob/main/main.py): `main.py`
- [Scene planner](https://github.com/manasi-rathod/storytrails/blob/main/director.py): `director.py`

### Media generation

- [Voice synthesis](https://github.com/manasi-rathod/storytrails/blob/main/narrator.py): `narrator.py`
- [Visual generation demo](https://github.com/manasi-rathod/storytrails/blob/main/project_be.py): `project_be.py`

### Movie assembly

- [Video editor](https://github.com/manasi-rathod/storytrails/blob/main/final_editor.py): `final_editor.py`

### Project artifacts

- [Shot list JSON](https://github.com/manasi-rathod/storytrails/blob/main/master_shot_list.json): `master_shot_list.json`
- [Voice sample](https://github.com/manasi-rathod/storytrails/blob/main/my_voice.wav): `my_voice.wav`
- [Scene audio](https://github.com/manasi-rathod/storytrails/tree/main/project_assets): `project_assets`
- [Scene video](https://github.com/manasi-rathod/storytrails/tree/main/project_assets): `project_assets`
- [Prepared scenes](https://github.com/manasi-rathod/storytrails/tree/main/temp_scenes): `temp_scenes`
- [Final movie](https://github.com/manasi-rathod/storytrails/blob/main/FINAL_STORY_MOVIE.mp4): `FINAL_STORY_MOVIE.mp4`

### Other components

- **Story author**
- **Ollama LLM**
- **SDXL image model**
- **SVD video model**

## Connections

- Story author → Workflow script: provides story (evidence: `README.md`)
- Workflow script → Scene planner: requests plan (evidence: `main.py`)
- Scene planner → Ollama LLM: queries model (evidence: `director.py`)
- Workflow script → Shot list JSON: writes plan (evidence: `main.py`)
- Workflow script → Voice synthesis: requests narration (evidence: `main.py`)
- Workflow script → Voice sample: supplies sample (evidence: `main.py`)
- Voice synthesis → Scene audio: writes audio
- Visual generation demo → SDXL image model: generates image (evidence: `project_be.py`)
- Visual generation demo → SVD video model: generates video (evidence: `project_be.py`)
- SDXL image model → SVD video model: provides image
- Video editor → Shot list JSON: reads order (evidence: `final_editor.py`)
- Video editor → Scene audio: reads audio (evidence: `final_editor.py`)
- Video editor → Scene video: reads video (evidence: `final_editor.py`)
- Video editor → Prepared scenes: writes merged scenes (evidence: `final_editor.py`)
- Video editor → Final movie: writes movie (evidence: `final_editor.py`)
