mcpField
F
fal-text-to-video

fal-text-to-video

github.com/josiahsiegel创意与媒体5980 次安装19 周前更新
代码仓库

关于 fal-text-to-video

fal-text-to-video 是介绍如何通过 fal.ai 模型从文本生成视频的技能,面向视频创作者。它提供模型选择参考,并说明动作提示词及各模型支持的时长、画幅、分辨率和音频设置。

主要功能

  1. 01涵盖多种 fal.ai 视频模型
  2. 02按速度和质量选择模型
  3. 03组织动作与镜头提示词
  4. 04设置时长和画幅比例
  5. 05配置支持模型的音频选项

适用场景

  1. 01根据文字描述生成视频
  2. 02为预览或成片选择模型
  3. 03制作带音频的竖屏或横屏视频

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill fal-text-to-video

安装后在 Claude Code 中输入/fal-text-to-video确认已加载。

附带文件references/workflow-examples.md

详细介绍

快速参考

模型端点时长音频速度
Kling 2.6 Profal-ai/kling-video/v2.6/pro/text-to-video5-10s是慢
Sora 2fal-ai/sora5-20s可选慢
LTX-2 Profal-ai/ltx-2-pro5s是中
Runway Turbofal-ai/runway-gen3/turbo/text-to-video5-10s否快
Lumafal-ai/luma-dream-machine5s否中
宽高比值使用场景
横向"16:9"标准视频
纵向"9:16"社交媒体/移动设备
正方形"1:1"社交媒体帖子
提示词结构示例
主体 + 动作"A woman walks"
+ 场景"through a forest"
+ 风格"cinematic lighting"
+ 摄影机"tracking shot"

何时使用此技能

适用于文生视频生成:

  • 根据文本描述创建视频
  • 按质量/速度等级选择模型
  • 编写侧重运动的提示词
  • 生成带原生音频的视频
  • 预览工作流(快速)→ 最终生成(高质量)

相关技能:

  • 图生视频:参见 fal-image-to-video
  • 视频编辑:参见 fal-video-to-video
  • 模型对比:参见 fal-model-guide

fal.ai 文生视频模型

fal.ai 上所有文生视频生成模型的完整参考。

Kling 视频模型

Kling 2.0 Standard

端点: fal-ai/kling-video/v2.0/text-to-video 最适合: 质量良好,成本效益高

import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/kling-video/v2.0/text-to-video", {
  input: {
    prompt: "A majestic eagle soaring over snow-capped mountains at golden hour, cinematic lighting",
    duration: "5",  // "5" or "10" seconds
    aspect_ratio: "16:9",
    negative_prompt: "blurry, distorted, low quality"
  }
});

console.log(result.video.url);
import fal_client

result = fal_client.subscribe(
    "fal-ai/kling-video/v2.0/text-to-video",
    arguments={
        "prompt": "A majestic eagle soaring over mountains",
        "duration": "5",
        "aspect_ratio": "16:9",
        "negative_prompt": "blurry, distorted"
    }
)
print(result["video"]["url"])
Kling 2.5 Pro

端点: fal-ai/kling-video/v2.5/pro/text-to-video 最适合: 专业品质的视频

const result = await fal.subscribe("fal-ai/kling-video/v2.5/pro/text-to-video", {
  input: {
    prompt: "A luxury car driving through a mountain road, drone shot, cinematic",
    duration: "5",
    aspect_ratio: "16:9",
    negative_prompt: "shaky, amateur, blurry"
  }
});
Kling 2.6 Pro(最新)

端点: fal-ai/kling-video/v2.6/pro/text-to-video 最适合: 最高质量,并支持原生音频生成

最新的 Kling 模型,内置音频生成功能。

const result = await fal.subscribe("fal-ai/kling-video/v2.6/pro/text-to-video", {
  input: {
    prompt: "Ocean waves crashing on rocky cliffs at sunset, seagulls flying, ambient sounds",
    duration: "5",
    aspect_ratio: "16:9",
    negative_prompt: "static, boring, low quality"
  }
});

console.log(result.video.url);
console.log(result.audio?.url);  // Native audio included

Kling 参数:

参数类型值描述
promptstring-视频描述
durationstring"5", "10"时长(秒)
aspect_ratiostring"16:9", "9:16", "1:1"视频尺寸
negative_promptstring-要避免的内容

Sora 2

Sora(OpenAI)

端点: fal-ai/sora 最适合: 高级、富有创意的视频生成

const result = await fal.subscribe("fal-ai/sora", {
  input: {
    prompt: "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots. She carries a black purse. She wears sunglasses and red lipstick. She walks confidently. The street is damp and reflective, creating a mirror effect of the colorful lights.",
    duration: 10,
    aspect_ratio: "16:9",
    resolution: "1080p"
  }
});

