Skip to content

skabartem/contentor

Repository files navigation

Contentor - AI Video Content Automation Platform

Transform ideas into full-length videos using AI-powered automation with manual testing capabilities at every step.

Features

  • Text Generation: Use HERMES-4-70B LLM to generate scripts and narratives
  • Image Generation: Create visual assets from text descriptions
  • Video Generation: Generate video clips from images and narration
  • Video Merging: Combine multiple clips into long-form content
  • Manual Testing: Test each component independently
  • Full Automation: Run complete pipeline from idea to final video

Quick Start

1. Installation

# Clone the repository
git clone <repository-url>
cd contentor

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install FFmpeg (required for video processing)
# Ubuntu/Debian:
sudo apt-get install ffmpeg

# macOS:
brew install ffmpeg

# Windows: Download from https://ffmpeg.org/download.html

2. Configuration

# Copy example configuration
cp config/settings.example.json config/settings.json

# Edit config and add your HERMES API key
nano config/settings.json

Or use the CLI to initialize:

python -m src.cli init

3. Test Individual Components

Test Text Generation

python -m src.cli test-text --idea "The history of space exploration"

Test Image Generation

python -m src.cli test-image --prompt "Astronaut floating in space with Earth in background"

Test Video Generation

python -m src.cli test-video \
  --image output/images/scene_001.png \
  --narration "Humans have always dreamed of exploring the stars" \
  --duration 10

Test Video Merging

python -m src.cli test-merge \
  --videos "output/videos/clip_001.mp4,output/videos/clip_002.mp4,output/videos/clip_003.mp4"

4. Full Automation

Without Manual Checkpoints (Full Auto)

python -m src.cli test-full --idea "The future of artificial intelligence"

With Manual Checkpoints (Test Each Stage)

python -m src.cli test-full \
  --idea "The future of artificial intelligence" \
  --manual-checkpoints

Manual Testing Workflow

This project is designed to let you test each stage of the pipeline independently:

Stage 1: Text Generation

Generate a script from your idea using HERMES-4-70B:

python -m src.cli test-text \
  --idea "Climate change solutions" \
  --style documentary \
  --num-scenes 5

Output: output/text/script.json

Stage 2: Image Generation

Generate images from the script (or custom prompts):

# Will use the script from Stage 1
python -m src.cli test-image \
  --prompt "Solar panels on modern buildings, sustainable city"

Output: output/images/image.png

Stage 3: Video Generation

Create video clips from images:

python -m src.cli test-video \
  --image output/images/scene_001.png \
  --narration "Solar energy is transforming our cities" \
  --duration 8

Output: output/videos/clip.mp4

Stage 4: Video Merging

Combine clips into final long-form video:

python -m src.cli test-merge \
  --videos "output/videos/clip_001.mp4,output/videos/clip_002.mp4" \
  --output-name final_video

Output: output/final/final_video.mp4

Configuration

Edit config/settings.json:

{
  "llm": {
    "model": "Hermes-4-70B",
    "api_key": "sk-your-key-here",
    "default_max_tokens": 2048
  },
  "image": {
    "provider": "placeholder",
    "api_key": ""
  },
  "video": {
    "provider": "ffmpeg"
  }
}

HERMES API Configuration

The HERMES-4-70B API example from NousResearch:

import http.client
import json

conn = http.client.HTTPSConnection("inference-api.nousresearch.com")

payload = json.dumps({
  "model": "Hermes-4-70B",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful AI assistant."
    },
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "max_tokens": 256
})

headers = {
    'Authorization': "Bearer sk-your-api-key",
    'Content-Type': "application/json"
}

conn.request("POST", "/v1/chat/completions", payload, headers)
res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Project Structure

contentor/
├── src/
│   ├── llm/              # HERMES LLM integration
│   ├── image/            # Image generation
│   ├── video/            # Video generation
│   ├── merger/           # Video merging
│   ├── pipeline/         # Full automation pipeline
│   ├── config/           # Configuration management
│   └── cli/              # CLI commands
├── output/               # Generated content
├── config/               # Configuration files
├── examples/             # Example scripts
└── tests/                # Test scripts

CLI Commands

Check System Status

python -m src.cli status

Initialize Configuration

python -m src.cli init

Test Commands

  • test-text - Generate script from idea
  • test-image - Generate single image
  • test-video - Generate single video clip
  • test-merge - Merge multiple videos
  • test-full - Run complete pipeline

Get Help

python -m src.cli --help
python -m src.cli test-full --help

Examples

See the examples/ directory for complete usage examples:

  • simple_text.py - Text generation only
  • simple_video.py - Create single video
  • full_automation.py - Complete automation

Advanced Usage

Custom Video Styles

python -m src.cli test-full \
  --idea "Your idea" \
  --style tutorial \
  --num-scenes 10

Supported styles:

  • documentary
  • tutorial
  • narrative
  • educational

Video Merging with Transitions

python -m src.cli test-merge \
  --videos "clip1.mp4,clip2.mp4,clip3.mp4" \
  --transition fade

Supported transitions:

  • fade - Crossfade between clips
  • dissolve - Dissolve transition

Troubleshooting

FFmpeg Not Found

# Verify FFmpeg installation
ffmpeg -version

# If not installed, install it:
# Ubuntu/Debian:
sudo apt-get install ffmpeg

# macOS:
brew install ffmpeg

API Key Issues

Make sure your HERMES API key is configured:

  1. Edit config/settings.json
  2. Or set environment variable: export HERMES_API_KEY=sk-your-key

Import Errors

Ensure you're running from the project root:

# From contentor/ directory:
python -m src.cli test-text --idea "Your idea"

Output Files

All generated content is saved in the output/ directory:

  • output/text/ - Generated scripts and prompts (JSON)
  • output/images/ - Generated images (PNG)
  • output/videos/ - Generated video clips (MP4)
  • output/final/ - Final merged videos (MP4)

Development

Running Tests

pytest tests/

Code Formatting

black src/

Type Checking

mypy src/

Architecture

The system is designed with modularity in mind:

  1. HERMES Client - Handles all LLM API calls
  2. Text Generator - Creates scripts and content
  3. Image Generator - Generates visual assets
  4. Video Generator - Creates video clips
  5. Video Merger - Combines clips into long videos
  6. Pipeline Orchestrator - Coordinates the full workflow

Each module can be used independently or as part of the complete pipeline.

Requirements

  • Python 3.10+
  • FFmpeg (for video processing)
  • HERMES API key (from NousResearch)
  • 2GB+ free disk space for output files

License

[Your License Here]

Contributing

Contributions are welcome! Please read the contribution guidelines first.

Support

For issues or questions:

  • Check the documentation in PROJECT_PLAN.md and PYTHON_IMPLEMENTATION_GUIDE.md
  • Review logs in contentor.log
  • Open an issue on GitHub

Roadmap

  • Web UI for easier testing
  • Additional image providers (Stability AI, DALL-E)
  • Additional video providers (Runway, Pika)
  • Advanced subtitle support
  • Template system for common video types
  • Batch processing
  • Cloud deployment options

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages