
fal-ai
Generate images, videos, and audio with fal.ai serverless AI. Use when building AI image generation, video generation, image editing, or real-time AI features. Triggers on fal.ai, fal, AI image generation, Flux, SDXL, real-time AI, serverless AI.
- Installs
- 175
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/hoodini/ai-agents-skills --skill fal-ai- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads fal-ai automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
fal.ai - Serverless AI Platform
Generate images, videos, and audio with fal.ai's fast serverless inference.
Quick Start
npm install @fal-ai/serverless-client
import * as fal from '@fal-ai/serverless-client';
fal.config({
credentials: process.env.FAL_KEY,
});
// Generate image with Flux
const result = await fal.subscribe('fal-ai/flux/dev', {
input: {
prompt: 'A serene Japanese garden with cherry blossoms',
image_size: 'landscape_16_9',
num_images: 1,
},
});
console.log(result.images[0].url);
Authentication
// Option 1: Environment variable (recommended)
// Set FAL_KEY in .env
fal.config({ credentials: process.env.FAL_KEY });
// Option 2: Direct config
fal.config({ credentials: 'your-api-key' });
// Option 3: Proxy (for client-side apps)
// Use fal.config({ proxyUrl: '/api/fal/proxy' }) on client
Image Generation Models
Flux (Fastest, High Quality)
// Flux Dev - Best quality
const result = await fal.subscribe('fal-ai/flux/dev', {
input: {
prompt: 'Professional headshot of a business executive',
image_size: 'square_hd', // 1024x1024
num_inference_steps: 28,
guidance_scale: 3.5,
num_images: 1,
enable_safety_checker: true,
},
});
// Flux Schnell - Ultra fast (~0.5s)
const fast = await fal.subscribe('fal-ai/flux/schnell', {
input: {
prompt: 'A cute robot',
image_size: 'square',
num_inference_steps: 4, // Schnell needs fewer steps
},
});
// Flux Pro - Highest quality
const pro = await fal.subscribe('fal-ai/flux-pro', {
input: {
prompt: 'Hyperrealistic portrait',
image_size: 'portrait_4_3',
safety_tolerance: '2',
},
});
Image Sizes
type ImageSize =
| 'square_hd' // 1024x1024
| 'square' // 512x512
| 'portrait_4_3' // 768x1024
| 'portrait_16_9' // 576x1024
| 'landscape_4_3' // 1024x768
| 'landscape_16_9' // 1024x576
| { width: number; height: number }; // Custom
SDXL & Stable Diffusion
// SDXL
const sdxl = await fal.subscribe('fal-ai/fast-sdxl', {
input: {
prompt: 'Fantasy landscape',
negative_prompt: 'blurry, low quality',
image_size: 'landscape_16_9',
num_inference_steps: 25,
guidance_scale: 7.5,
scheduler: 'DPM++ 2M Karras',
},
});
// Stable Diffusion 3
const sd3 = await fal.subscribe('fal-ai/stable-diffusion-v3-medium', {
input: {
prompt: 'A mountain lake at sunset',
negative_prompt: 'ugly, deformed',
image_size: 'landscape_16_9',
},
});
Image-to-Image
Image Editing with Flux
// Image to image
const result = await fal.subscribe('fal-ai/flux/dev/image-to-image', {
input: {
prompt: 'Transform to watercolor painting style',
image_url: 'https://example.com/photo.jpg',
strength: 0.75, // How much to change (0-1)
num_inference_steps: 28,
},
});
// Inpainting (edit specific areas)
const inpaint = await fal.subscribe('fal-ai/flux/dev/inpainting', {
input: {
prompt: 'A red sports car',
image_url: 'https://example.com/street.jpg',
mask_url: 'https://example.com/mask.png', // White = edit area
},
});
ControlNet
// Generate with pose/edge control
const controlled = await fal.subscribe('fal-ai/flux-controlnet', {
input: {
prompt: 'A professional dancer',
control_image_url: 'https://example.com/pose.jpg',
controlnet_conditioning_scale: 0.8,
},
});
Video Generation
Kling Video
const video = await fal.subscribe('fal-ai/kling-video/v1/standard/text-to-video', {
input: {
prompt: 'A golden retriever running through a field of flowers',
duration: '5', // seconds
aspect_ratio: '16:9',
},
});
console.log(video.video.url);
Image to Video
const i2v = await fal.subscribe('fal-ai/kling-video/v1/standard/image-to-video', {
input: {
prompt: 'The person starts walking forward',
image_url: 'https://example.com/person.jpg',
duration: '5',
},
});
Luma Dream Machine
const luma = await fal.subscribe('fal-ai/luma-dream-machine', {
input: {
prompt: 'A timelapse of clouds moving over mountains',
aspect_ratio: '16:9',
},
});
Real-Time Generation
WebSocket Streaming
import * as fal from '@fal-ai/serverless-client';
// Real-time image generation with streaming
const stream = await fal.stream('fal-ai/flux/dev', {
input: {
prompt: 'A beautiful sunset',
image_size: 'landscape_16_9',
},
});
for await (const event of stream) {
if (event.images) {
console.log('Generated:', event.images[0].url);
}
}
Real-Time SDXL (Low Latency)
// Ultra-low latency for interactive apps
const realtime = await fal.subscribe('fal-ai/fast-lcm-diffusion', {
input: {
prompt: 'Abstract art',
image_size: 'square',
num_inference_steps: 4, // LCM needs very few steps
},
});
Background Removal & Editing
// Remove background
const nobg = await fal.subscribe('fal-ai/birefnet', {
input: {
image_url: 'https://example.com/photo.jpg',
},
});
// Upscale image
const upscaled = await fal.subscribe('fal-ai/creative-upscaler', {
input: {
image_url: 'https://example.com/small.jpg',
scale: 2,
creativity: 0.5,
prompt: 'High quality, detailed',
},
});
// Face swap
const swapped = await fal.subscribe('fal-ai/face-swap', {
input: {
base_image_url: 'https://example.com/target.jpg',
swap_image_url: 'https://example.com/face.jpg',
},
});
Next.js Integration
API Route (App Router)
// app/api/generate/route.ts
import * as fal from '@fal-ai/serverless-client';
import { NextRequest, NextResponse } from 'next/server';
fal.config({ credentials: process.env.FAL_KEY });
export async function POST(request: NextRequest) {
const { prompt, model = 'fal-ai/flux/schnell' } = await request.json();
try {
const result = await fal.subscribe(model, {
input: {
prompt,
image_size: 'landscape_16_9',
num_images: 1,
},
});
return NextResponse.json({
imageUrl: result.images[0].url,
seed: result.seed,
});
} catch (error) {
return NextResponse.json({ error: 'Generation failed' }, { status: 500 });
}
}
Proxy Route for Client-Side
// app/api/fal/proxy/route.ts
import { route } from '@fal-ai/serverless-client/server-proxy';
export const { GET, POST, PUT, DELETE } = route;
// Client-side usage
'use client';
import * as fal from '@fal-ai/serverless-client';
fal.config({ proxyUrl: '/api/fal/proxy' });
async function generateImage(prompt: string) {
const result = await fal.subscribe('fal-ai/flux/schnell', {
input: { prompt, image_size: 'square_hd' },
});
return result.images[0].url;
}
Queue System for Long Tasks
// Submit to queue (returns immediately)
const { request_id } = await fal.queue.submit('fal-ai/flux/dev', {
input: { prompt: 'Complex scene', num_images: 4 },
});
// Check status
const status = await fal.queue.status('fal-ai/flux/dev', {
requestId: request_id,
});
console.log(status.status); // 'IN_QUEUE' | 'IN_PROGRESS' | 'COMPLETED'
// Get result when ready
if (status.status === 'COMPLETED') {
const result = await fal.queue.result('fal-ai/flux/dev', {
requestId: request_id,
});
}
// Or use webhooks
await fal.queue.submit('fal-ai/flux/dev', {
input: { prompt: 'Scene' },
webhookUrl: 'https://your-server.com/webhook',
});
Model Comparison
| Model | Speed | Quality | Best For |
|---|---|---|---|
| flux/schnell | ~0.5s | Good | Real-time, previews |
| flux/dev | ~3s | Excellent | Production images |
| flux-pro | ~5s | Best | Professional work |
| fast-sdxl | ~2s | Good | General purpose |
| sd-v3-medium | ~4s | Excellent | Detailed scenes |
| kling-video | ~60s | Good | Video generation |
Resources
- fal.ai Docs: https://fal.ai/docs
- Model Gallery: https://fal.ai/models
- API Reference: https://fal.ai/docs/api-reference
- Pricing: https://fal.ai/pricing
FAQ
What does the fal-ai skill do?
Generate images, videos, and audio with fal.ai serverless AI. Use when building AI image generation, video generation, image editing, or real-time AI features. Triggers on fal.ai, fal, AI image generation, Flux, SDXL, real-time AI, serverless AI.
How do I install fal-ai?
Run npx skills add https://github.com/hoodini/ai-agents-skills --skill fal-ai in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/fal-ai/ (personal) or .claude/skills/fal-ai/ (project).
Which AI agents can use fal-ai?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is fal-ai safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains fal-ai?
It is published by hoodini in hoodini/ai-agents-skills. It has 175 recorded installs.
More from hoodini/ai-agents-skills
github-trending
hoodini/ai-agents-skills
Fetch and display GitHub trending repositories and developers. Use when building dashboards showing trending repos, discovering popular projects, or tracking GitHub trends. Triggers on GitHub trending, trending repos, popular repositories, GitHub discover.
owasp-security
hoodini/ai-agents-skills
Implement secure coding practices following OWASP Top 10. Use when preventing security vulnerabilities, implementing authentication, securing APIs, or conducting security reviews. Triggers on OWASP, security, XSS, SQL injection, CSRF, authentication security, secure coding, vulnerability.
mongodb
hoodini/ai-agents-skills
Work with MongoDB databases using best practices. Use when designing schemas, writing queries, building aggregation pipelines, or optimizing performance. Triggers on MongoDB, Mongoose, NoSQL, aggregation pipeline, document database, MongoDB Atlas.
mobile-responsiveness
hoodini/ai-agents-skills
Build responsive, mobile-first web applications. Use when implementing responsive layouts, touch interactions, mobile navigation, or optimizing for various screen sizes. Triggers on responsive design, mobile-first, breakpoints, touch events, viewport.
google-workspace-cli
hoodini/ai-agents-skills
Open the skill to read its SKILL.md instructions.
web-accessibility
hoodini/ai-agents-skills
Open the skill to read its SKILL.md instructions.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image