console.log(result.video.url);

Sora 参数:

参数类型值描述
promptstring-详细的视频描述
durationnumber5-20时长(秒)
aspect_ratiostring"16:9", "9:16", "1:1"视频尺寸
resolutionstring"720p", "1080p"输出分辨率

LTX 视频模型

LTX Video(原版)

端点: fal-ai/ltx-video 最适合: 快速、高效的生成

const result = await fal.subscribe("fal-ai/ltx-video", {
  input: {
    prompt: "A beautiful sunset over the ocean with gentle waves",
    negative_prompt: "low quality, blurry, distorted",
    num_inference_steps: 30,
    guidance_scale: 7.5,
    aspect_ratio: "16:9"
  }
});
LTX Video v2

端点: fal-ai/ltx-video/v2 最适合: 相比 v1 质量有所提升

const result = await fal.subscribe("fal-ai/ltx-video/v2", {
  input: {
    prompt: "A futuristic city with flying cars and neon lights",
    negative_prompt: "ugly, distorted",
    num_inference_steps: 35,
    guidance_scale: 7.0,
    resolution: "720p"
  }
});
LTX-2 Pro

端点: fal-ai/ltx-2-pro 最适合: 高保真度,并支持音频

const result = await fal.subscribe("fal-ai/ltx-2-pro", {
  input: {
    prompt: "A jazz band performing in a dimly lit club, smooth music, intimate atmosphere",
    negative_prompt: "worst quality, inconsistent motion, blurry",
    num_inference_steps: 30,
    guidance_scale: 3.5,
    resolution: "720p",
    enable_audio: true  // Generate matching audio
  }
});

console.log(result.video.url);
console.log(result.audio?.url);  // Audio track if enabled

LTX 参数:

参数类型默认值描述
promptstring-视频描述
negative_promptstring-要避免的内容
num_inference_stepsnumber30质量步数
guidance_scalenumber7.5提示词遵循度
resolutionstring"720p""720p" 或 "480p"
aspect_ratiostring"16:9"视频尺寸
enable_audiobooleanfalse生成音频(LTX-2 Pro)

Wan 视频

Wan v2.1 1.3B

端点: fal-ai/wan/v2.1/1.3b/text-to-video 最适合: 轻量、快速的生成

const result = await fal.subscribe("fal-ai/wan/v2.1/1.3b/text-to-video", {
  input: {
    prompt: "A cat playing with a ball of yarn, cute, playful",
    num_frames: 81,  // Number of frames
    resolution: "480p"
  }
});
Wan v2.1 14B

端点: fal-ai/wan/v2.1/14b/text-to-video 最适合: 更高质量、更大的模型

const result = await fal.subscribe("fal-ai/wan/v2.1/14b/text-to-video", {
  input: {
    prompt: "A professional chef preparing sushi, precise movements, high-end restaurant",
    num_frames: 81,
    resolution: "720p"
  }
});

MiniMax 视频

MiniMax 文本转视频

Endpoint: fal-ai/minimax-video/text-to-video 最适合: 兼顾质量与速度

const result = await fal.subscribe("fal-ai/minimax-video/text-to-video", {
  input: {
    prompt: "A butterfly emerging from a cocoon, macro shot, nature documentary style",
    prompt_optimizer: true  // Enhance prompt automatically
  }
});

MiniMax 参数:

参数类型描述
promptstring视频描述
prompt_optimizerboolean自动优化提示词

Runway Gen-3

Runway Gen-3 Turbo

Endpoint: fal-ai/runway-gen3/turbo/text-to-video 最适合: 快速迭代、预览

const result = await fal.subscribe("fal-ai/runway-gen3/turbo/text-to-video", {
  input: {
    prompt: "A dancer performing ballet in an empty theater, spotlight, graceful movements",
    duration: 5,
    ratio: "16:9"
  }
});

Runway 参数:

参数类型值描述
promptstring-视频描述
durationnumber5, 10秒
ratiostring"16:9", "9:16", "1:1"宽高比

Luma Dream Machine

Luma 文本转视频

Endpoint: fal-ai/luma-dream-machine 最适合: 富有创意和艺术感的视频

const result = await fal.subscribe("fal-ai/luma-dream-machine", {
  input: {
    prompt: "A magical forest with glowing mushrooms and fireflies at night",
    aspect_ratio: "16:9",
    loop: false
  }
});

Luma 参数:

参数类型描述
promptstring视频描述
aspect_ratiostring"16:9", "9:16", "1:1"
loopboolean创建循环视频

