fal-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesefal.ai Workflow Generator
fal.ai 工作流生成器
Generate 100% working, production-ready fal.ai workflow JSON files. Workflows chain multiple AI models together for complex generation pipelines.
References:
- Model Reference - Detailed model configurations
- Common Patterns - Reusable workflow patterns
- Code Examples - Code snippets and partial examples
Troubleshooting Reference:
- Complete Workflows - Working JSON examples for debugging (use ONLY when user reports errors)
生成100%可运行、适用于生产环境的fal.ai工作流JSON文件。工作流可将多个AI模型链式组合,构建复杂的生成流水线。
参考资料:
- 模型参考 - 详细的模型配置
- 通用模式 - 可复用的工作流模式
- 代码示例 - 代码片段和部分示例
故障排除参考:
- 完整工作流 - 用于调试的可运行JSON示例(仅在用户报告错误时使用)
Core Architecture
核心架构
Valid Node Types
有效节点类型
⚠️ ONLY TWO VALID NODE TYPES EXIST:
| Type | Purpose |
|---|---|
| Execute a model/app |
| Output results to user |
❌ INVALID: - This does NOT exist! Input is defined ONLY in .
type: "input"schema.input⚠️ 仅存在两种有效节点类型:
| 类型 | 用途 |
|---|---|
| 执行模型/应用 |
| 向用户输出结果 |
❌ 无效: - 该类型不存在!输入仅能在中定义。
type: "input"schema.inputMinimal Working Example
最小可运行示例
json
{
"name": "my-workflow",
"title": "My Workflow",
"contents": {
"name": "workflow",
"nodes": {
"output": {
"type": "display",
"id": "output",
"depends": ["node-image"],
"input": {},
"fields": { "image": "$node-image.images.0.url" }
},
"node-image": {
"type": "run",
"id": "node-image",
"depends": ["input"],
"app": "fal-ai/flux/dev",
"input": { "prompt": "$input.prompt" }
}
},
"output": { "image": "$node-image.images.0.url" },
"schema": {
"input": {
"prompt": {
"name": "prompt",
"label": "Prompt",
"type": "string",
"required": true,
"modelId": "node-image"
}
},
"output": {
"image": { "name": "image", "label": "Generated Image", "type": "string" }
}
},
"version": "1",
"metadata": {
"input": { "position": { "x": 0, "y": 0 } },
"description": "Simple text to image workflow"
}
},
"is_public": true,
"user_id": "",
"user_nickname": "",
"created_at": ""
}json
{
"name": "my-workflow",
"title": "My Workflow",
"contents": {
"name": "workflow",
"nodes": {
"output": {
"type": "display",
"id": "output",
"depends": ["node-image"],
"input": {},
"fields": { "image": "$node-image.images.0.url" }
},
"node-image": {
"type": "run",
"id": "node-image",
"depends": ["input"],
"app": "fal-ai/flux/dev",
"input": { "prompt": "$input.prompt" }
}
},
"output": { "image": "$node-image.images.0.url" },
"schema": {
"input": {
"prompt": {
"name": "prompt",
"label": "Prompt",
"type": "string",
"required": true,
"modelId": "node-image"
}
},
"output": {
"image": { "name": "image", "label": "Generated Image", "type": "string" }
}
},
"version": "1",
"metadata": {
"input": { "position": { "x": 0, "y": 0 } },
"description": "Simple text to image workflow"
}
},
"is_public": true,
"user_id": "",
"user_nickname": "",
"created_at": ""
}Reference Syntax
引用语法
| Reference | Use Case | Example |
|---|---|---|
| Input value | |
| LLM text output | |
| First image URL | |
| Single image URL | |
| Video URL | |
| Audio URL | |
| Extracted frame | |
| 引用方式 | 使用场景 | 示例 |
|---|---|---|
| 输入值 | |
| LLM文本输出 | |
| 第一张图片URL | |
| 单张图片URL | |
| 视频URL | |
| 音频URL | |
| 提取的帧 | |
CRITICAL: No String Interpolation
重要提示:禁止字符串插值
⚠️ NEVER mix text with variables! Variable MUST be the ENTIRE value.
json
// ❌ WRONG - WILL BREAK
"prompt": "Create image of $input.subject in $input.style"
// ✅ CORRECT - Variable is the ENTIRE value
"prompt": "$input.prompt"
"prompt": "$node-llm.output"To combine values: Use or . See Model Reference.
fal-ai/text-concatfal-ai/workflow-utilities/merge-text⚠️ 切勿将文本与变量混合!变量必须是整个值。
json
// ❌ 错误 - 会导致故障
"prompt": "Create image of $input.subject in $input.style"
// ✅ 正确 - 变量是整个值
"prompt": "$input.prompt"
"prompt": "$node-llm.output"如需合并值: 使用或。请查看模型参考。
fal-ai/text-concatfal-ai/workflow-utilities/merge-textCritical Rules
关键规则
C1: Dependencies Must Match References
C1:依赖必须与引用匹配
json
// ❌ WRONG
"node-b": {
"depends": [],
"input": { "data": "$node-a.output" }
}
// ✅ CORRECT
"node-b": {
"depends": ["node-a"],
"input": { "data": "$node-a.output" }
}json
// ❌ 错误
"node-b": {
"depends": [],
"input": { "data": "$node-a.output" }
}
// ✅ 正确
"node-b": {
"depends": ["node-a"],
"input": { "data": "$node-a.output" }
}C2: ID Must Match Object Key
C2:ID必须与对象键匹配
json
// ❌ WRONG
"my-node": { "id": "different-id" }
// ✅ CORRECT
"my-node": { "id": "my-node" }json
// ❌ 错误
"my-node": { "id": "different-id" }
// ✅ 正确
"my-node": { "id": "my-node" }C3: Use Correct LLM Type
C3:使用正确的LLM类型
- → Text only, no image_urls
openrouter/router - → ONLY when analyzing images
openrouter/router/vision
- → 仅支持文本,不支持image_urls
openrouter/router - → 仅在分析图片时使用
openrouter/router/vision
C4: Schema modelId Required
C4:Schema必须包含modelId
json
"schema": {
"input": {
"field": { "modelId": "first-consuming-node" }
}
}json
"schema": {
"input": {
"field": { "modelId": "first-consuming-node" }
}
}C5: Output Depends on All Referenced Nodes
C5:输出依赖所有引用的节点
json
"output": {
"depends": ["node-a", "node-b", "node-c"],
"fields": {
"a": "$node-a.video",
"b": "$node-b.images.0.url"
}
}json
"output": {
"depends": ["node-a", "node-b", "node-c"],
"fields": {
"a": "$node-a.video",
"b": "$node-b.images.0.url"
}
}Default Models
默认模型
| Task | Default Model |
|---|---|
| Image generation | |
| Image editing | |
| Video (I2V) | |
| Text LLM | |
| Vision LLM | |
| Music | |
| Upscale | |
| Text concat (2 texts) | |
| Text merge (array) | |
| Video merge | |
| Audio+Video merge | |
| Frame extract | |
| 任务 | 默认模型 |
|---|---|
| 图片生成 | |
| 图片编辑 | |
| 视频(图片转视频) | |
| 文本LLM | |
| 视觉LLM | |
| 音乐生成 | |
| 图片放大 | |
| 文本拼接(2段文本) | |
| 文本合并(数组) | |
| 视频合并 | |
| 音视频合并 | |
| 帧提取 | |
Quick Reference Card
快速参考卡片
Output References
输出引用
| Model Type | Output Reference |
|---|---|
| LLM | |
| Text Concat | |
| Merge Text | |
| Image Gen (array) | |
| Image Process (single) | |
| Video | |
| Music | |
| Frame Extract | |
| 模型类型 | 输出引用方式 |
|---|---|
| LLM | |
| 文本拼接 | |
| 文本合并 | |
| 图片生成(数组) | |
| 图片处理(单张) | |
| 视频 | |
| 音乐 | |
| 帧提取 | |
Common App IDs
常用应用ID
fal-ai/nano-banana-pro
fal-ai/nano-banana-pro/edit
fal-ai/text-concat
fal-ai/workflow-utilities/merge-text
fal-ai/bytedance/seedance/v1.5/pro/image-to-video
fal-ai/kling-video/o1/image-to-video
fal-ai/kling-video/v2.6/pro/image-to-video
fal-ai/elevenlabs/music
fal-ai/ffmpeg-api/merge-videos
fal-ai/ffmpeg-api/merge-audio-video
fal-ai/ffmpeg-api/extract-frame
fal-ai/seedvr/upscale/image
openrouter/router
openrouter/router/visionfal-ai/nano-banana-pro
fal-ai/nano-banana-pro/edit
fal-ai/text-concat
fal-ai/workflow-utilities/merge-text
fal-ai/bytedance/seedance/v1.5/pro/image-to-video
fal-ai/kling-video/o1/image-to-video
fal-ai/kling-video/v2.6/pro/image-to-video
fal-ai/elevenlabs/music
fal-ai/ffmpeg-api/merge-videos
fal-ai/ffmpeg-api/merge-audio-video
fal-ai/ffmpeg-api/extract-frame
fal-ai/seedvr/upscale/image
openrouter/router
openrouter/router/visionInput Schema
输入Schema
json
"schema": {
"input": {
"text_field": {
"name": "text_field",
"label": "Display Label",
"type": "string",
"description": "Help text",
"required": true,
"modelId": "consuming-node"
},
"image_urls": {
"name": "image_urls",
"type": { "kind": "list", "elementType": "string" },
"required": true,
"modelId": "node-id"
}
}
}json
"schema": {
"input": {
"text_field": {
"name": "text_field",
"label": "Display Label",
"type": "string",
"description": "Help text",
"required": true,
"modelId": "consuming-node"
},
"image_urls": {
"name": "image_urls",
"type": { "kind": "list", "elementType": "string" },
"required": true,
"modelId": "node-id"
}
}
}Pre-Output Checklist
输出前检查清单
Before outputting any workflow, verify:
- ⚠️ All nodes have or
type: "run"ONLY (NOtype: "display"!)type: "input" - ⚠️ No string interpolation - variable MUST be ENTIRE value
- Every has matching
$node.xxxentrydepends - Every node matches object key
id - Input schema has for each field
modelId - Output depends on ALL referenced nodes
- Correct LLM type (router vs router/vision)
在输出任何工作流之前,请验证:
- ⚠️ 所有节点仅使用或
type: "run"(禁止使用type: "display"!)type: "input" - ⚠️ 无字符串插值 - 变量必须是整个值
- 每个都有对应的
$node.xxx条目depends - 每个节点的与对象键匹配
id - 输入Schema的每个字段都有
modelId - 输出依赖所有引用的节点
- 使用正确的LLM类型(router vs router/vision)
Usage
使用方法
Using Script
使用脚本
bash
bash /mnt/skills/user/fal-workflow/scripts/create-workflow.sh \
--name "my-workflow" \
--title "My Workflow Title" \
--nodes '[...]' \
--outputs '{...}'bash
bash /mnt/skills/user/fal-workflow/scripts/create-workflow.sh \
--name "my-workflow" \
--title "My Workflow Title" \
--nodes '[...]' \
--outputs '{...}'Using MCP Tool
使用MCP工具
javascript
mcp__fal-ai__create-workflow({
smartMode: true,
intent: "Generate a story with LLM, create an illustration, then animate it"
})javascript
mcp__fal-ai__create-workflow({
smartMode: true,
intent: "Generate a story with LLM, create an illustration, then animate it"
})Troubleshooting
故障排除
Invalid Node Type Error (MOST COMMON)
无效节点类型错误(最常见)
Error: unexpected value; permitted: 'run', 'display', field requiredCause: You created a node with which does NOT exist.
Solution: Remove ANY node with . Define input fields ONLY in .
type: "input"type: "input"schema.inputError: unexpected value; permitted: 'run', 'display', field required原因: 创建了包含的节点,该类型不存在。
解决方案: 删除所有的节点。仅在中定义输入字段。
type: "input"type: "input"schema.inputDependency Error
依赖错误
Error: Node references $node-x but doesn't depend on itSolution: Add the referenced node to the array.
dependsError: Node references $node-x but doesn't depend on it解决方案: 将引用的节点添加到数组中。
dependsID Mismatch Error
ID不匹配错误
Error: Node key "my-node" doesn't match id "different-id"Solution: Ensure the object key matches the field exactly.
idError: Node key "my-node" doesn't match id "different-id"解决方案: 确保对象键与字段完全匹配。
idLLM Vision Error
LLM视觉错误
Error: image_urls provided but using text-only routerSolution: Switch to when analyzing images.
openrouter/router/visionError: image_urls provided but using text-only router解决方案: 在分析图片时切换为。
openrouter/router/visionFinding Model Schemas
查找模型Schema
Every model's input/output schema:
https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=[endpoint_id]Example:
https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/nano-banana-pro每个模型的输入/输出Schema:
https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=[endpoint_id]示例:
https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/nano-banana-pro