# 🚀 fal.ai Model Database

> **Complete database of 1,094 fal.ai models** with pricing, categories, and API documentation links.

[![Models](https://img.shields.io/badge/Models-1,094-blue)](https://fal.ai/models)
[![Categories](https://img.shields.io/badge/Categories-24-green)](https://fal.ai/explore)
[![License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
[![HuggingFace](https://img.shields.io/badge/🤗-Dataset-orange)](https://huggingface.co/datasets/PHY041/fal-ai-models)

## Why This Exists

fal.ai has **1,094+ AI models** for image, video, audio, and 3D generation - but no easy way to browse or compare them all. We crawled everything and made it free & open source.

## Quick Start

### Python (Recommended)
```python
from fal_models import search, get_model, list_by_category

# Search models
results = search("video generation")

# Get specific model
info = get_model("fal-ai/flux/dev")
print(info["api_docs"])  # https://fal.ai/models/fal-ai/flux/dev/api

# List by category
video_models = list_by_category("image-to-video")
```

### Direct JSON Access
```python
import json
with open("data/fal_model_lookup.json") as f:
    models = json.load(f)
    
# 1,094 models indexed by model_id
info = models["fal-ai/flux/dev"]
```

### Claude MCP Server
Add to your Claude config to enable model lookup tools:
```json
{
  "mcpServers": {
    "fal-ai-models": {
      "command": "python3",
      "args": ["path/to/mcp_server.py"]
    }
  }
}
```

Then Claude can:
- `search_fal_models("video generation")`
- `get_fal_model("fal-ai/kling-video/v2.5-turbo/pro/image-to-video")`
- `list_fal_category("text-to-image")`
- `refresh_fal_models()` - re-crawl for latest data

## Data Files

| File | Description |
|------|-------------|
| `data/fal_model_lookup.json` | Main lookup file (537KB) |
| `data/fal_ai_complete_models.json` | Full detailed data (743KB) |
| `data/fal_ai_complete_models.csv` | Spreadsheet format |
| `fal_models.py` | Python helper with search & crawler |
| `mcp_server.py` | Claude MCP server |

## Categories

| Category | Count | Examples |
|----------|-------|----------|
| image-to-image | 347 | FLUX edit, upscalers, style transfer |
| image-to-video | 151 | Kling, Veo, Wan, Sora |
| text-to-image | 149 | FLUX, Stable Diffusion, Imagen |
| video-to-video | 125 | Effects, lipsync, upscaling |
| text-to-video | 102 | Veo 3, Kling, Hailuo |
| text-to-audio | 34 | Music, sound effects |
| vision | 34 | Analysis, NSFW detection |
| training | 33 | LoRA trainers |
| text-to-speech | 23 | ElevenLabs, Chatterbox |
| image-to-3d | 25 | Hunyuan3D, Trellis |
| + 14 more categories... | | |

## Top Models

### Text-to-Image
- `fal-ai/flux/dev` - FLUX.1 [dev] - ~$0.025/megapixel
- `fal-ai/flux-pro/v1.1-ultra` - FLUX1.1 [pro] ultra
- `fal-ai/recraft/v3/text-to-image` - Recraft V3 - $0.04/image

### Image-to-Video
- `fal-ai/kling-video/v2.5-turbo/pro/image-to-video` - Kling 2.5 - $0.07/sec
- `fal-ai/veo3/fast` - Veo 3 Fast - $0.10-0.15/sec
- `fal-ai/wan-25-preview/image-to-video` - Wan 2.5 - $0.05-0.15/sec

### Text-to-Video
- `fal-ai/veo3` - Veo 3 - $0.20-0.40/sec
- `fal-ai/sora-2/text-to-video/pro` - Sora 2 Pro

## How We Crawled It

Instead of scraping 1,094 pages, we found fal.ai's internal API:

```python
# Their API has pagination bugs, so we query by category
CATEGORIES = ["text-to-image", "image-to-video", ...]

for cat in CATEGORIES:
    url = f"https://fal.ai/api/models?limit=500&categories={cat}"
    # fetch and dedupe by model_id
```

**25 API calls → 1,094 unique models → ~5 seconds** ⚡

## Refresh Data

```python
from fal_models import refresh_models
refresh_models()  # Re-crawls fal.ai, saves updated JSON
```

Or CLI:
```bash
python fal_models.py refresh
```

## License

MIT - Use freely, attribution appreciated.

## Contributing

PRs welcome! Ideas:
- Add more pricing data
- Build a web UI
- Create integrations for other AI assistants

---

**Made with 🔥 by [Haoyang Pang](https://github.com/PHY041)**

*Data last updated: January 2026*