CogVideoX

CogVideoX 文本转视频

Endpoint: fal-ai/cogvideox 最适合: 开源替代方案

const result = await fal.subscribe("fal-ai/cogvideox", {
  input: {
    prompt: "A timelapse of a flower blooming, from bud to full bloom",
    num_inference_steps: 50,
    guidance_scale: 6.0
  }
});
CogVideoX-5B

Endpoint: fal-ai/cogvideox-5b 最适合: 质量更高的开源方案

const result = await fal.subscribe("fal-ai/cogvideox-5b", {
  input: {
    prompt: "An astronaut floating in space with Earth in the background",
    num_inference_steps: 50,
    guidance_scale: 6.0,
    num_frames: 49
  }
});

HunyuanVideo

Hunyuan Video

Endpoint: fal-ai/hunyuan-video 最适合: 中国模型,质量出色

const result = await fal.subscribe("fal-ai/hunyuan-video", {
  input: {
    prompt: "A traditional Chinese dragon dance during festival celebration",
    num_inference_steps: 50,
    guidance_scale: 6.0
  }
});

模型对比

质量排名
等级模型质量速度成本
高端Kling 2.6 Pro, Sora 2最高慢$$$
专业Kling 2.5 Pro, LTX-2 Pro高中等$$
标准Kling 2.0, Runway Turbo良好快$
经济LTX v1, CogVideoX可接受快$
功能对比
模型音频时长分辨率最适合用途
Kling 2.6 Pro原生5-10s1080p电影感视频
Sora 2可选5-20s1080p创意视频
LTX-2 Pro有5s720p快速生成高质量视频
Runway Turbo无5-10s720p迭代
MiniMax无6s720p均衡表现
Luma无5s720p艺术创作
速度对比(约)
模型~生成时间(5s 视频)
Runway Gen-3 Turbo30-60s
LTX Video45-90s
MiniMax60-120s
Kling 2.5 Pro120-180s
Kling 2.6 Pro150-240s
Sora 2180-300s

视频提示词工程

组织提示词结构
[Subject] + [Action] + [Setting] + [Style] + [Camera/Technical]

示例:

// Good: Specific, action-oriented
"A golden retriever running through autumn leaves in a forest, slow motion, cinematic, warm lighting, tracking shot"

// Bad: Vague, static
"A dog in a forest"
动作关键词
关键词效果
"walking", "running", "jumping"主体运动
"slow motion", "timelapse"调整速度
"tracking shot", "pan", "zoom"摄像机运动
"floating", "flying", "falling"空间运动
"dancing", "spinning", "waving"节奏性运动
风格关键词
关键词效果
"cinematic"电影般的质感
"documentary"真实风格
"anime"动画风格
"noir"暗色、高对比度
"vibrant"高饱和度色彩
摄像机运动
术语描述
"tracking shot"摄像机跟随主体
"pan left/right"摄像机水平扫动
"tilt up/down"摄像机垂直扫动
"zoom in/out"焦距变化
"drone shot"航拍视角
"POV shot"第一人称视角
"dolly shot"摄像机沿轨道移动

完整参数参考

interface TextToVideoInput {
  // Required
  prompt: string;

  // Duration (varies by model)
  duration?: number | string;  // seconds

  // Dimensions
  aspect_ratio?: "16:9" | "9:16" | "1:1" | "4:3" | "21:9";
  resolution?: "480p" | "720p" | "1080p";

  // Quality control
  negative_prompt?: string;
  num_inference_steps?: number;
  guidance_scale?: number;

  // Reproducibility
  seed?: number;

  // Model-specific
  prompt_optimizer?: boolean;  // MiniMax
  enable_audio?: boolean;      // LTX-2 Pro, Kling 2.6
  loop?: boolean;              // Luma
  num_frames?: number;         // Wan, CogVideoX
}

工作流示例

fal.ai 文本转视频模型的生产工作流和批量生成示例,包括使用 Runway Turbo 快速迭代预览,以及使用 Kling Pro 进行最终渲染,位于 references/workflow-examples.md 中。将模型选择指南转化为可执行的生成代码时,请加载该参考文件。

最佳实践

  1. 使用 subscribe() 而非 run() - 视频生成需要时间
  2. 从预览开始 - 使用更快的模型来迭代提示词
  3. 明确描述动作 - 描述什么在移动以及如何移动
  4. 包含镜头方向 - 引导视觉视角
  5. 使用负面提示词 - 避免常见瑕疵
  6. 根据需求选择模型 - 测试时不要使用高级模型
  7. 包含音频关键词 - 适用于支持音频生成的模型

评论

支持 Markdown