# vothanhtrung1404ok-ship-it/tools_create_video_grok architecture

> Architecture diagram of the GitHub repository vothanhtrung1404ok-ship-it/tools_create_video_grok, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vothanhtrung1404ok-ship-it/tools_create_video_grok
- Repository: https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok

## Overview

Video Factory AI is a desktop tool for creating AI-generated films and product-sales videos. Users choose a workflow in the GUI, provide a script or product and visual settings, then start generation; the app produces scene clips, adds optional narration/music and assembles output videos. Film work can use parsed or ChatGPT-written scripts, alternate video engines, and batch production; sales work builds product prompts and uses Grok. The excerpts show orchestration, generation and assembly, but not all GUI-to-workflow wiring, so uncertain links are omitted.

Main entry points: [`orchestrator.py`](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/orchestrator.py) (Film orchestrator), [`main.py`](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/main.py) (Desktop GUI), [`services/video_gen/base.py`](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/base.py) (Video engine API), [`batch/batch_runner.py`](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/batch/batch_runner.py) (Batch runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gui["Desktop GUI<br/>[main.py]"]
end

subgraph group_workflows["Production workflows"]
  node_sales_prompts["Sales prompts<br/>[sales_prompt.py]"]
  node_orchestrator["Film orchestrator<br/>[orchestrator.py]"]
  node_parser["Script parser<br/>[script_parser.py]"]
  node_chatgpt["ChatGPT agent<br/>[chatgpt_agent.py]"]
  node_batch["Batch runner<br/>[batch_runner.py]"]
end

subgraph group_generation["Media generation"]
  node_grok["Grok browser agent<br/>[grok_agent.py]"]
  node_engine_base["Video engine API<br/>[base.py]"]
  node_replicate["Replicate engine"]
  node_kling["Kling engine<br/>[kling_engine.py]"]
  node_luma["Luma engine<br/>[luma_engine.py]"]
  node_comfy["ComfyUI engine<br/>[comfyui_engine.py]"]
  node_tts_base["TTS API<br/>[base.py]"]
  node_edge_tts["Edge TTS"]
  node_elevenlabs["ElevenLabs TTS<br/>[elevenlabs_tts.py]"]
end

subgraph group_finishing["Video finishing"]
  node_processor["Video processor<br/>[processor.py]"]
  node_output["Rendered videos"]
end

node_user(("User"))
node_grok_service{{"Grok / X"}}
node_cloud_video{{"Video AI APIs"}}
node_comfy_server{{"ComfyUI server"}}
node_speech_service{{"Speech service"}}

node_user -->|"configures"| node_gui
node_gui -->|"starts film runs"| node_orchestrator
node_gui -->|"builds sales prompts"| node_sales_prompts
node_gui -->|"starts sales clips"| node_grok
node_gui -->|"starts batch runs"| node_batch
node_orchestrator -->|"parses scripts"| node_parser
node_orchestrator -.->|"requests scripts"| node_chatgpt
node_orchestrator -->|"generates scenes"| node_grok
node_orchestrator -->|"selects engine"| node_engine_base
node_orchestrator -->|"creates narration"| node_tts_base
node_orchestrator -->|"assembles clips"| node_processor
node_batch -->|"generates clips"| node_grok
node_batch -->|"parses scripts"| node_parser
node_batch -->|"assembles videos"| node_processor
node_grok -->|"automates browser"| node_grok_service
node_engine_base -->|"implements"| node_replicate
node_engine_base -->|"implements"| node_kling
node_engine_base -->|"implements"| node_luma
node_engine_base -->|"implements"| node_comfy
node_replicate -.->|"submits generation"| node_cloud_video
node_kling -.->|"submits generation"| node_cloud_video
node_luma -.->|"submits generation"| node_cloud_video
node_comfy -.->|"submits jobs"| node_comfy_server
node_tts_base -->|"implements"| node_edge_tts
node_tts_base -->|"implements"| node_elevenlabs
node_edge_tts -.->|"synthesizes speech"| node_speech_service
node_elevenlabs -.->|"synthesizes speech"| node_speech_service
node_processor -->|"renders video"| node_output

click node_gui "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/main.py"
click node_sales_prompts "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/sales_prompt.py"
click node_orchestrator "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/orchestrator.py"
click node_parser "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/script_parser.py"
click node_chatgpt "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/agents/chatgpt_agent.py"
click node_batch "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/batch/batch_runner.py"
click node_grok "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/agents/grok_agent.py"
click node_engine_base "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/base.py"
click node_replicate "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/replicate_engine.py"
click node_kling "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/kling_engine.py"
click node_luma "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/luma_engine.py"
click node_comfy "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/comfyui_engine.py"
click node_tts_base "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/tts/base.py"
click node_edge_tts "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/tts/edge_tts_service.py"
click node_elevenlabs "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/tts/elevenlabs_tts.py"
click node_processor "https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/video/processor.py"

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_gui,node_user,node_comfy_server toneBlue
class node_sales_prompts,node_orchestrator,node_parser,node_chatgpt,node_batch toneAmber
class node_grok,node_engine_base,node_replicate,node_kling,node_luma,node_comfy,node_tts_base,node_edge_tts,node_elevenlabs,node_cloud_video toneMint
class node_processor,node_output toneRose
class node_grok_service,node_speech_service toneIndigo
```

## Components

### User interface

- [Desktop GUI](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/main.py): `main.py`

### Production workflows

- [Sales prompts](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/sales_prompt.py): `services/sales_prompt.py`
- [Film orchestrator](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/orchestrator.py): `orchestrator.py`
- [Script parser](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/script_parser.py): `script_parser.py`
- [ChatGPT agent](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/agents/chatgpt_agent.py): `agents/chatgpt_agent.py`
- [Batch runner](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/batch/batch_runner.py): `batch/batch_runner.py`

### Media generation

- [Grok browser agent](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/agents/grok_agent.py): `agents/grok_agent.py`
- [Video engine API](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/base.py): `services/video_gen/base.py`
- [Replicate engine](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/replicate_engine.py): `services/video_gen/replicate_engine.py`
- [Kling engine](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/kling_engine.py): `services/video_gen/kling_engine.py`
- [Luma engine](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/luma_engine.py): `services/video_gen/luma_engine.py`
- [ComfyUI engine](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/video_gen/comfyui_engine.py): `services/video_gen/comfyui_engine.py`
- [TTS API](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/tts/base.py): `services/tts/base.py`
- [Edge TTS](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/tts/edge_tts_service.py): `services/tts/edge_tts_service.py`
- [ElevenLabs TTS](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/services/tts/elevenlabs_tts.py): `services/tts/elevenlabs_tts.py`

### Video finishing

- [Video processor](https://github.com/vothanhtrung1404ok-ship-it/tools_create_video_grok/blob/main/video/processor.py): `video/processor.py`
- **Rendered videos**

### Other components

- **User**
- **Grok / X**
- **Video AI APIs**
- **ComfyUI server**
- **Speech service**

## Connections

- User → Desktop GUI: configures
- Desktop GUI → Film orchestrator: starts film runs
- Desktop GUI → Sales prompts: builds sales prompts
- Desktop GUI → Grok browser agent: starts sales clips
- Desktop GUI → Batch runner: starts batch runs
- Film orchestrator → Script parser: parses scripts
- Film orchestrator → ChatGPT agent: requests scripts
- Film orchestrator → Grok browser agent: generates scenes
- Film orchestrator → Video engine API: selects engine
- Film orchestrator → TTS API: creates narration
- Film orchestrator → Video processor: assembles clips
- Batch runner → Grok browser agent: generates clips
- Batch runner → Script parser: parses scripts
- Batch runner → Video processor: assembles videos
- Grok browser agent → Grok / X: automates browser
- Video engine API → Replicate engine: implements
- Video engine API → Kling engine: implements
- Video engine API → Luma engine: implements
- Video engine API → ComfyUI engine: implements
- Replicate engine → Video AI APIs: submits generation
- Kling engine → Video AI APIs: submits generation
- Luma engine → Video AI APIs: submits generation
- ComfyUI engine → ComfyUI server: submits jobs
- TTS API → Edge TTS: implements
- TTS API → ElevenLabs TTS: implements
- Edge TTS → Speech service: synthesizes speech
- ElevenLabs TTS → Speech service: synthesizes speech
- Video processor → Rendered videos: renders video
