fal-agent
fal-agent是一个基于Bun和TypeScript构建的CLI工具,同时也是一个Claude Code技能,旨在利用fal.ai模型生成高质量的图片和视频。它支持文本到图片、文本到视频以及图片到视频的多种生成模式,并采用队列处理机制,有效提升了内容创作的效率和批量处理能力。
npx skills add aleSheng/fal-agentBefore / After 效果对比
1 组手动调用API或编写复杂脚本,生成图片和视频耗时且流程繁琐,难以批量管理。
通过CLI工具快速指令生成,支持队列处理,大幅简化流程,显著提升AI内容创作效率。
description SKILL.md
name: fal-generate description: Generate images and videos using fal.ai models. Use when the user asks to create, generate, or make images, pictures, videos, animations, or visual content. Supports text-to-image, text-to-video, and image-to-video generation with queue-based processing. metadata: author: falagent version: "0.1.0"
fal.ai Image & Video Generation
Generate images and videos from text prompts using fal.ai's AI models.
Setup
If FAL_KEY is not configured, run:
cd /Users/yzlabmac/agentspace/falagent && bun run setup
Or set directly:
export FAL_KEY=your_key_here
Generate Images
cd /Users/yzlabmac/agentspace/falagent && bun run generate --prompt "DESCRIPTION" --model MODEL [--size square|portrait|landscape] [--num-images N]
Recommended image models:
fal-ai/nano-banana-pro- Best quality, semantic-aware generation (default)fal-ai/flux-pro/v1.1-ultra- High quality, fastfal-ai/recraft-v3- Stylized images
Generate Videos
cd /Users/yzlabmac/agentspace/falagent && bun run generate --prompt "DESCRIPTION" --model MODEL
Recommended video models:
fal-ai/veo3- Highest quality text-to-videofal-ai/kling-video/v2.1/standard- Fast text-to-videofal-ai/minimax-video/video-01-live- Good for short clips
Image-to-Video
First upload the image, then generate:
cd /Users/yzlabmac/agentspace/falagent && bun run upload --file /path/to/image.jpg
cd /Users/yzlabmac/agentspace/falagent && bun run generate --prompt "MOTION DESCRIPTION" --model fal-ai/kling-video/v2.1/pro/image-to-video --image-url IMAGE_URL
Recommended image-to-video models:
fal-ai/kling-video/v2.1/pro/image-to-video- Best qualityfal-ai/wan/v2.1/image-to-video- Good alternative
Async Mode (for long videos)
For models that take a long time, use --async to get a request ID immediately:
cd /Users/yzlabmac/agentspace/falagent && bun run generate --prompt "..." --model fal-ai/veo3 --async
Then check status or get the result:
cd /Users/yzlabmac/agentspace/falagent && bun run generate --status REQUEST_ID --model fal-ai/veo3
cd /Users/yzlabmac/agentspace/falagent && bun run generate --result REQUEST_ID --model fal-ai/veo3
Search Models
cd /Users/yzlabmac/agentspace/falagent && bun run search --query "flux"
cd /Users/yzlabmac/agentspace/falagent && bun run search --query "video" --category text-to-video
Get Model Schema
cd /Users/yzlabmac/agentspace/falagent && bun run scripts/get-schema.ts --model fal-ai/flux/dev
Output Format
All scripts output JSON to stdout and status messages to stderr. The JSON result from generate contains:
- For images:
{ "images": [{ "url": "https://...", "content_type": "image/jpeg" }] } - For videos:
{ "video": { "url": "https://..." } }
Always show the user the URL(s) from the result so they can view the generated content.
forum用户评价 (0)
发表评价
暂无评价
统计数据
用户评分
为此 Skill 评分