Skip to content

Repository files navigation

Axel - AIcd Video Generation Platform.

A node-based AI video generation platform powered by Google Veo 3.1. Create, extend, and chain videos using an intuitive visual interface.

🎯 Features.

  • Text-to-Video Generation: Generate high-quality videos from text prompts
  • Image-to-Video Generation: Animate static images into videos
  • Video Extension: Seamlessly extend videos with temporal continuity (up to 20 extensions)
  • Character Consistency: Maintain character features across video sequences using face analysis
  • Node-Based Editor: Visual workflow using React Flow for intuitive video creation
  • Real-time Progress: WebSocket updates for live generation progress tracking

πŸ—οΈ Architecture.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Frontend (Next.js)                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Landing Page β”‚  β”‚ Auth (Login) β”‚  β”‚ Main Editor (Canvas) β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                              β”‚                                   β”‚
β”‚                    React Flow Canvas                             β”‚
β”‚           (Prompt, Image, Video, Extension Nodes)                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                    REST API + WebSocket
                               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       Backend (FastAPI)                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Auth API   β”‚  β”‚ Projects   β”‚  β”‚ Nodes API  β”‚  β”‚ AI API    β”‚ β”‚
β”‚  β”‚ /api/auth  β”‚  β”‚ /api/proj  β”‚  β”‚ /api/nodes β”‚  β”‚ /api/ai   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                              β”‚                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚                    Services Layer                          β”‚ β”‚
β”‚  β”‚  VeoService β”‚ FaceService β”‚ PromptService β”‚ StorageService β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Celery Workers                            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ Video Generation β”‚  β”‚ Video Extension   β”‚  β”‚ Face Analysisβ”‚ β”‚
β”‚  β”‚ Worker           β”‚  β”‚ Worker            β”‚  β”‚ Worker       β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      External Services                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ PostgreSQL β”‚  β”‚   Redis    β”‚  β”‚ Google Veo β”‚  β”‚    GCS    β”‚ β”‚
β”‚  β”‚ (Database) β”‚  β”‚ (Broker)   β”‚  β”‚  3.1 API   β”‚  β”‚ (Storage) β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure.

Hacathon/
β”œβ”€β”€ backend/                    # FastAPI Backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/               # REST API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py        # Authentication (register, login, refresh)
β”‚   β”‚   β”‚   β”œβ”€β”€ projects.py    # Project CRUD operations
β”‚   β”‚   β”‚   β”œβ”€β”€ nodes.py       # Node management
β”‚   β”‚   β”‚   β”œβ”€β”€ connections.py # Node connections
β”‚   β”‚   β”‚   β”œβ”€β”€ ai.py          # AI operations (generate, extend)
β”‚   β”‚   β”‚   └── websocket.py   # Real-time updates
β”‚   β”‚   β”œβ”€β”€ core/              # Core infrastructure
β”‚   β”‚   β”‚   β”œβ”€β”€ database.py    # PostgreSQL + SQLAlchemy
β”‚   β”‚   β”‚   β”œβ”€β”€ celery_app.py  # Task queue configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ redis.py       # Redis connection
β”‚   β”‚   β”‚   └── security.py    # JWT authentication
β”‚   β”‚   β”œβ”€β”€ models/            # SQLAlchemy ORM models
β”‚   β”‚   β”œβ”€β”€ schemas/           # Pydantic schemas
β”‚   β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ veo_service.py # Google Veo 3.1 integration
β”‚   β”‚   β”‚   β”œβ”€β”€ face_service.py# Face analysis for character consistency
β”‚   β”‚   β”‚   β”œβ”€β”€ prompt_service.py # AI prompt enhancement
β”‚   β”‚   β”‚   └── storage_service.py # GCS file storage
β”‚   β”‚   β”œβ”€β”€ workers/           # Celery worker implementations
β”‚   β”‚   └── tasks/             # Celery task definitions
β”‚   β”œβ”€β”€ alembic/               # Database migrations
β”‚   β”œβ”€β”€ tests/                 # Test suite
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── docker-compose.yml
β”‚
β”œβ”€β”€ frontend/                   # Next.js Frontend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ page.tsx           # Landing page
β”‚   β”‚   β”œβ”€β”€ login/             # Authentication
β”‚   β”‚   └── main/              # Main editor
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ canvas/            # React Flow components
β”‚   β”‚   β”‚   β”œβ”€β”€ ReactFlowCanvas.tsx  # Main canvas
β”‚   β”‚   β”‚   β”œβ”€β”€ nodes/         # Custom node types
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ VideoNodeRF.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PromptNodeRF.tsx
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ImageNodeRF.tsx
β”‚   β”‚   β”‚   β”‚   └── ExtensionNodeRF.tsx
β”‚   β”‚   β”‚   └── edges/         # Custom edge types
β”‚   β”‚   β”œβ”€β”€ landing/           # Landing page sections
β”‚   β”‚   └── ui/                # Reusable UI components
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ api.ts             # API client
β”‚   β”‚   β”œβ”€β”€ contexts/          # React contexts (Auth)
β”‚   β”‚   └── types/             # TypeScript types
β”‚   └── package.json
β”‚
β”œβ”€β”€ monitor_job.sh             # Job monitoring utility
β”œβ”€β”€ quick_test.sh              # Quick API test script
└── test_video_flow.sh         # Full E2E test script

