Communitygithub.com

fal-ai-media

透過 fal.ai MCP 統一生成圖片、影片與音訊。涵蓋文字轉圖片 (Nano Banana)、文字/圖片轉影片 (Seedance, Kling, Veo 3)、文字轉語音 (CSM-1B) 以及影片轉音訊 (ThinkSound)。當使用者想要用 AI 生成圖片、影片或音訊時啟用。

fal-ai-media 是什麼?

這個技能整合了 fal.ai MCP 伺服器,提供統一的媒體生成能力,涵蓋圖片、影片與音訊三大領域。它能讓 AI 代理透過標準化的 MCP 工具(如 search、find、generate)直接與 fal.ai 模型互動,無需手動處理 API 請求。支援的模型包括快速迭代用的 Nano Banana 2、高品質圖片生成的 Nano Banana Pro、ByteDance 的 Seedance 1.0、Kling Video v3 Pro、Google DeepMind 的 Veo 3 影片模型,以及 CSM-1B 語音合成和 ThinkSound 影片轉音訊。此技能適用於 Claude Code、Cursor 等支援 MCP 的開發工具,尤其在開發者需要快速生成媒體素材、進行提示迭代或用於原型設計時特別有用。它還提供成本估算、模型探索和非同步任務管理功能,幫助使用者有效控管資源與進度。

相容平台✓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 使用 fal.ai 模型生成圖片、影片和音訊。

何時啟用

  • 使用者想要從文字提示生成圖片
  • 從文字或圖片建立影片
  • 生成語音、音樂或音效
  • 任何媒體生成任務
  • 使用者說「生成圖片」、「建立影片」、「文字轉語音」、「製作縮圖」或類似內容

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 (ByteDance)

最適合:文字轉影片、圖片轉影片,具有高運動品質。

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.

相關技能