Communitygithub.com

fal-ai 媒体生成

通过 fal.ai MCP 统一生成图像、视频和音频。涵盖文生图 (Nano Banana)、文/图生视频 (Seedance, Kling, Veo 3)、文生语音 (CSM-1B) 以及视频生音频 (ThinkSound)。当用户需要利用 AI 生成图像、视频或音频时使用。

fal-ai 媒体生成 是什么?

这是一个基于 fal.ai MCP 的 AI 技能,允许用户通过统一的 MCP 工具接口生成图像、视频和音频。它封装了多个强大的 fal.ai 模型,包括用于快速迭代的 Nano Banana 2 和高保真度的 Nano Banana Pro,用于视频生成的 Seedance 1.0 Pro(字节跳动)、Kling Video v3 Pro 和 Veo 3(Google DeepMind),以及用于文本转语音的 CSM-1B 和视频转音频的 ThinkSound。该技能需要配置 fal-ai-mcp-server 环境并获取 API 密钥。它通过 `search`、`find`、`generate` 等工具提供模型发现、参数配置、成本估算和异步任务管理功能。用户可以为每个任务指定详细的参数,如提示词、尺寸、时长、种子等,以获得可复现的高质量结果。此外,该技能还支持图像编辑(如局部重绘、风格迁移)、图像转视频、语音克隆以及从视频生成音频,覆盖了从创意构思到专业制作的完整媒体生成流程。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/fal-ai-media

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

fal.ai 媒体生成

易过时技能。 fal.ai 的模型 ID、定价、输入和 MCP 工具名称变化很快。在承诺特定模型、参数、输出格式或费用之前,请搜索或获取当前的模型元数据。

使用 fal.ai 模型通过 MCP 生成图像、视频和音频。

何时激活

  • 用户想要根据文本提示生成图像
  • 从文本或图像创建视频
  • 生成语音、音乐或音效
  • 任何媒体生成任务
  • 用户说“生成图像”、“创建视频”、“文本转语音”、“制作缩略图”或类似内容

MCP 要求

必须配置 fal.ai MCP 服务器。添加到 ~/.claude.json:

"fal-ai": {
  "command": "npx",
  "args": ["-y", "fal-ai-mcp-server"],
  "env": { "FAL_KEY": "YOUR_FAL_KEY_HERE" }
}

在 fal.ai 获取 API 密钥。

MCP 工具

fal.ai MCP 提供以下工具:

  • search — 通过关键词查找可用模型
  • find — 获取模型详情和参数
  • generate — 使用参数运行模型
  • result — 检查异步生成状态
  • status — 检查任务状态
  • cancel — 取消正在运行的任务
  • estimate_cost — 估算生成成本
  • models — 列出热门模型
  • upload — 上传文件用作输入

图像生成

Nano Banana 2 (快速)

最适合:快速迭代、草稿、文生图、图像编辑。

generate(
  app_id: "fal-ai/nano-banana-2",
  input_data: {
    "prompt": "a futuristic cityscape at sunset, cyberpunk style",
    "image_size": "landscape_16_9",
    "num_images": 1,
    "seed": 42
  }
)

Nano Banana Pro (高保真度)

最适合:生产级图像、逼真度、文字排版、详细提示。

generate(
  app_id: "fal-ai/nano-banana-pro",
  input_data: {
    "prompt": "professional product photo of wireless headphones on marble surface, studio lighting",
    "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"
  }
)

视频生成

Seedance 1.0 Pro (字节跳动)

最适合:文生视频、图生视频,具有高动态质量。

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
  }
)

Kling Video v3 Pro

最适合:文/图生视频,原生音频生成。

generate(
  app_id: "fal-ai/kling-video/v3/pro",
  input_data: {
    "prompt": "ocean waves crashing on a rocky coast, dramatic clouds",
    "duration": "5s",
    "aspect_ratio": "16:9"
  }
)

Veo 3 (Google DeepMind)

最适合:带生成声音的视频,高视觉质量。

generate(
  app_id: "fal-ai/veo-3",
  input_data: {
    "prompt": "a bustling Tokyo street market at night, neon signs, crowd noise",
    "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图生视频的源图像

音频生成

CSM-1B (对话式语音)

文本转语音,具有自然的对话质量。

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
  }
)

ThinkSound (视频转音频)

从视频内容生成匹配的音频。

generate(
  app_id: "fal-ai/thinksound",
  input_data: {
    "video_url": "<video_url>",
    "prompt": "ambient forest sounds with birds chirping"
  }
)

ElevenLabs (通过 API,非 MCP)

对于专业语音合成,直接使用 ElevenLabs:

import 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 生成式音频

如果配置了 VideoDB,可使用其生成式音频:

# 语音生成
audio = coll.generate_voice(text="Your narration here", voice="alloy")

# 音乐生成
music = coll.generate_music(prompt="upbeat electronic background music", duration=30)

# 音效
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 在迭代提示时获得可复现的结果
  • 从较低成本的模型(Nano Banana 2)开始迭代提示,然后切换到 Pro 版用于最终输出
  • 对于视频,保持提示描述性强但简洁——专注于运动和场景
  • 图像转视频比纯文生视频产生更可控的结果
  • 在运行昂贵的视频生成之前,检查 estimate_cost

相关技能

  • tasteforge-video — 离线品味蒸馏与模态规划。其端点候选和请求清单仅作为参考,并非已提交的任务或保存的 Fal 工作流。TasteForge 的交接不授权上传或生成;请使用单独授权的提供商工作流,并在执行前验证其当前端点模式。
  • videodb — 视频处理、编辑和流媒体
  • video-editing — AI 驱动的视频编辑工作流
  • content-engine — 社交媒体内容创作

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能