apix/services/crawl4ai
Khoa.vo bae4c487da
Some checks are pending
CI / build (18.x) (push) Waiting to run
CI / build (20.x) (push) Waiting to run
feat: add image-to-video support for Meta AI
- Add Litterbox temporary image hosting for image URLs
- Update backend to accept image_base64 parameter
- Update TypeScript client and API route
- Subject button now enabled for Meta AI (for image-to-video)
- Button changes from 'Video' to 'Animate' when subject is set
- Pink/purple gradient for image-to-video, blue/cyan for text-to-video
2026-01-06 14:11:26 +07:00
..
app feat: add image-to-video support for Meta AI 2026-01-06 14:11:26 +07:00
Dockerfile feat: updates before deployment 2026-01-06 13:26:11 +07:00
README.md feat: updates before deployment 2026-01-06 13:26:11 +07:00
requirements.txt feat: updates before deployment 2026-01-06 13:26:11 +07:00

Meta AI Image Generation Service

FastAPI wrapper for Meta AI image generation using metaai-api.

Features

  • 🎨 Image Generation - Generate AI images via Meta AI
  • 🔐 Cookie Auth - Uses Facebook/Meta cookies for authentication
  • Rate Limiting - Built-in rate limiting to prevent shadowban
  • 🐳 Docker Ready - Easy deployment with Docker

Quick Start

Local Development

# Install dependencies
pip install -r requirements.txt
pip install git+https://github.com/mir-ashiq/metaai-api.git

# Run server
uvicorn app.main:app --reload --port 8000

Docker

docker build -t meta-ai-service .
docker run -p 8000:8000 meta-ai-service

API Endpoints

Endpoint Method Description
/health GET Health check
/generate/sync POST Sync generation (waits for result)
/generate POST Async generation (returns task_id)
/status/{task_id} GET Get async task status
/rate-limit GET Get rate limit status

Usage Example

import requests

response = requests.post("http://localhost:8000/generate/sync", json={
    "prompt": "Imagine a beautiful sunset over mountains",
    "cookies": [
        {"name": "c_user", "value": "..."},
        {"name": "xs", "value": "..."},
        # ... other Facebook/Meta cookies
    ]
})

print(response.json())
# {"success": true, "images": [{"url": "...", "prompt": "...", "model": "imagine"}]}

Required Cookies

You need Facebook/Meta cookies for authentication:

Cookie Description
c_user Facebook user ID
xs Facebook session token
sb Session browser identifier
datr Device tracking
abra_sess Meta AI session

Export cookies from browser using Cookie-Editor extension.

Environment Variables

Variable Default Description
META_RATE_LIMIT_DELAY 30 Seconds between requests
META_MAX_REQUESTS_HOUR 30 Max requests per hour

Updating metaai-api

To get the latest version of the underlying library:

pip install -U git+https://github.com/mir-ashiq/metaai-api.git

License

MIT