Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.
.claude/skills/affaan-m-fal-ai-media/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 170% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 135% | 0% |
通过 MCP 使用 fal.ai 模型生成图像、视频和音频。
必须配置 fal.ai MCP 服务器。添加到 ~/.claude.json:
json"fal-ai": { "command": "npx", "args": ["-y", "fal-ai-mcp-server"], "env": { "FAL_KEY": "YOUR_FAL_KEY_HERE" } }
在 fal.ai 获取 API 密钥。
fal.ai MCP 提供以下工具:
search — 通过关键词查找可用模型find — 获取模型详情和参数generate — 使用参数运行模型result — 检查异步生成状态status — 检查作业状态cancel — 取消正在运行的作业estimate_cost — 估算生成成本models — 列出热门模型upload — 上传文件用作输入最适合:快速迭代、草稿、文生图、图像编辑。
generate(
app_id: "fal-ai/nano-banana-2",
input_data: {
"prompt": "未来主义日落城市景观,赛博朋克风格",
"image_size": "landscape_16_9",
"num_images": 1,
"seed": 42
}
)最适合:生产级图像、写实感、排版、详细提示。
generate(
app_id: "fal-ai/nano-banana-pro",
input_data: {
"prompt": "专业产品照片,无线耳机置于大理石表面,影棚灯光",
"image_size": "square",
"num_images": 1,
"guidance_scale": 7.5
}
)| 参数 | 类型 | 选项 | 说明 | |-------|------|---------|-------| | prompt | 字符串 | 必需 | 描述您想要的内容 | | image_size | 字符串 | square、portrait_4_3、landscape_16_9、portrait_16_9、landscape_4_3 | 宽高比 | | num_images | 数字 | 1-4 | 生成数量 | | seed | 数字 | 任意整数 | 可重现性 | | guidance_scale | 数字 | 1-20 | 遵循提示的紧密程度(值越高越贴近字面) |
使用 Nano Banana 2 并输入图像进行修复、扩展或风格迁移:
# 首先上传源图像
upload(file_path: "/path/to/image.png")
# 然后使用图像输入进行生成
generate(
app_id: "fal-ai/nano-banana-2",
input_data: {
"prompt": "same scene but in watercolor style",
"image_url": "<uploaded_url>",
"image_size": "landscape_16_9"
}
)最适合:文生视频、图生视频,具有高运动质量。
generate(
app_id: "fal-ai/seedance-1-0-pro",
input_data: {
"prompt": "a drone flyover of a mountain lake at golden hour, cinematic",
"duration": "5s",
"aspect_ratio": "16:9",
"seed": 42
}
)最适合:文生/图生视频,带原生音频生成。
generate(
app_id: "fal-ai/kling-video/v3/pro",
input_data: {
"prompt": "海浪拍打着岩石海岸,乌云密布",
"duration": "5s",
"aspect_ratio": "16:9"
}
)最适合:带生成声音的视频,高视觉质量。
generate(
app_id: "fal-ai/veo-3",
input_data: {
"prompt": "夜晚熙熙攘攘的东京街头市场,霓虹灯招牌,人群喧嚣",
"aspect_ratio": "16:9"
}
)从现有图像开始:
generate(
app_id: "fal-ai/seedance-1-0-pro",
input_data: {
"prompt": "camera slowly zooms out, gentle wind moves the trees",
"image_url": "<uploaded_image_url>",
"duration": "5s"
}
)| 参数 | 类型 | 选项 | 说明 | |-------|------|---------|-------| | prompt | 字符串 | 必需 | 描述视频内容 | | duration | 字符串 | "5s"、"10s" | 视频长度 | | aspect_ratio | 字符串 | "16:9"、"9:16"、"1:1" | 帧比例 | | seed | 数字 | 任意整数 | 可重现性 | | image_url | 字符串 | URL | 用于图生视频的源图像 |
文本转语音,具有自然、对话式的音质。
generate(
app_id: "fal-ai/csm-1b",
input_data: {
"text": "Hello, welcome to the demo. Let me show you how this works.",
"speaker_id": 0
}
)根据视频内容生成匹配的音频。
generate(
app_id: "fal-ai/thinksound",
input_data: {
"video_url": "<video_url>",
"prompt": "ambient forest sounds with birds chirping"
}
)如需专业的语音合成,直接使用 ElevenLabs:
pythonimport os import requests resp = requests.post( "https://api.elevenlabs.io/v1/text-to-speech/<voice_id>", headers={ "xi-api-key": os.environ["ELEVENLABS_API_KEY"], "Content-Type": "application/json" }, json={ "text": "Your text here", "model_id": "eleven_turbo_v2_5", "voice_settings": {"stability": 0.5, "similarity_boost": 0.75} } ) with open("output.mp3", "wb") as f: f.write(resp.content)
如果配置了 VideoDB,使用其生成式音频:
python# Voice generation audio = coll.generate_voice(text="Your narration here", voice="alloy") # Music generation music = coll.generate_music(prompt="upbeat electronic background music", duration=30) # Sound effects sfx = coll.generate_sound_effect(prompt="thunder crack followed by rain")
生成前,检查估算成本:
estimate_cost(
estimate_type: "unit_price",
endpoints: {
"fal-ai/nano-banana-pro": {
"unit_quantity": 1
}
}
)查找特定任务的模型:
search(query: "text to video")
find(endpoint_ids: ["fal-ai/seedance-1-0-pro"])
models()seed 以获得可重现的结果estimate_costvideodb — 视频处理、编辑和流媒体video-editing — AI 驱动的视频编辑工作流content-engine — 社交媒体平台内容创作| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-17 | fail→fail | 9,660 | 1,640 | -83% | 1 | 1 | 0% | 1,485 | 2,387 | +61% | 0 | 0 | — |
case-01 | fail→fail | 7,698 | 5,865 | -24% | 1 | 1 | 0% | 1,454 | 2,621 | +80% | 0 | 0 | — |
case-02 | fail→pass | 5,699 | 3,031 | -47% | 1 | 1 | 0% | 1,016 | 2,740 | +170% | 0 | 0 | — |
case-03 | fail→fail | 11,448 | 6,660 | -42% | 1 | 1 | 0% | 537 | 2,445 | +355% | 0 | 0 | — |
case-18 | pass→pass | 7,194 | 1,814 | -75% | 1 | 1 | 0% | 1,312 | 2,408 | +84% | 0 | 0 | — |
case-04 | fail→pass | 10,406 | 3,161 | -70% | 1 | 1 | 0% | 1,891 | 2,671 | +41% | 0 | 0 | — |
case-05 | fail→pass | 12,740 | 5,581 | -56% | 1 | 1 | 0% | 2,290 | 3,195 | +40% | 0 | 0 | — |
case-06 | fail→pass | 20,444 | 4,281 | -79% | 1 | 1 | 0% | 2,004 | 2,805 | +40% | 0 | 0 | — |
case-07 | fail→pass | 7,605 | 3,779 | -50% | 1 | 1 | 0% | 1,177 | 2,765 | +135% | 0 | 0 | — |
case-08 | fail→pass | 8,946 | 2,128 | -76% | 1 | 1 | 0% | 1,471 | 2,580 | +75% | 0 | 0 | — |
case-09 | pass→pass | 9,353 | 11,541 | +23% | 1 | 1 | 0% | 2,018 | 4,156 | +106% | 0 | 0 | — |
case-10 | pass→pass | 9,010 | 2,262 | -75% | 1 | 1 | 0% | 929 | 2,514 | +171% | 0 | 0 | — |
case-11 | fail→pass | 5,672 | 2,005 | -65% | 1 | 1 | 0% | 1,021 | 2,384 | +133% | 0 | 0 | — |
case-12 | fail→fail | 12,315 | 5,375 | -56% | 1 | 1 | 0% | 2,277 | 2,818 | +24% | 0 | 0 | — |
case-13 | fail→pass | 11,105 | 2,814 | -75% | 1 | 1 | 0% | 2,142 | 2,591 | +21% | 0 | 0 | — |
case-14 | fail→fail | 5,105 | 3,744 | -27% | 1 | 1 | 0% | 858 | 2,712 | +216% | 0 | 0 | — |
case-15 | fail→fail | 3,411 | 2,356 | -31% | 1 | 1 | 0% | 625 | 2,406 | +285% | 0 | 0 | — |
case-16 | fail→fail | 12,858 | 2,403 | -81% | 1 | 1 | 0% | 2,443 | 2,572 | +5% | 0 | 0 | — |
case-19 | pass→pass | 2,968 | 2,260 | -24% | 1 | 1 | 0% | 489 | 2,605 | +433% | 0 | 0 | — |
case-20 | pass→pass | 5,762 | 4,066 | -29% | 1 | 1 | 0% | 1,042 | 2,916 | +180% | 0 | 0 | — |
case-21 | pass→pass | 15,668 | 18,230 | +16% | 1 | 1 | 0% | 3,072 | 5,981 | +95% | 0 | 0 | — |
case-22 | pass→pass | 4,989 | 4,093 | -18% | 1 | 1 | 0% | 974 | 2,825 | +190% | 0 | 0 | — |
case-23 | pass→pass | 7,214 | 2,853 | -60% | 1 | 1 | 0% | 1,282 | 2,601 | +103% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +35 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 8/3/2026 | +32% |
| gemini-3.6-flash | verified | 8/3/2026 | +35% |
Other measured skills in the registry, with their headline benchmark lift.