Generate images and media using fal.ai API (Flux, Gemini image, etc.). Use when asked to generate images, run AI image models, create visuals, or anything involving fal.ai. Handles queue-based requests with automatic polling.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install falai或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install falai⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/falai/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: fal-ai description: Generate images and media using fal.ai API (Flux, Gemini image, etc.). Use when asked to generate images, run AI image models, create visuals, or anything involving fal.ai. Handles queue-based requests with automatic polling. ---
Generate and edit images via fal.ai's queue-based API.
Add your API key to TOOLS.md:
### fal.ai
FAL_KEY: your-key-here
Get a key at: https://fal.ai/dashboard/keys
The script checks (in order): FAL_KEY env var → TOOLS.md
Google's Gemini 3 Pro for text-to-image generation.
input_data = {
"prompt": "A cat astronaut on the moon", # required
"aspect_ratio": "1:1", # auto|21:9|16:9|3:2|4:3|5:4|1:1|4:5|3:4|2:3|9:16
"resolution": "1K", # 1K|2K|4K
"output_format": "png", # jpeg|png|webp
"safety_tolerance": "4" # 1 (strict) to 6 (permissive)
}
Gemini 3 Pro for image editing. Slower (~20s) but handles complex edits well.
input_data = {
"prompt": "Transform into anime style", # required
"image_urls": [image_data_uri], # required - array of URLs or base64 data URIs
"aspect_ratio": "auto",
"resolution": "1K",
"output_format": "png"
}
FLUX.1 dev model. Faster (~2-3s) for style transfers.
input_data = {
"prompt": "Anime style portrait", # required
"image_url": image_data_uri, # required - single URL or base64 data URI
"strength": 0.85, # 0-1, higher = more change
"num_inference_steps": 40,
"guidance_scale": 7.5,
"output_format": "png"
}
Kling O3 Pro for video transformation with AI effects.
Limits:
input_data = {
# Required
"prompt": "Change environment to be fully snow as @Image1. Replace animal with @Element1",
"video_url": "https://example.com/video.mp4", # .mp4/.mov, 3-10s, 720-2160px, max 200MB
# Optional
"image_urls": [ # style/appearance references
"https://example.com/snow_ref.jpg" # use as @Image1, @Image2 in prompt
],
"keep_audio": True, # keep original audio (default: true)
"elements": [ # characters/objects to inject
{
"reference_image_urls": [ # reference images for the element
"https://example.com/element_ref1.png"
],
"frontal_image_url": "https://example.com/element_front.png" # frontal view (better results)
}
], # use as @Element1, @Element2 in prompt
"shot_type": "customize" # multi-shot type (default: customize)
}
Prompt references:
@Video1 — the input video@Image1, @Image2 — reference images for style/appearance@Element1, @Element2 — elements (characters/objects) to injectThe skill validates inputs before submission. For multi-input models, ensure all required fields are provided:
# Check what a model needs
python3 scripts/fal_client.py model-info "fal-ai/kling-video/o3/standard/video-to-video/edit"
# List all models with their requirements
python3 scripts/fal_client.py models
Before submitting, verify:
required fields are present and non-emptyimage_url, video_url, etc.) are URLs or base64 data URIsimage_urls) have at least one itemExample validation output:
⚠️ Note: Reference video in prompt as @Video1
⚠️ Note: Max 4 total elements (video + images combined)
❌ Validation failed:
- Missing required field: video_url
# Check API key
python3 scripts/fal_client.py check-key
# Submit a request
python3 scripts/fal_client.py submit "fal-ai/nano-banana-pro" '{"prompt": "A sunset over mountains"}'
# Check status
python3 scripts/fal_client.py status "fal-ai/nano-banana-pro" "<request_id>"
# Get result
python3 scripts/fal_client.py result "fal-ai/nano-banana-pro" "<request_id>"
# Poll all pending requests
python3 scripts/fal_client.py poll
# List pending requests
python3 scripts/fal_client.py list
# Convert local image to base64 data URI
python3 scripts/fal_client.py to-data-uri /path/to/image.jpg
# Convert local video to base64 data URI (with validation)
python3 scripts/fal_client.py video-to-uri /path/to/video.mp4
import sys
sys.path.insert(0, 'scripts')
from fal_client import submit, check_status, get_result, image_to_data_uri, poll_pending
# Text to image
result = submit('fal-ai/nano-banana-pro', {
'prompt': 'A futuristic city at night'
})
print(result['request_id'])
# Image to image (with local file)
img_uri = image_to_data_uri('/path/to/photo.jpg')
result = submit('fal-ai/nano-banana-pro/edit', {
'prompt': 'Transform into watercolor painting',
'image_urls': [img_uri]
})
# Poll until complete
completed = poll_pending()
for req in completed:
if 'result' in req:
print(req['result']['images'][0]['url'])
fal.ai uses async queues. Requests go through stages:
IN_QUEUE → waitingIN_PROGRESS → generatingCOMPLETED → done, fetch resultFAILED → error occurredPending requests are saved to ~/. openclaw/workspace/fal-pending.json and survive restarts.
Manual: Run python3 scripts/fal_client.py poll periodically.
Heartbeat: Add to HEARTBEAT.md:
- Poll fal.ai pending requests if any exist
Cron: Schedule polling every few minutes for background jobs.
/api pagereferences/models.json with input/output schemaNote: Queue URLs use base model path (e.g., fal-ai/flux not fal-ai/flux/dev/image-to-image). The script handles this automatically.
skills/fal-ai/
├── SKILL.md ← This file
├── scripts/
│ └── fal_client.py ← CLI + Python library
└── references/
└── models.json ← Model schemas
"No FAL_KEY found" → Add key to TOOLS.md or set FAL_KEY env var
405 Method Not Allowed → URL routing issue, ensure using base model path for status/result
Request stuck → Check fal-pending.json, may need manual cleanup
安装 Fal Ai 后,可以对 AI 说这些话来触发它
Help me get started with Fal Ai
Explains what Fal Ai does, walks through the setup, and runs a quick demo based on your current project
Use Fal Ai to generate images and media using fal
Invokes Fal Ai with the right parameters and returns the result directly in the conversation
What can I do with Fal Ai in my design & creative workflow?
Lists the top use cases for Fal Ai, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/falai/ 目录(个人级,所有项目可用),或 .claude/skills/falai/(项目级)。重启 AI 客户端后,用 /falai 主动调用,或让 AI 根据上下文自动发现并使用。
Fal Ai 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Fal Ai 可免费安装使用。请查阅仓库了解许可证信息。
Generate images and media using fal.ai API (Flux, Gemini image, etc.). Use when asked to generate images, run AI image models, create visuals, or anything involving fal.ai. Handles queue-based requests with automatic polling.
Fal Ai 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my design & creative tasks using Fal Ai
Identifies repetitive steps in your workflow and sets up Fal Ai to handle them automatically