How naqashafzal/ai-content-studio works
1. Purpose and entry points
Nullpk AI Content Studio is a local Python desktop application that turns a user topic into publishable YouTube-oriented media: research, script, narration, visuals, captions, metadata, and optional social uploads. The primary executable entry point is main.py; run.sh and run.bat are platform launch wrappers. The GUI is CustomTkinter-based.
Paths: main.py, run.sh, run.bat
2. UI orchestration boundary
The desktop UI collects the topic, style, generation options, credentials/settings, and publishing choices. It initiates the pipeline and presents generated artifacts for review, especially SEO metadata and publishing actions. UI interaction should remain separated from long-running network/media work to preserve responsiveness.
Paths: main.py, pipeline.py, config.py
3. Pipeline coordinator
pipeline.py is the lifecycle coordinator. It sequences conditional stages according to selected content format and options: research, script generation/revision, voice/audio, visual generation, assembly, captions, thumbnails, SEO, and upload. It is the main control-flow boundary between user intent and artifact production, and should own stage status, intermediate outputs, and failure propagation.
Paths: pipeline.py, main.py
4. AI agents: research, writing, and content planning
agents.py contains the generative-AI roles that transform a topic and gathered context into research, scripts, fact-check/revision output, and likely SEO-oriented content. Gemini is the core text and TTS model family. Agent outputs become structured or textual inputs to downstream narration, visual selection, and metadata stages.
Paths: agents.py, pipeline.py, api_clients.py
5. External API integration layer
api_clients.py centralizes calls to external providers: Google Gemini/Google Search grounding, Vertex AI image/video generation, NewsAPI headlines, and optional WaveSpeed video generation. This is the critical provider boundary for authentication, request/response normalization, retries, and service-specific failures.
Paths: api_clients.py, config.py, agents.py
6. Media production and artifact assembly
The pipeline converts scripts into multi-speaker TTS/audio, optionally mixes background music, produces AI visuals, creates thumbnails, and renders the final video. FFmpeg is the essential local rendering dependency; Whisper generates speech timing and pysubs2 supports styled ASS subtitles. temp_preview.ass is an example/generated subtitle-preview artifact, while cyberpunk.json is likely a visual/style preset consumed during generation.
Paths: pipeline.py, temp_preview.ass, cyberpunk.json
7. Publishing and runtime dependencies
The final artifact path includes captioned video, thumbnail, SEO title/description/tags, chapter timestamps, and direct YouTube/Facebook publishing. YouTube requires local OAuth desktop credentials (client_secrets.json, user-provided); API keys and GCP project/location are persisted through the application configuration. Runtime requires Python 3.10+, FFmpeg on PATH, Google/Vertex credentials, and packages declared in requirements.txt.
Paths: config.py, pipeline.py, requirements.txt
Main entry points: pipeline.py Pipeline coordinator · main.py CustomTkinter UI · api_clients.py Provider client layer · temp_preview.ass Captions & timing
Components 18
Desktop App
- Launch wrappers · Platform wrappers start the desktop app.
run.sh - Application entry
main.py - CustomTkinter UI · Collects options and presents artifacts for review.
main.py - Settings & credentials · Persists API keys, GCP project/location, and publishing settings.
config.py - Runtime dependencies · Python packages plus local FFmpeg and cloud credentials are required.
requirements.txt
AI & Providers
- Research & writing agents · Creates research, scripts, revisions, and SEO-oriented content.
agents.py - Provider client layer · Normalizes provider requests, retries, authentication, and failures.
api_clients.py - Gemini & Search grounding · Core text, research grounding, and TTS model family.
- Visual generation providers · Vertex AI and optional WaveSpeed generate images or video.
- NewsAPI
Media Production
- Pipeline coordinator · Owns conditional stages, intermediate outputs, status, and failures.
pipeline.py - Narration & audio mix · Generates multi-speaker speech and optional background music.
pipeline.py - Visuals & thumbnail · Produces generation inputs, visuals, and thumbnails.
pipeline.py - Visual style preset
cyberpunk.json - Video rendering · FFmpeg assembles audio and visuals into the final video.
pipeline.py - Captions & timing · Whisper timing and pysubs2 styling create captioned output.
temp_preview.ass
Publishing
- SEO metadata & chapters · Produces title, description, tags, and chapter timestamps.
pipeline.py - YouTube & Facebook upload · Publishes reviewed media; YouTube uses local OAuth credentials.
pipeline.py
Connections 23
- Launch wrappers → Application entry: starts
- Application entry → CustomTkinter UI: hosts
- CustomTkinter UI → Settings & credentials: reads and saves settings
- CustomTkinter UI → Pipeline coordinator: submits generation request
- Settings & credentials → Provider client layer: supplies credentials
- Pipeline coordinator → Research & writing agents: runs research and writing
- Research & writing agents → Provider client layer: uses provider calls
- Provider client layer → Gemini & Search grounding: text, grounding, TTS
- Provider client layer → NewsAPI: retrieves headlines
- Provider client layer → Visual generation providers: generates images or video
- Pipeline coordinator → Narration & audio mix: creates narration
- Pipeline coordinator → Visuals & thumbnail: creates visual assets
- Visual style preset → Visuals & thumbnail: guides style
- Narration & audio mix → Video rendering: audio track
- Visuals & thumbnail → Video rendering: visual assets
- Pipeline coordinator → Captions & timing: generates subtitles
- Video rendering → Captions & timing: video for alignment
- Captions & timing → YouTube & Facebook upload: captioned video
- Pipeline coordinator → SEO metadata & chapters: generates metadata
- SEO metadata & chapters → CustomTkinter UI: reviewable metadata
- SEO metadata & chapters → YouTube & Facebook upload: title, tags, chapters
- CustomTkinter UI → YouTube & Facebook upload: publishing choice
- Runtime dependencies → Application entry: runtime requirements