Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title Shorts Machine
colorFrom purple
colorTo blue
sdk docker
app_port 7860

Autonomous Shorts Machine

The Autonomous Shorts Machine is an end-to-end, AI-powered pipeline designed to generate, composite, and publish short-form video content entirely autonomously. Built as a FastAPI backend, the system orchestrates a complex workflow involving natural language generation, text-to-speech synthesis, dynamic video composition, and automated social distribution.

Core Capabilities

The machine operates through several distinct content generation modes, each tailored to specific audiences and formats:

  • Technology & AI News: Aggregates recent technology news, synthesizes concise scripts, and overlays the narration onto gameplay background footage.
  • Comedy Duo: Generates conversational comedy sketches featuring distinct interactive voices.
  • Reddit Narratives: Extracts and curates compelling narratives with emotional beat recognition.
  • True Crime: Produces true crime summaries spanning suspenseful pacing and applicable visual effects.
  • Sequential Comics & Manga: An advanced multi-part pipeline that fetches chapters from MangaDex, analyzes panels utilizing vision models, and generates sequential video shorts that accurately trace the original pacing and narrative flow.

System Architecture

The project is structured around asynchronous background workers to ensure responsive API endpoints while processing resource-intensive media operations.

  • API Layer: Powered by FastAPI, exposing endpoints for triggering jobs, monitoring processing health, and scheduling the daily analytics suite.
  • Content Logic Engine: Integrates with the Groq API for rapid, high-quality script generation and formatting.
  • Audio Synthesis: Employs edge-tts for generating accurate, dynamic text-to-speech narration with word-level timestamp alignment for precise subtitle generation.
  • Media Compositor: Leverages FFmpeg and yt-dlp for acquiring background media, cropping, padding, and applying visual text overlays via advanced subtitle formatting.
  • Distribution Network: Stores intermediate assets utilizing Cloudinary and interfaces directly with Google APIs (YouTube), LinkedIn, and Instagram (via authenticated sessions) for automated publishing.

Analytics and Intelligence Engine

A distinct feature of this system is its self-regulating feedback loop. An integrated Brain module autonomously optimizes content strategies based on real-world performance metrics.

  • Daily Analytics Ingestion: Continuous routines fetch engagement metrics (including views, likes, and comments) from published content on networks like YouTube.
  • Engagement Scoring: Implements algorithmic scoring to determine content quality multipliers based primarily on like-to-view ratios.
  • Dynamic Weight Adjustments: Recalculates the execution probability of each content mode using Exponential Moving Averages (EMA). High-performing narrative formats automatically receive elevated priority in subsequent generation cycles, while maintaining a baseline selection floor to ensure continued content variety.
  • SEO Feedback: Correlates high-performing hooks and metadata packaging, refining prospective generation prompts constructed by the language models.

Deployment Principles

The application is fully containerized utilizing Docker and is structurally optimized for deployment across environments offering high concurrent memory accessibility, such as Hugging Face Spaces. It exposes port 7860 and binds to UID 1000 for standard Linux container compatibility. External orchestration tools (for example, Make.com) utilize the exposed REST endpoints to trigger generation schedules and monitor systemic health.

Service Endpoints

  • GET /health: Passive health check validating the API status and enumerating concurrently executing background jobs.
  • POST /run-pipeline: Primary execution hook. Returns a 202 Accepted status and a tracking ID while triggering the entire generative workflow in isolated background threads.
  • POST /daily-analytics: Engages the daily intelligence synchronization routine (analytics polling, metadata recalibration, and programmatic reporting).
  • POST /check-instagram: Validates Instagram session health prior to processing social media distribution tasks.
  • GET /jobs/{job_id}: Job introspection allowing for asynchronous tracking of workflow execution status.

Initial Setup

Deployment mandates Python 3.10 or higher. Strict environment variable requirements encompass multiple API key definitions which must be documented within a standard .env configuration (refer to the .env.example file for strict key specifications).

  1. Ensure the installation of requisite system binaries, specifically FFmpeg, which is paramount for comprehensive media processing and alignment.
  2. Initialize virtual environments and process Python dependencies utilizing pip install -r requirements.txt.
  3. Start the application runtime utilizing uvicorn main:app --host 0.0.0.0 --port 7860.

Note: Distribution functionality on the Instagram network necessitates a current, validated session generated securely utilizing standard execution parameters to mitigate security restrictions commonly associated with automated posting.

About

Autonomous AI Shorts Machine — AI news + gameplay BG + word-by-word subtitles → YouTube Shorts + LinkedIn

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages