{"id":31814650,"url":"https://github.com/cotneo/fal-i2v-service","last_synced_at":"2025-10-11T08:58:14.079Z","repository":{"id":318084426,"uuid":"1069942308","full_name":"CotNeo/fal-i2v-service","owner":"CotNeo","description":"\u003e Node.js + Express-based **FAL AI Image-to-Video** integration \u003e Generates video by taking a user prompt and an image","archived":false,"fork":false,"pushed_at":"2025-10-04T23:43:56.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T01:16:46.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CotNeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T23:39:24.000Z","updated_at":"2025-10-04T23:44:00.000Z","dependencies_parsed_at":"2025-10-05T01:16:47.756Z","dependency_job_id":"dc14bfe0-646d-4e51-a776-fc97f0945ff8","html_url":"https://github.com/CotNeo/fal-i2v-service","commit_stats":null,"previous_names":["cotneo/fal-i2v-service"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/CotNeo/fal-i2v-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CotNeo%2Ffal-i2v-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CotNeo%2Ffal-i2v-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CotNeo%2Ffal-i2v-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CotNeo%2Ffal-i2v-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CotNeo","download_url":"https://codeload.github.com/CotNeo/fal-i2v-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CotNeo%2Ffal-i2v-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006638,"owners_count":26084150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-11T08:58:12.050Z","updated_at":"2025-10-11T08:58:14.067Z","avatar_url":"https://github.com/CotNeo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎬 fal-i2v-service\n\n\u003e Node.js + Express tabanlı **FAL AI Image-to-Video** entegrasyonu\n\u003e Kullanıcıdan prompt + resim alarak video üretir. Hem **senkron (blocking)** hem de **queue + webhook** (önerilen) yöntemlerini destekler.\n\n---\n\n## 🚀 Özellikler\n\n* [x] Express REST API\n* [x] `@fal-ai/client` ile FAL AI entegrasyonu\n* [x] .env üzerinden API key yönetimi\n* [x] Prompt + image URL ile senkron video üretimi\n* [x] Queue + Webhook ile uzun süren işler\n* [x] Dosya upload → FAL storage’a otomatik yükleme\n* [x] Status \u0026 result endpointleri\n* [x] Pino logger + error middleware\n* [x] Zod ile input doğrulama\n\n---\n\n## 📦 Kurulum\n\n### 1. Repo indir\n\n```bash\ngit clone https://github.com/cotneo/fal-i2v-service.git\ncd fal-i2v-service\n```\n\n### 2. Bağımlılıkları yükle\n\n```bash\nnpm install\n```\n\n### 3. Ortam değişkenlerini ayarla\n\nKök dizine `.env` dosyası oluştur:\n\n```env\nPORT=3000\nFAL_KEY=YOUR_FAL_API_KEY\nPUBLIC_BASE_URL=http://localhost:3000\n```\n\n### 4. Çalıştır\n\n```bash\nnpm run dev\n```\n\nSağlık kontrolü:\n\n```bash\ncurl http://localhost:3000/health\n# {\"ok\":true}\n```\n\n---\n\n## 📂 Dosya Yapısı\n\n```\nsrc/\n ├─ index.js            # Express uygulaması\n ├─ routes/\n │   ├─ i2v.js          # I2V API rotaları\n │   └─ webhooks.js     # Webhook listener\n ├─ lib/\n │   ├─ fal.js          # FAL client wrapper\n │   └─ validation.js   # Zod schema\n └─ utils/\n     ├─ logger.js       # Pino logger\n     └─ errors.js       # Error handler\n```\n\n---\n\n## 🔑 API Endpointleri\n\n### 1) Senkron Video Üretimi\n\nİş bitene kadar bekler. Küçük işler için uygundur.\n\n```http\nPOST /api/i2v/run-sync\nContent-Type: application/json\n```\n\nBody:\n\n```json\n{\n  \"prompt\": \"An intimate close-up ...\",\n  \"image_url\": \"https://storage.googleapis.com/falserverless/example_inputs/ovi_i2v_input.png\",\n  \"num_inference_steps\": 30,\n  \"resolution\": \"992x512\"\n}\n```\n\n---\n\n### 2) Queue + Webhook (Önerilen)\n\nUzun süren işler için.\n\n```http\nPOST /api/i2v/submit\n```\n\nDönüş:\n\n```json\n{\n  \"requestId\": \"764c-....\",\n  \"status\": \"SUBMITTED\",\n  \"webhookUrl\": \"http://localhost:3000/webhooks/fal/i2v\"\n}\n```\n\nWebhook → `/webhooks/fal/i2v`\nStatus sorgulama:\n\n```http\nGET /api/i2v/status/:id\n```\n\nResult alma:\n\n```http\nGET /api/i2v/result/:id\n```\n\n---\n\n### 3) Dosya Upload + Queue\n\nForm-data ile resim dosyası gönder:\n\n```http\nPOST /api/i2v/submit-upload\n```\n\nBody:\n\n```\nprompt = \"Some prompt...\"\nimage  = \u003cdosya\u003e\n```\n\n---\n\n## 🛡️ Güvenlik Notları\n\n* **FAL_KEY** gisadece backend’de kullanılmalı. Client’a asla sızdırma.\n* Webhook güvenliği için gizli token veya IP allowlist kullan.\n* Kullanıcı promptları sanitize edilmeli (ör. uygunsuz içerik filtreleme).\n* Dönen videoları kalıcı saklamak için kendi S3/GCS altyapına indir.\n\n---\n\n## 📌 Yol Haritası\n\n* [ ] MongoDB entegrasyonu → job kayıtları\n* [ ] Admin panel (React) → job listesi + video player\n* [ ] JWT auth ile kullanıcı bazlı job yönetimi\n* [ ] Dockerfile + CI/CD pipeline\n\n---\n\n# 🎬 fal-i2v-service\n\n\u003e Node.js + Express-based **FAL AI Image-to-Video** integration\n\u003e Generates video by receiving a user prompt and an image. Supports both **synchronous (blocking)** and **queue + webhook** (recommended) methods.\n\n---\n\n## 🚀 Features\n\n* [x] Express REST API\n* [x] FAL AI integration with `@fal-ai/client`\n* [x] API key management via .env\n* [x] Synchronous video generation with prompt + image URL\n* [x] Queue + Webhook for long-running tasks\n* [x] File upload → automatic upload to FAL storage\n* [x] Status \u0026 result endpoints\n* [x] Pino logger + error middleware\n* [x] Input validation with Zod\n\n---\n\n## 📦 Installation\n\n### 1. Download the repo\n\n```bash\ngit clone https://github.com/cotneo/fal-i2v-service.git\ncd fal-i2v-service\n```\n\n### 2. Install dependencies\n\n```bash\nnpm install\n```\n\n### 3. Environment Set the variables\n\nCreate a `.env` file in the root directory:\n\n```env\nPORT=3000\nFAL_KEY=YOUR_FAL_API_KEY\nPUBLIC_BASE_URL=http://localhost:3000\n```\n\n### 4. Run\n\n```bash\nnpm run dev\n```\n\nHealth check:\n\n```bash\ncurl http://localhost:3000/health\n# {\"ok\":true}\n```\n\n---\n\n## 📂 File Structure\n\n```\nsrc/\n├─ index.js # Express application\n├─ routes/\n│ ├─ i2v.js # I2V API routes\n│ └─ webhooks.js # Webhook listener\n├─ lib/\n│ ├─ fal.js # FAL client wrapper\n\n│ └─ validation.js # Zod schema\n\n└─ utils/\n\n├─ logger.js # Pino logger\n\n└─ errors.js # Error handler\n```\n\n---\n\n## 🔑 API Endpoints\n\n### 1) Synchronous Video Production\n\nWaits until the job is completed. Suitable for small jobs.\n\n```http\nPOST /api/i2v/run-sync\nContent-Type: application/json\n```\n\nBody:\n\n```json\n{ \n\"prompt\": \"An intimate close-up ...\", \n\"image_url\": \"https://storage.googleapis.com/falserverless/example_inputs/ovi_i2v_input.png\", \n\"num_inference_steps\": 30, \n\"resolution\": \"992x512\"\n}\n```\n\n---\n\n### 2) Queue + Webhook (Recommended)\n\nFor long lasting jobs.\n\n```http\nPOST /api/i2v/submit\n```\n\nReturn:\n\n```json\n{\n\"requestId\": \"764c-....\",\n\"status\": \"SUBMITTED\",\n\"webhookUrl\": \"http://localhost:3000/webhooks/fal/i2v\"\n}\n```\n\nWebhook → `/webhooks/fal/i2v`\nStatus query:\n\n```http\nGET /api/i2v/status/:id\n```\n\nResult:\n\n```http\nGET /api/i2v/result/:id\n```\n\n---\n\n### 3) File Upload + Queue\n\nSend image file with form-data:\n\n```http\nPOST /api/i2v/submit-upload\n```\n\nBody:\n\n```\nprompt = \"Some prompt...\"\nimage = \u003cfile\u003e\n```\n\n---\n\n## 🛡️ Security Notes\n\n* **FAL_KEY** should only be used in the backend. Never leak it to the client.\n* Use a secret token or IP allowlist for webhook security.\n* User prompts should be sanitized (e.g., inappropriate content filtering).\n* Download looped videos to your own S3/GCS infrastructure for persistent storage.\n\n---\n\n## 📌 Roadmap\n\n* [ ] MongoDB integration → job records\n* [ ] Admin panel (React) → job list + video player\n* [ ] User-based job management with JWT auth\n* [ ] Dockerfile + CI/CD pipeline\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotneo%2Ffal-i2v-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcotneo%2Ffal-i2v-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotneo%2Ffal-i2v-service/lists"}