How gabriellaxy/tiktokaivideogenerator works
Project Type and Purpose
• This is a content‐generation pipeline tool written in Python. It orchestrates AI services to produce short vertical videos (1080×1920) with script, images, audio, captions, and final video composition—optimized for TikTok, Reels, and Shorts.
Top‐Level Components
a. CLI/Input Layer
• main.py + config.json + run.bat
• Gathers user inputs: project folder, topic, style, audience, CTA.
• Reads API keys from config.json.
b. **Orchestration Layer (utils/\*.py)**
• script_generator.py: Calls Groq Cloud API (Llama3) → script.json
• image_prompt_generator.py: Transforms script → image_prompts.json
• image_generator.py: Calls Together AI FLUX-1 → stores images in images/
• audio_generator.py: Generates TTS via Kokoro or Edge → audio/voiceover.mp3
• caption_generator.py: Uses Whisper → captions/captions.json
• caption_overlay.py: Styles and overlays captions
• video_composer.py: Uses MoviePy + FFmpeg + ImageMagick → final video(s)
c. Artifacts & Storage
• JSON docs (script.json, image_prompts.json, captions.json)
• Folders: images/, audio/, captions/
• Final video outputs: final_video.mp4, final_video_with_captions.mp4
d. External Services
• Groq Cloud API (Script)
• Together AI FLUX-1 API (Images)
• Kokoro TTS / Edge TTS (Audio)
• OpenAI Whisper (Captions)
• FFmpeg & ImageMagick (Media processing)
Data Flows & Interactions
• User → main.py → loads config → invokes utils in sequence
• script_generator → JSON script → passed to prompt generator
• image_prompt_generator → image prompts JSON → passed to image generator
• image_generator → image files → passed to composer
• audio_generator → MP3 → passed to caption_generator & composer
• caption_generator → captions JSON → passed to caption_overlay & composer
• video_composer + caption_overlay → final MP4(s)
Architectural Patterns & Design Principles
• Pipeline / Chain of Responsibility: Each util module performs one job, passes output to the next.
• Modularity & Separation of Concerns: Script, prompt, image, audio, caption, composition all isolated.
• Config‐Driven: config.json centralizes API keys.
• Layered Approach: Input → Processing → Storage → Composition → Output.
• Clear labels on every block (e.g., “ScriptGenerator (Groq API)”).
• Annotations for important config or fallback logic (e.g., “if Kokoro fails → use Edge TTS”).