AI-powered video generation using Claude and Remotion, running on Cloudflare Workers with the Cloudflare Sandbox SDK.
- AI-Driven Video Creation - Describe your video in natural language, powered by Claude
- Live Preview - Real-time preview powered by Remotion development server
- Asset Support - Upload images, videos, and audio files for use in your compositions
- Video Export - Render and download in MP4
- Cloudflare Workers - Serverless compute platform
- Cloudflare Sandbox SDK - Isolated container environments using CLoudflare Containers
- Hono - Lightweight web framework
- Remotion - React-based video generation framework
- Claude AI - Code generation via Cloudflare AI Gateway
- Node.js 18+
- Cloudflare account with Workers Paid plan
- Docker installed
-
Clone the repository:
git clone https://github.com/harshil1712/vibe-video-generator.git cd vibe-video-generator -
Install dependencies:
npm install
-
Authenticate with Cloudflare:
npx wrangler login
-
Create a new AI Gateway
- Go to AI Gateway dashboard
- Enter fun-demo in the Gateway ID field.
- Click on Create
- Start Docker desktop
- Start the local development server with hot reload:
npm run devThis runs wrangler dev which provides a local environment for testing your Worker.
Deploy to Cloudflare:
npm run deployType generation for Cloudflare bindings:
npm run cf-typegenThis command should be run after modifying wrangler.jsonc (bindings, environment variables, or Durable Object configuration).
Generate a video using AI with real-time streaming responses.
Request:
Content-Type: multipart/form-datatext(required): Natural language description of the video to generateassets(optional): File uploads (images, videos, audio)
Response:
- Server-Sent Events (SSE) stream with events:
status: Operation status messagestext: AI reasoning and code generationtool_start: Tool execution startedtool_end: Tool execution completeddone: Video generation complete with preview URLerror: Error occurred during processing
Render and download a completed video.
Request:
{
"compositionId": "HelloWorld",
"format": "mp4"
}Response:
- Binary video file with appropriate
Content-Typeheader
├── src/
│ ├── index.ts # Main worker entry point with routes
│ ├── assets.ts # Asset validation and utilities
│ ├── prompt.ts # AI system prompt generation
│ ├── tools.ts # AI tool definitions
│ └── skills/ # Remotion skill documentation
│ ├── index.ts # Skill registry and exports
│ ├── types.ts # TypeScript interfaces
│ └── rules/ # Individual skill content
├── public/
│ └── index.html # Frontend UI (Alpine.js + Tailwind)
├── Dockerfile # Container image for sandbox
├── wrangler.jsonc # Cloudflare Workers configuration
└── package.json # Dependencies
- Cloudflare Workers - Complete Workers platform documentation
- Cloudflare Sandbox SDK - Sandbox container documentation
- Durable Objects - Persistent state and coordination
- AI Gateway - Unified interface to AI models
- Remotion - Video generation with React
- Hono - Web framework for Workers
- Vercel AI SDK - AI model integration and streaming
- Alpine.js - Frontend interactivity
- Anthropic Claude API - Claude model documentation
- Node.js API Reference - Node.js runtime reference
- TypeScript Handbook - TypeScript documentation
MIT
See LICENSE file for details.