πŸš€ Getting Started.

Prerequisites

  • Node.js 18+ (Frontend)
  • Python 3.11+ (Backend)
  • PostgreSQL 14+
  • Redis 6+
  • Google Cloud Account with Veo API access

Backend Setup

  1. Clone and navigate to backend:

    cd Hacathon/backend
  2. Create virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Configure environment variables:

    cp .env.example .env
    # Edit .env with your configuration:
    # - DATABASE_URL: PostgreSQL connection string
    # - REDIS_URL: Redis connection string
    # - GEMINI_API_KEY: Google Gemini/Veo API key
    # - GCS_BUCKET: Google Cloud Storage bucket name
    # - JWT_SECRET: Secret key for JWT tokens
  5. Run database migrations:

    alembic upgrade head
  6. Start the backend:

    # Terminal 1: API Server
    uvicorn app.main:app --reload --port 8000
    
    # Terminal 2: Celery Worker
    celery -A app.core.celery_app worker --loglevel=info

Frontend Setup

  1. Navigate to frontend:

    cd Hacathon/frontend
  2. Install dependencies:

    pnpm install
  3. Configure environment:

    # Create .env.local
    NEXT_PUBLIC_API_URL=http://localhost:8000
  4. Start development server:

    pnpm dev
  5. Open in browser:

    http://localhost:3000
    

πŸ”§ Node Types

Node Type Purpose Inputs Outputs
Prompt Text description for video - Text prompt
Image Source image upload - Image URL
Video Generate video from inputs Prompt, Image (optional) Video URL
Extension Extend existing video Video, Prompt Extended video
Container Group related nodes - -
Ratio Set aspect ratio - Ratio config
Scene Scene configuration - Scene settings

πŸ“‘ API Endpoints

Authentication

  • POST /api/auth/register - Create new account
  • POST /api/auth/login - Login and get tokens
  • POST /api/auth/refresh - Refresh access token
  • GET /api/auth/me - Get current user

Projects

  • GET /api/projects - List all projects
  • POST /api/projects - Create new project
  • GET /api/projects/{id} - Get project with nodes
  • DELETE /api/projects/{id} - Delete project

Nodes

  • GET /api/projects/{id}/nodes - List nodes
  • POST /api/projects/{id}/nodes - Create node
  • PUT /api/projects/{id}/nodes/{node_id} - Update node
  • DELETE /api/projects/{id}/nodes/{node_id} - Delete node

AI Operations

  • POST /api/ai/generate-video - Start video generation
  • POST /api/ai/extend-video - Start video extension
  • POST /api/ai/enhance-prompt - Enhance prompt with AI
  • GET /api/ai/jobs/{job_id} - Get job status

πŸ§ͺ Testing Scripts

The repository includes utility scripts for testing and monitoring:

quick_test.sh

Quick API endpoint validation. Tests authentication, project creation, and video extension request acceptance without waiting for generation.

chmod +x quick_test.sh
./quick_test.sh

test_video_flow.sh

Full end-to-end test of video generation and extension. Takes 6-12 minutes to complete.

chmod +x test_video_flow.sh
./test_video_flow.sh

monitor_job.sh

Monitor an active job's progress in real-time.

chmod +x monitor_job.sh
./monitor_job.sh <job_id>

πŸ” Environment Variables

Backend (.env)

Variable Description Example
DATABASE_URL PostgreSQL connection postgresql+asyncpg://user:pass@localhost:5432/videogen
REDIS_URL Redis connection redis://localhost:6379/0
GEMINI_API_KEY Google Gemini API key your-api-key
GCS_BUCKET GCS bucket for videos your-bucket-name
JWT_SECRET Secret for JWT signing your-secret-key
VEO_MODEL Veo model version veo-3.1-generate-preview

Frontend (.env.local)

Variable Description Example
NEXT_PUBLIC_API_URL Backend API URL http://localhost:8000

🎬 Video Generation Specs

  • Resolutions: 720p
  • Aspect Ratios: 16:9, 9:16, 1:1
  • Duration: 4-8 seconds per generation
  • Extensions: Up to 20 per video chain
  • Models: Standard (higher quality) or Fast (quicker generation)

πŸ“„ License

This project was created for a hackathon. Check with the team for licensing details.

About

ehala

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages