A node-based AI video generation platform powered by Google Veo 3.1. Create, extend, and chain videos using an intuitive visual interface.
- 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
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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) β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ βββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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
- Node.js 18+ (Frontend)
- Python 3.11+ (Backend)
- PostgreSQL 14+
- Redis 6+
- Google Cloud Account with Veo API access
-
Clone and navigate to backend:
cd Hacathon/backend -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
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
-
Run database migrations:
alembic upgrade head
-
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
-
Navigate to frontend:
cd Hacathon/frontend -
Install dependencies:
pnpm install
-
Configure environment:
# Create .env.local NEXT_PUBLIC_API_URL=http://localhost:8000 -
Start development server:
pnpm dev
-
Open in browser:
http://localhost:3000
| 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 |
POST /api/auth/register- Create new accountPOST /api/auth/login- Login and get tokensPOST /api/auth/refresh- Refresh access tokenGET /api/auth/me- Get current user
GET /api/projects- List all projectsPOST /api/projects- Create new projectGET /api/projects/{id}- Get project with nodesDELETE /api/projects/{id}- Delete project
GET /api/projects/{id}/nodes- List nodesPOST /api/projects/{id}/nodes- Create nodePUT /api/projects/{id}/nodes/{node_id}- Update nodeDELETE /api/projects/{id}/nodes/{node_id}- Delete node
POST /api/ai/generate-video- Start video generationPOST /api/ai/extend-video- Start video extensionPOST /api/ai/enhance-prompt- Enhance prompt with AIGET /api/ai/jobs/{job_id}- Get job status
The repository includes utility scripts for testing and monitoring:
Quick API endpoint validation. Tests authentication, project creation, and video extension request acceptance without waiting for generation.
chmod +x quick_test.sh
./quick_test.shFull end-to-end test of video generation and extension. Takes 6-12 minutes to complete.
chmod +x test_video_flow.sh
./test_video_flow.shMonitor an active job's progress in real-time.
chmod +x monitor_job.sh
./monitor_job.sh <job_id>| 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 |
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API URL | http://localhost:8000 |
- 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)
This project was created for a hackathon. Check with the team for licensing details.